pulsarbat.IntensitySignal#
- class pulsarbat.IntensitySignal(z, /, *, sample_rate, start_time=None, center_freq, chan_bw, freq_align='center', meta=None)[source]#
Class for intensity signals.
See the documentation for
RadioSignalfor more details.- Parameters
- zarray-like
The signal data. Must be at least 3-dimensional with shape
(nsample, nchan, npol, ...).- sample_rate
Quantity The number of samples per second. Must be in units of frequency.
- start_time
Time, optional The start time of the signal (that is, the time at the first sample of the signal). Default is None.
- center_freq
Quantity The frequency at the center of the signal’s band. Must be in units of frequency.
- chan_bw
Quantity The bandwidth of a channel. The total bandwidth is
chan_bw * nchan. Must be in units of frequency.- freq_align{‘bottom’, ‘center’, ‘top’}, default: ‘center’
The alignment of channels relative to the
center_freq. Default is ‘center’ (as with odd-length complex DFTs). ‘bottom’ and ‘top’ only have an effect whennchanis even.- meta
dict, optional Any metadata that the user might want to attach to the signal.
See also
Attributes
axes_labelsDictionary of axes labels.
bandwidthTotal bandwidth.
center_freqCenter frequency.
chan_bwChannel bandwidth.
channel_freqsCenter frequencies of all channels.
dataThe signal data.
dtSample spacing of the signal (
1 / sample_rate).dtypeData type of the signal.
freq_alignAlignment of channel frequencies.
max_freqFrequency at top of the band.
metaSignal metadata.
min_freqFrequency at bottom of the band.
nchanNumber of frequency channels.
ndimNumber of dimensions in data.
sample_rateSample rate of the signal.
sample_shapeShape of a sample.
shapeShape of the signal.
start_timeStart time of the signal (Time at first sample).
stop_timeStop time of the signal (Time at sample after the last sample).
time_lengthLength of signal in time units.
Methods
compute(**kwargs)Returns signal with computed data.
contains(t, /)Whether time(s) are within the bounds of the signal.
get_axis(axis)Axis number from an integer or axis label.
like(obj[, z])Returns a signal object "like" given signal object.
persist(**kwargs)Returns signal with data persisted in memory.
rechunk([chunks])Rechunks signal data if stored as a Dask array.
Returns signal with data as a Dask array.
- compute(**kwargs)#
Returns signal with computed data.
Has no effect unless data is stored as a Dask Array.
kwargsare passed on to thedask.compute()function.
- contains(t, /)#
Whether time(s) are within the bounds of the signal.
- get_axis(axis)#
Axis number from an integer or axis label.
- classmethod like(obj, z=None, /, **kwargs)#
Returns a signal object “like” given signal object.
This classmethod inspects the class signature and creates a signal object like the given reference object. The signal data (as an array) must always be provided as well as any other arguments that are intended to be different than the reference object. All arguments required by the class signature that are not provided are acquired from attributes of the same name in the reference object.
- Parameters
- obj
Signal The reference signal object.
- zarray-like
The signal data.
- **kwargs
Additional keyword arguments to pass on to the target class.
- obj
- persist(**kwargs)#
Returns signal with data persisted in memory.
Has no effect unless data is stored as a Dask Array.
kwargsare passed on to thedask.persist()function.
- rechunk(chunks=None, **kwargs)#
Rechunks signal data if stored as a Dask array.
If the underlying data is not a Dask array, it is converted to one first. By default, there is no chunking along the first dimension and other dimensions are automatically chunked based on the default chunk size set in Dask’s configuration.
kwargsare passed along todask.array.rechunk().
- to_dask_array()#
Returns signal with data as a Dask array.
Uses
dask.array.asanyarray()to convert signal data to a Dask array.