sigpyproc.block#
Block classes for handling 2D data blocks.
This module contains the base class for handling 2D data blocks and the FilterbankBlock and DMTBlock classes for handling filterbank and DM-time transform data blocks, respectively.
Classes
Base class for handling data blocks. |
|
A class to handle a DM-time transform block in time-major order. |
|
A class to handle a block of filterbank data in time-major order. |
- class sigpyproc.block.BaseBlock(data, header)[source]#
Bases:
ABCBase class for handling data blocks.
- Parameters:
- Attributes:
Methods
normalise([loc_method, scale_method, axis])Normalise/standardise the data block.
pad_samples(nsamps_final, offset[, pad_mode])Pad the data block with the given mode.
plot(*args, **kwargs)Plot the data block.
- normalise(loc_method='mean', scale_method='std', axis=1)[source]#
Normalise/standardise the data block.
Normalisation is performed by subtracting the loc estimate, and dividing by the scale estimate along the given axis.
- Parameters:
- loc_method{“mean”, “median”}, optional
Method to estimate location to subtract, by default “mean”.
- scale_method{“std”, “iqr”, “mad”}, optional
Method to estimate scale to divide by, by default “std”.
- axis
int, optional Axis along which to perform normalisation, by default 1.
- Returns:
BaseBlockNormalised data block.
- pad_samples(nsamps_final, offset, pad_mode='median')[source]#
Pad the data block with the given mode.
- Parameters:
- Returns:
BaseBlockPadded data block.
- Raises:
ValueErrorIf the
pad_modeis not “mean” or “median”.
- class sigpyproc.block.DMTBlock(data, header, dms)[source]#
Bases:
BaseBlockA class to handle a DM-time transform block in time-major order.
- Parameters:
- Attributes:
Methods
plot(*args, **kwargs)Plot the data block.
- class sigpyproc.block.FilterbankBlock(data, header, dm=0)[source]#
Bases:
BaseBlockA class to handle a block of filterbank data in time-major order.
- Parameters:
- Attributes:
Methods
dedisperse(dm[, ref_freq, only_valid_samples])Dedisperse the block.
dmt_transform(dm[, dmsteps, ref_freq, ...])Compute the DM-time transform.
downsample([ffactor, tfactor, filter_method])Downsample data block in frequency and/or time.
Sum across all time samples for each channel.
get_tim()Sum across all frequencies for each time sample.
plot(*args, **kwargs)Plot the data block.
to_file([filename])Write the data to file.
- downsample(ffactor=1, tfactor=1, filter_method='mean')[source]#
Downsample data block in frequency and/or time.
- Parameters:
- Returns:
FilterbankBlockDownsampled data block.
- get_tim()[source]#
Sum across all frequencies for each time sample.
- Returns:
TimeSeriesSum of all channels as timeseries.
- get_bandpass()[source]#
Sum across all time samples for each channel.
- Returns:
ndarrayBandpass of the data block.
- dedisperse(dm, ref_freq='fch1', *, only_valid_samples=False)[source]#
Dedisperse the block.
Frequency dependent delays are applied as rotations to each channel in the block with respect to the reference frequency.
- Parameters:
- Returns:
FilterbankBlockDedispersed data block.
- Raises:
ValueErrorIf there are not enough time samples to dedisperse.