SetAttribute¶
- class baseband_tasks.base.SetAttribute(ih, *, start_time=None, sample_rate=None, **kwargs)[source] [edit on github]¶
Bases:
baseband_tasks.base.TaskBase
Wrapper for streams that allows one to set or change attributes.
Can be used to add
frequency
,sideband
andpolarization
attributes, which most baseband readers do not provide, checking that the values broadcast properly to the sample shape.Can also be used to apply a clock correction by changing
start_time
.The
sample_rate
can also be set, but no check is done to ensure it remains consistent with thefrequency
.One can also change the
shape
,samples_per_frames
, ordtype
but that will be slightly slower, as the class can then not read directly from the underlying stream.By default, all parameters are taken from the underlying stream.
- Parameters
- ihstream handle
Handle of a stream reader or another task.
- start_time
Time
, optional Start time of the stream.
- sample_rate
Quantity
, optional With units of a rate.
- **kwargs
Other parameters and metadata. See
TaskBase
.- — Possible metadata(see
BaseTaskBase
) - 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
simple_read
(*args, **kwargs)Read data from the underlying stream at the current offset.
task
(data)Methods Documentation
- simple_read(*args, **kwargs)[source] [edit on github]¶
Read data from the underlying stream at the current offset.
- task(data)[source] [edit on github]¶