ska_pst.stat.hdf5

This module is used for handling a HDF5 STAT file.

class ska_pst.stat.hdf5.Dimension(value)[source]

An enum used to represent the complex dimension/component within the data.

IMAG = 1
REAL = 0
property text: str

Map dimension enum value to text used in data frames.

Returns

‘Real’ if value is REAL else ‘Imag’

Return type

str

class ska_pst.stat.hdf5.Polarisation(value)[source]

An enum used to represent polarisation indexes within the data.

POL_A = 0
POL_B = 1
property text: str

Map polarisation enum value to text used in data frames.

Returns

‘A’ if value is POL_A else ‘B’

Return type

str

class ska_pst.stat.hdf5.StatisticsData(*, mean_frequency_avg: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.Float32), mean_frequency_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.Float32), variance_frequency_avg: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.Float32), variance_frequency_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.Float32), mean_spectrum: nptyping.NDArray.(typing.Literal['NPol, NDim, NChan'], nptyping.Float32), variance_spectrum: nptyping.NDArray.(typing.Literal['NPol, NDim, NChan'], nptyping.Float32), mean_spectral_power: nptyping.NDArray.(typing.Literal['NPol, NChan'], nptyping.Float32), max_spectral_power: nptyping.NDArray.(typing.Literal['NPol, NChan'], nptyping.Float32), histogram_1d_freq_avg: nptyping.NDArray.(typing.Literal['NPol, NDim, NBin'], nptyping.UInt32), histogram_1d_freq_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim, NBin'], nptyping.UInt32), rebinned_histogram_2d_freq_avg: nptyping.NDArray.(typing.Literal['NPol, NRebin, NRebin'], nptyping.UInt32), rebinned_histogram_2d_freq_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NRebin, NRebin'], nptyping.UInt32), rebinned_histogram_1d_freq_avg: nptyping.NDArray.(typing.Literal['NPol, NDim, NRebin'], nptyping.UInt32), rebinned_histogram_1d_freq_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim, NRebin'], nptyping.UInt32), num_clipped_samples_spectrum: nptyping.NDArray.(typing.Literal['NPol, NDim, NChan'], nptyping.UInt32), num_clipped_samples: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.UInt32), num_clipped_samples_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.UInt32), spectrogram: nptyping.NDArray.(typing.Literal['NPol, NFreqBin, NTimeBin'], nptyping.Float32), timeseries: nptyping.NDArray.(typing.Literal['NPol, NTimeBin, 3'], nptyping.Float32), timeseries_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NTimeBin, 3'], nptyping.Float32))[source]

A data class used to the calculated statistics from random data.

Variables
  • mean_frequency_avg (numpy.ndarray) – the mean of the data for each polarisation and dimension, averaged over all channels.

  • mean_frequency_avg_rfi_excised (numpy.ndarray) – the mean of the data for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

  • variance_frequency_avg (numpy.ndarray) – the variance of the data for each polarisation and dimension, averaged over all channels.

  • variance_frequency_avg_rfi_excised (numpy.ndarray) – the variance of the data for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

  • mean_spectrum (numpy.ndarray) – the mean of the data for each polarisation, dimension and channel.

  • variance_spectrum (numpy.ndarray) – the variance of the data for each polarisation, dimension and channel.

  • mean_spectral_power (numpy.ndarray) – mean power spectra of the data for each polarisation and channel.

  • max_spectral_power (numpy.ndarray) – maximum power spectra of the data for each polarisation and channel.

  • histogram_1d_freq_avg (numpy.ndarray) – histogram of the input data integer states for each polarisation and dimension, averaged over all channels.

  • histogram_1d_freq_avg_rfi_excised (numpy.ndarray) – histogram of the input data integer states for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

  • rebinned_histogram_2d_freq_avg (numpy.ndarray) – Rebinned 2D histogram of the input data integer states for each polarisation, averaged over all channels.

  • rebinned_histogram_2d_freq_avg_rfi_excised (numpy.ndarray) – Rebinned 2D histogram of the input data integer states for each polarisation, averaged over all channels, expect those flagged for RFI.

  • rebinned_histogram_1d_freq_avg (numpy.ndarray) – rebinned histogram of the input data integer states for each polarisation and dimension, averaged over all channels.

  • rebinned_histogram_1d_freq_avg_rfi_excised (numpy.ndarray) – rebinned histogram of the input data integer states for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

  • num_clipped_samples_spectrum (numpy.ndarray) – number of clipped input samples (maximum level) for each polarisation, dimension and channel.

  • num_clipped_samples (numpy.ndarray) – number of clipped input samples (maximum level) for each polarisation, dimension, averaged over all channels.

  • num_clipped_samples_rfi_excised (numpy.ndarray) – number of clipped input samples (maximum level) for each polarisation, dimension, avereaged over all channels, except those flagged for RFI.

  • spectrogram (numpy.ndarray) – spectrogram of the data for each polarisation, averaged a configurable number of temporal and spectral bins (default ~1000).

  • timeseries (numpy.ndarray) – time series of the data for each polarisation, rebinned in time to ntime_bins, averaged over all frequency channels.

  • timeseries_rfi_excised (numpy.ndarray) – time series of the data for each polarisation, re-binned in time to ntime_bins, averaged over all frequency channels, expect those flagged by RFI.

histogram_1d_freq_avg: nptyping.NDArray.(typing.Literal['NPol, NDim, NBin'], nptyping.UInt32)
histogram_1d_freq_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim, NBin'], nptyping.UInt32)
max_spectral_power: nptyping.NDArray.(typing.Literal['NPol, NChan'], nptyping.Float32)
mean_frequency_avg: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.Float32)
mean_frequency_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.Float32)
mean_spectral_power: nptyping.NDArray.(typing.Literal['NPol, NChan'], nptyping.Float32)
mean_spectrum: nptyping.NDArray.(typing.Literal['NPol, NDim, NChan'], nptyping.Float32)
num_clipped_samples: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.UInt32)
num_clipped_samples_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.UInt32)
num_clipped_samples_spectrum: nptyping.NDArray.(typing.Literal['NPol, NDim, NChan'], nptyping.UInt32)
rebinned_histogram_1d_freq_avg: nptyping.NDArray.(typing.Literal['NPol, NDim, NRebin'], nptyping.UInt32)
rebinned_histogram_1d_freq_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim, NRebin'], nptyping.UInt32)
rebinned_histogram_2d_freq_avg: nptyping.NDArray.(typing.Literal['NPol, NRebin, NRebin'], nptyping.UInt32)
rebinned_histogram_2d_freq_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NRebin, NRebin'], nptyping.UInt32)
spectrogram: nptyping.NDArray.(typing.Literal['NPol, NFreqBin, NTimeBin'], nptyping.Float32)
timeseries: nptyping.NDArray.(typing.Literal['NPol, NTimeBin, 3'], nptyping.Float32)
timeseries_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NTimeBin, 3'], nptyping.Float32)
variance_frequency_avg: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.Float32)
variance_frequency_avg_rfi_excised: nptyping.NDArray.(typing.Literal['NPol, NDim'], nptyping.Float32)
variance_spectrum: nptyping.NDArray.(typing.Literal['NPol, NDim, NChan'], nptyping.Float32)
class ska_pst.stat.hdf5.StatisticsMetadata(*, file_format_version: str = '1.0.0', eb_id: str, telescope: str, scan_id: int, beam_id: str, utc_start: str, t_min: float, t_max: float, frequency_mhz: float, bandwidth_mhz: float, start_chan: int, npol: int, ndim: int, nchan: int, nchan_ds: int, ndat_ds: int, histogram_nbin: int, nrebin: int, channel_freq_mhz: nptyping.NDArray.(typing.Literal['NChan'], nptyping.Float64), timeseries_bins: nptyping.NDArray.(typing.Literal['NTimeBin'], nptyping.Float64), frequency_bins: nptyping.NDArray.(typing.Literal['NFreqBin'], nptyping.Float64), num_samples: int, num_samples_rfi_excised: int, num_samples_spectrum: nptyping.NDArray.(typing.Literal['NChan'], nptyping.UInt32), num_invalid_packets: int)[source]

Data class modeling the metadata from a HDF5 STAT data file.

Variables
  • file_format_version (str) – the format of the HDF5 STAT file. Default is “1.0.0”

  • eb_id (str) – the execution block id the file relates to.

  • telescope (str) – the telescope the data were collected for. Should be SKALow or SKAMid

  • scan_id (int) – the scan id for the generated data file

  • beam_id (str) – the beam id for the generated data file

  • utc_start (str) – the UTC ISO formated start time in of scan to the nearest second.

  • t_min (float) – the time offset, in seconds, from the UTC start time to represent the time at the start of the data in the file.

  • t_max – the time offset, in seconds, from the UTC start time to represent the time at the end of data in the file.

  • 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.

  • npol (int) – number of polarisations.

  • ndim (int) – number of dimensions in the data (should be 2 for complex data).

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

  • nchan_ds (int) – the number of frequency bins in the spectrogram data.

  • ndat_ds (int) – the number of temporal bins in the spectrogram and timeseries data.

  • histogram_nbin (int) – the number of bins in the histogram data.

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

  • channel_freq_mhz (numpy.ndarray) – the centre frequencies of each channel (MHz).

  • timeseries_bins (numpy.ndarray) – the timestamp offsets for each temporal bin.

  • frequency_bins (numpy.ndarray) – the frequency bins used for the spectrogram attribute (MHz).

  • num_samples (int) – the total number of samples used to calculate the sample statistics.

  • num_samples_rfi_excised (int) – the total number of samples used to calculate the sample statistics, expect those flagged for RFI.

  • num_samples_spectrum (numpy.ndarray) – the number of samples, per channel, to calculate the sample statistics.

  • num_invalid_packets (int) – the number invalid packets received while calculating the statisitcs.

bandwidth_mhz: float
beam_id: str
channel_freq_mhz: nptyping.NDArray.(typing.Literal['NChan'], nptyping.Float64)
eb_id: str
property end_chan: int

Get the last channel that the header is for.

file_format_version: str = '1.0.0'
frequency_bins: nptyping.NDArray.(typing.Literal['NFreqBin'], nptyping.Float64)
frequency_mhz: float
histogram_nbin: int
nchan: int
nchan_ds: int
ndat_ds: int
ndim: int
npol: int
nrebin: int
num_invalid_packets: int
num_samples: int
num_samples_rfi_excised: int
num_samples_spectrum: nptyping.NDArray.(typing.Literal['NChan'], nptyping.UInt32)
scan_id: int
start_chan: int
t_max: float
t_min: float
telescope: str
timeseries_bins: nptyping.NDArray.(typing.Literal['NTimeBin'], nptyping.Float64)
utc_start: str
class ska_pst.stat.hdf5.TimeseriesDimension(value)[source]

An enum used to represent which index to use for max/min/mean in timeseries data.

MAX = 0
MEAN = 2
MIN = 1
ska_pst.stat.hdf5.map_hdf5_key(hdf5_key: str) str[source]

Map a key from a HDF5 attribute/dataset to a model dataclass property.