Utility Operators

Utility Operators

class toast.ops.MemoryCounter(*, API=0, enabled=True, name=None, prefix='', silent=False, **kwargs)

Compute total memory used by Observations in a Data object.

Every process group iterates over their observations and sums the total memory used by detector and shared data. Metadata and interval lists are assumed to be negligible and are not counted.

Note

The following traits can be set at construction or afterwards

Variables
  • API (int) – Internal interface version for this operator (default = 0)

  • enabled (bool) – If True, this class instance is marked as enabled (default = True)

  • name (str) – The ‘name’ of this class instance (default = ‘None’)

  • prefix (str) – Prefix for log messages (default = ‘’)

  • silent (bool) – If True, return the memory used but do not log the result (default = False)

class toast.ops.Copy(*, API=0, detdata, enabled=True, intervals, meta, name=None, shared, **kwargs)

Class to copy data.

This operator takes lists of shared, detdata, and meta keys to copy to a new location in each observation.

Each list contains tuples specifying the input and output key names.

Note

The following traits can be set at construction or afterwards

Variables
  • API (int) – Internal interface version for this operator (default = 0)

  • detdata (list) – List of tuples of Observation detdata keys to copy (default = traitlets.Undefined)

  • enabled (bool) – If True, this class instance is marked as enabled (default = True)

  • intervals (list) – List of tuples of Observation intervals keys to copy (default = traitlets.Undefined)

  • meta (list) – List of tuples of Observation meta keys to copy (default = traitlets.Undefined)

  • name (str) – The ‘name’ of this class instance (default = ‘None’)

  • shared (list) – List of tuples of Observation shared keys to copy (default = traitlets.Undefined)

class toast.ops.Delete(*, API=0, detdata, enabled=True, intervals, meta, name=None, shared, **kwargs)

Class to purge data from observations.

This operator takes lists of shared, detdata, intervals and meta keys to delete from observations.

Note

The following traits can be set at construction or afterwards

Variables
  • API (int) – Internal interface version for this operator (default = 0)

  • detdata (list) – List of Observation detdata keys to delete (default = traitlets.Undefined)

  • enabled (bool) – If True, this class instance is marked as enabled (default = True)

  • intervals (list) – List of tuples of Observation intervals keys to delete (default = traitlets.Undefined)

  • meta (list) – List of Observation dictionary keys to delete (default = traitlets.Undefined)

  • name (str) – The ‘name’ of this class instance (default = ‘None’)

  • shared (list) – List of Observation shared keys to delete (default = traitlets.Undefined)

class toast.ops.Add(*, API=0, enabled=True, first=None, name=None, second=None, **kwargs)

Add two detdata timestreams.

The result is stored in the first detdata object.

Note

The following traits can be set at construction or afterwards

Variables
  • API (int) – Internal interface version for this operator (default = 0)

  • enabled (bool) – If True, this class instance is marked as enabled (default = True)

  • first (str) – The first detdata object (default = ‘None’)

  • name (str) – The ‘name’ of this class instance (default = ‘None’)

  • second (str) – The second detdata object (default = ‘None’)

class toast.ops.Subtract(*, API=0, enabled=True, first=None, name=None, second=None, **kwargs)

Subtract two detdata timestreams.

The result is stored in the first detdata object.

Note

The following traits can be set at construction or afterwards

Variables
  • API (int) – Internal interface version for this operator (default = 0)

  • enabled (bool) – If True, this class instance is marked as enabled (default = True)

  • first (str) – The first detdata object (default = ‘None’)

  • name (str) – The ‘name’ of this class instance (default = ‘None’)

  • second (str) – The second detdata object (default = ‘None’)

class toast.ops.Reset(*, API=0, detdata, enabled=True, intervals, meta, name=None, shared, **kwargs)

Class to reset data from observations.

This operator takes lists of shared, detdata, intervals, and meta keys to reset. Numerical data objects and arrays are set to zero. String objects are set to an empty string. Any object that defines a clear() method will have that called. Any object not matching those criteria will be set to None. Since an IntervalList is not mutable, any specified intervals will simply be deleted.

Note

The following traits can be set at construction or afterwards

Variables
  • API (int) – Internal interface version for this operator (default = 0)

  • detdata (list) – List of Observation detdata keys to reset (default = traitlets.Undefined)

  • enabled (bool) – If True, this class instance is marked as enabled (default = True)

  • intervals (list) – List of tuples of Observation intervals keys to reset (default = traitlets.Undefined)

  • meta (list) – List of Observation dictionary keys to reset (default = traitlets.Undefined)

  • name (str) – The ‘name’ of this class instance (default = ‘None’)

  • shared (list) – List of Observation shared keys to reset (default = traitlets.Undefined)

HDF5 I/O

class toast.ops.SaveHDF5(*, API=0, config, detdata, detdata_float32=False, enabled=True, force_serial=False, intervals, meta, name=None, shared, times='times', volume='toast_out_hdf5', **kwargs)

Operator which saves observations to HDF5.

This creates a file for each observation.

Note

The following traits can be set at construction or afterwards

Variables
  • API (int) – Internal interface version for this operator (default = 0)

  • config (dict) – Write this job config to the file (default = traitlets.Undefined)

  • detdata (list) – Only save this list of detdata objects (default = traitlets.Undefined)

  • detdata_float32 (bool) – If True, convert any float64 detector data to float32 on write. (default = False)

  • enabled (bool) – If True, this class instance is marked as enabled (default = True)

  • force_serial (bool) – Use serial HDF5 operations, even if parallel support available (default = False)

  • intervals (list) – Only save this list of intervals objects (default = traitlets.Undefined)

  • meta (list) – Only save this list of meta objects (default = traitlets.Undefined)

  • name (str) – The ‘name’ of this class instance (default = ‘None’)

  • shared (list) – Only save this list of shared objects (default = traitlets.Undefined)

  • times (str) – Observation shared key for timestamps (default = ‘times’)

  • volume (str) – Top-level directory for the data volume (default = ‘toast_out_hdf5’)

class toast.ops.LoadHDF5(*, API=0, detdata, enabled=True, force_serial=False, intervals, meta, name=None, process_rows=None, shared, sort_by_size=False, volume=None, **kwargs)

Operator which loads HDF5 data files into observations.

This operator expects a top-level volume directory.

Note

The following traits can be set at construction or afterwards

Variables
  • API (int) – Internal interface version for this operator (default = 0)

  • detdata (list) – Only load this list of detdata objects (default = traitlets.Undefined)

  • enabled (bool) – If True, this class instance is marked as enabled (default = True)

  • force_serial (bool) – Use serial HDF5 operations, even if parallel support available (default = False)

  • intervals (list) – Only load this list of intervals objects (default = traitlets.Undefined)

  • meta (list) – Only load this list of meta objects (default = traitlets.Undefined)

  • name (str) – The ‘name’ of this class instance (default = ‘None’)

  • process_rows (int) – The size of the rectangular process grid in the detector direction. (default = None)

  • shared (list) – Only load this list of shared objects (default = traitlets.Undefined)

  • sort_by_size (bool) – If True, sort observations by size before load balancing (default = False)

  • volume (str) – Top-level directory containing the data volume (default = ‘None’)

SPT3G Interfaces