draco.core.misc

Miscellaneous pipeline tasks with no where better to go.

Tasks should be proactively moved out of here when there is a thematically appropriate module, or enough related tasks end up in here such that they can all be moved out into their own module.

Classes

AccumulateList()

Accumulate the inputs into a list and return as a group.

ApplyGain()

Apply a set of gains to a timestream or sidereal stack.

CheckMPIEnvironment()

Check that the current MPI environment can communicate across all nodes.

DebugInfo()

Output some useful debug info.

MakeCopy()

Make a copy of the passed container.

PassOn()

Unconditionally forward a tasks input.

WaitUntil()

Wait until the the requires before forwarding inputs.

class draco.core.misc.AccumulateList[source]

Bases: MPILoggedTask

Accumulate the inputs into a list and return as a group.

If group_size is None, return when the task finishes. Otherwise, return every time group_size inputs have been accumulated.

group_size

If this is set, this task will return the list of accumulated data whenever it reaches this length. If not set, wait until no more input is received and then return everything.

Initialize pipeline task.

May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.

finish()[source]

Remove the internal reference.

Prevents the items from hanging around after the task finishes.

next(input_)[source]

Append an input to the list of inputs.

class draco.core.misc.ApplyGain[source]

Bases: SingleTask

Apply a set of gains to a timestream or sidereal stack.

inverse

Apply the gains directly, or their inverse.

Type:

bool, optional

update_weight

Scale the weight array with the updated gains.

Type:

bool, optional

smoothing_length

Smooth the gain timestream across the given number of seconds. Not supported (ignored) for Sidereal Streams.

Type:

float, optional

Initialize pipeline task.

May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.

process(tstream, gain)[source]

Apply gains to the given timestream.

Smoothing the gains is not supported for SiderealStreams.

Parameters:
Returns:

tstream – The timestream with the gains applied.

Return type:

TimeStream or SiderealStream

class draco.core.misc.CheckMPIEnvironment[source]

Bases: MPILoggedTask

Check that the current MPI environment can communicate across all nodes.

Initialize pipeline task.

May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.

setup()[source]

Send random messages between all ranks.

Tests to ensure that all messages are received within a specified amount of time, and that the messages received are the same as those sent (i.e. nothing was corrupted).

class draco.core.misc.DebugInfo[source]

Bases: MPILoggedTask, SetMPILogging

Output some useful debug info.

Initialize pipeline task.

May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.

class draco.core.misc.MakeCopy[source]

Bases: SingleTask

Make a copy of the passed container.

Initialize pipeline task.

May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.

process(data)[source]

Return a copy of the given container.

Parameters:

data (containers.ContainerBase) – The container to copy.

class draco.core.misc.PassOn[source]

Bases: MPILoggedTask

Unconditionally forward a tasks input.

While this seems like a pointless no-op it’s useful for connecting tasks in complex topologies.

Initialize pipeline task.

May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.

next(input_)[source]

Immediately forward any input.

class draco.core.misc.WaitUntil[source]

Bases: MPILoggedTask

Wait until the the requires before forwarding inputs.

This simple synchronization task will forward on whatever inputs it gets, however, it won’t do this until it receives any requirement to it’s setup method. This allows certain parts of the pipeline to be delayed until a piece of data further up has been generated.

Initialize pipeline task.

May be overridden with no arguments. Will be called after any config.Property attributes are set and after ‘input’ and ‘requires’ keys are set up.

next(input_)[source]

Immediately forward any input.

setup(input_)[source]

Accept, but don’t save any input.