ska_pst.stat.utility

This module for utility class to generate Gaussian random data.

class ska_pst.stat.utility.Hdf5FileGenerator(file_path: pathlib.Path | str, eb_id: str, telescope: str, scan_id: int, beam_id: str, config: StatConfig, utc_start: Optional[str] = None)[source]

Class used to generate a random HD5F statistics file.

generate() None[source]

Generate a HDF5 file to use in a test.

property stats: Statistics

Get generated statistics.

This will throw an AssertionError if generate() has not been called.

class ska_pst.stat.utility.StatConfig(*, npol: int = 2, ndim: int = 2, nchan: int = 432, nsamp: int = 32, nheap: int = 1, nbit: int = 16, nfreq_bins: int = 36, ntime_bins: int = 4, nrebin: int = 256, sigma: float = 6.0, freq_mask: str = '', frequency_mhz: float = 87.5, bandwidth_mhz: float = 75.0, start_chan: int = 0, tsamp: float = 207.36, os_factor: float = 1.3333333333333333)[source]

A data class used as configuration for generating random data.

Variables
  • npol (int) – number of polarisations, default 2.

  • ndim (int) – number of dimensions in the data, default 2.

  • nchan (int) – number of channels in the data, default 432.

  • nsamp (int) – number of samples of each channel per heap, default 32.

  • nheap (int) – number of heaps of data to produce, default is 1.

  • nbit (int) – the number of bits per data, this can only be 8 or 16.

  • nfreq_bins (int) – requested number of frequency bins for spectrogram. This gets updated to be a factor of the number of channels.

  • ntime_bins (int) – requested number of temporal bins for spectrogram and timeseries. This gets updated to be a factor of the total number of samples per channel.

  • nrebin (int) – number of bins to use for rebinned histograms

  • sigma (float) – number standard deviations to use to clip data. This is only used in the generator.

  • freq_mask (str) – the frequency ranges to mask. (Currently not used)

  • frequency_mhz (float) – the centre frequency for the data as a whole

  • bandwidth_mhz (float) – the bandwidth of data

  • start_chan (int) – the starting channel number.

  • tsamp (float) – the time, in microseconds, per sample

  • os_factor (float) – the oversampling factor

bandwidth_mhz: float = 75.0
property clipped_high: int

Get the maximum value for the current nbit.

property clipped_low: int

Get the minimum value for the current nbit.

freq_mask: str = ''
frequency_mhz: float = 87.5
property nbin: int

Get the number of bins for histogram.

nbit: int = 16
property nbit_limit: int

Get the limit for current nbit.

nchan: int = 432
ndim: int = 2
nfreq_bins: int = 36
nheap: int = 1
property non_rfi_channel_indexes: List[int]

Get the index of channels that are not RFI excised.

npol: int = 2
nrebin: int = 256
nsamp: int = 32
ntime_bins: int = 4
os_factor: float = 1.3333333333333333
property rebin_max: int

Get the maximum value after rebinning.

property rebin_offset: int

Get the offset to apply when doing rebinning.

property rfi_excised_channel_indexes: List[int]

Get the indexes of the RFI excised channels.

property scale: float

Get scale of the Gaussian distribution.

sigma: float = 6.0
start_chan: int = 0
property total_sample_time: float

Get the total sample time in seconds.

property total_samples_per_channel: int

Get the total number of samples per channel.

tsamp: float = 207.36
property tsamp_secs: float

Get the TSAMP value in seconds.