BaseTaskBase¶
- class baseband_tasks.base.BaseTaskBase(ih, *, ih_samples_per_frame=None, start_time=None, shape=None, sample_rate=None, samples_per_frame=None, dtype=None, **kwargs)[source] [edit on github]¶
Bases:
baseband_tasks.base.Base
Base for all classes that operate on underlying streams.
Following the design of
baseband
stream readers, features properties describing the size, shape, data type, sample rate and start/stop times of the task’s output. Also defines methods to move a sample pointer across the output data in units of either complete samples or time.Subclasses should define
_read_frame
: method to read and process a single block of dataBy default, all parameters are taken from the underlying stream.
Note that no consistency checks are done between the parameters passed in and those of the underlying stream; the appropriate base class for most tasks is
TaskBase
.- Parameters
- ihstream handle
Handle of a stream reader or another task.
- ih_samples_per_frameint, optional
Number of input samples which should be dealt with in one go.
- shapetuple, optional
Overall shape of the stream, with first entry the total number of complete samples, and the remainder the sample shape.
- start_time
Time
, optional Start time of the stream.
- sample_rate
Quantity
, optional With units of a rate.
- samples_per_frameint, optional
Number of output samples produced per frame. By default, equal to the number of input samples.
- dtype
dtype
, optional Output dtype.
- — **kwargsmeta data for the stream, which usually include
- frequency
Quantity
, optional Frequencies for each channel. Should be broadcastable to the sample shape.
- sidebandarray, optional
Whether frequencies are upper (+1) or lower (-1) sideband. Should be broadcastable to the sample shape.
- polarizationarray or (nested) list of char, optional
Polarization labels. Should broadcast to the sample shape, i.e., the labels are in the correct axis. For instance,
['X', 'Y']
, or[['L'], ['R']]
.
Methods Summary
close
()Close task.
Methods Documentation
- close()[source] [edit on github]¶
Close task.
Note that this does not explicitly close the underlying source; instead, it just deletes the reference to it.