Struct StatStorage

Nested Relationships

Nested Types

Struct Documentation

struct StatStorage

StatStorage provides an abstract management of the storage of the statistical vectors that are computed by StatComputer and published by StatPublishers. The management of StatStorage is performed by the StatProcessor.

Upon instansiation, no storage is allocated until the resize method is called. As the StatComputer integrates values into the statistical vectors, the StatProcessor must also use the reset method to initialise all of the vectors with value of 0.

Public Functions

StatStorage(const ska::pst::common::AsciiHeader &config)

Create instance of a Stat Storage object.

Parameters

config – the configuration current voltage data stream.

virtual ~StatStorage()

Destroy the Stat Storage object.

void resize(uint32_t ntime_bins, uint32_t nfreq_bins)

resize the storage vectors, based on the config and binning parameters

Parameters
  • ntime_bins – number of temporal bins in the timeseries and spectrogram

  • nfreq_bins – number of spectral bins in the spectrofram

void reset()

reset the the storage back to zeros.

inline uint32_t get_npol() const

Get the number of polarisations used in the storage.

Returns

uint32_t number of polarisations

inline uint32_t get_ndim() const

Get the number of dimensions used in the storage.

Returns

uint32_t number of dimensions

inline uint32_t get_nchan() const

Get the number of channels used in the storage.

Returns

uint32_t number of channels

inline uint32_t get_nbin() const

Get the number of input state bins used in the storage.

Returns

uint32_t number of input state bins

inline uint32_t get_nrebin() const

Get the number of rebinned input states used in the storage.

Returns

uint32_t number of rebinned input states

inline uint32_t get_ntime_bins() const

Get the number of temporal bins used in the spectrogram and timeseries storage.

Returns

uint32_t number of temporal bins

inline uint32_t get_nfreq_bins() const

Get the number of spectral bins used in the spectrogram storage.

Returns

uint32_t number of spectral bins

inline uint32_t get_ntime_vals() const

Get the number of temporal bin dimenions in the timeseries storage [3].

Returns

uint32_t number of temporal bins dimensions

inline double get_total_sample_time() const

Get the length, in seconds, of the total time used to calculate statistics.

inline void set_total_sample_time(double _total_sample_time)

Set the length, in seconds, of the total time used to calculate statistics.

inline double get_utc_start_offset_seconds() const

Get the utc start offset in seconds of the first sample that was integrated into the statistics.

Returns

double utc start offset in seconds

inline void set_utc_start_offset_seconds(double _utc_start_offset_seconds)

Set the utc start offset in seconds of the first sample that was integrated into the statistics.

Parameters

_utc_start_offset_seconds – utc start offset in seconds

inline size_t get_utc_start_offset_bytes() const

Get the utc start offset in bytes of the first sample that was integrated into the statistics.

Returns

size_t utc start offset in bytes

inline void set_utc_start_offset_bytes(size_t _utc_start_offset_bytes)

Set the utc start offset in bytes of the first sample that was integrated into the statistics.

Parameters

_utc_start_offset_bytes – utc start offset in bytess

inline bool is_storage_resized() const

Get flag for whether the storage has been resized.

Returns

true storage has been resized

Returns

false storage has not been resized

inline bool is_storage_reset() const

Get flag for whether the storage has been reset.

Returns

true storage has been reset

Returns

false storage has not been reset

Public Members

std::vector<double> channel_centre_frequencies

the centre frequencies of each channel.

std::vector<std::vector<float>> mean_frequency_avg

the mean of the data for each polarisation and dimension, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<float>> mean_frequency_avg_rfi_excised

the mean of the data for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<float>> variance_frequency_avg

the variance of the data for each polarisation and dimension, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<float>> variance_frequency_avg_rfi_excised

the variance of the data for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<std::vector<float>>> mean_spectrum

the mean of the data for each polarisation, dimension and channel.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q). Third dimension is the value for each channel.

std::vector<std::vector<std::vector<float>>> variance_spectrum

the variance of the data for each polarisation, dimension and channel.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q). Third dimension is the value for each channel.

std::vector<std::vector<float>> mean_spectral_power

mean power spectra of the data for each polarisation and channel.

This is real valued and computed as I^2 + Q^2.

First dimension is polarisation (2 dimensions) Second dimension is the value for the channel.

std::vector<std::vector<float>> max_spectral_power

maximum power spectra of the data for each polarisation and channel.

First dimension is polarisation (2 dimensions) Second dimension is the value for the channel.

std::vector<std::vector<std::vector<uint32_t>>> histogram_1d_freq_avg

histogram of the input data integer states for each polarisation and dimension, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q). Third dimension is the binning data (i.e. the number in the bin)

std::vector<std::vector<std::vector<uint32_t>>> histogram_1d_freq_avg_rfi_excised

histogram of the input data integer states for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q). Third dimension is the binning data (i.e. the number in the bin)

std::vector<std::vector<std::vector<uint32_t>>> rebinned_histogram_2d_freq_avg

Rebinned 2D histogram of the input data integer states for each polarisation, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the bining of the real component (I) Third dimension is the bining of the imaginary component (Q)

std::vector<std::vector<std::vector<uint32_t>>> rebinned_histogram_2d_freq_avg_rfi_excised

Rebinned 2D histogram of the input data integer states for each polarisation, averaged over all channels, expect those flagged for RFI.

First dimension is polarisation (2 dimensions) Second dimension is the bining of the real component (I) Third dimension is the bining of the imaginary component (Q)

std::vector<std::vector<std::vector<uint32_t>>> rebinned_histogram_1d_freq_avg

rebinned histogram of the input data integer states for each polarisation and dimension, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q). Third dimension is the binning data (i.e. the number in the bin)

std::vector<std::vector<std::vector<uint32_t>>> rebinned_histogram_1d_freq_avg_rfi_excised

rebinned histogram of the input data integer states for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q). Third dimension is the binning data (i.e. the number in the bin)

std::vector<std::vector<std::vector<uint32_t>>> num_clipped_samples_spectrum

number of clipped input samples (maximum level) for each polarisation, dimension and channel.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q). Third dimension is the channel number.

std::vector<std::vector<uint32_t>> num_clipped_samples

number of clipped input samples (maximum level) for each polarisation, dimension, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<uint32_t>> num_clipped_samples_rfi_excised

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

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<double> timeseries_bins

the timestamp offsets for each temporal bin.

Each temporal bin used in timeseries, timeseries_rfi_excised and spectrogram reuse this vector. In MJD

std::vector<double> frequency_bins

the frequency bins used for the spectrogram attribute (MHz).

std::vector<std::vector<std::vector<float>>> spectrogram

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

First dimension is polarisation (2 dimensions) Second dimension is the frequency bins, this is expected to be ~1000. Third dimension is the time dimension binned.

std::vector<std::vector<std::vector<float>>> timeseries

time series of the data for each polarisation, rebinned in time to ntime_bins, averaged over all frequency channels.

First dimension is polarisation (2 dimensions). Second dimension is the time dimension binned. Third dimension has 3 values: the max, min and mean.

std::vector<std::vector<std::vector<float>>> timeseries_rfi_excised

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.

First dimension is polarisation (2 dimensions). Second dimension is the time dimension binned. Third dimension has 3 values: the max, min and mean.

std::vector<bool> rfi_mask_lut

Lookup table of RFI masks for each channel, true value indicates channel has RFI to be excised.

First dimension is channel

uint32_t num_samples = {0}

the total number of samples used to calculate the sample statistics.

If there are no dropped/invalid packets, this value should be the total number of samples within the time sample: NHEAP * NCHAN * UDP_NSAMP. If a packet was marked as dropped/ invalid then no statistics are updated.

This is not split by polarisation and dimension due to the fact that within a UDP packet it includes all polarisations and dimensions.

uint32_t num_samples_rfi_excised = {0}

the total number of samples used to calculate the sample statistics, expect those flagged for RFI.

If a channel is marked as having RFI then this value is not updated.

If there are no dropped/invalid packets, this value should be the total number of samples within the time sample: NHEAP * (non-RFI NCHAN) * UDP_NSAMP. If a packet was marked as dropped/ invalid then no statistics are updated.

This is not split by polarisation and dimension due to the fact that within a UDP packet it includes all polarisations and dimensions.

std::vector<uint32_t> num_samples_spectrum

the number of samples, per channel, to calculate the sample statistics.

If there are no dropped/invalid packets, this value should be the total number of samples for the channel within the time sample: NHEAP * UDP_NSAMP. If a packet was marked as dropped/invalid then no statistics are updated.

This is not split by polarisation and dimension due to the fact that within a UDP packet it includes all polarisations and dimensions.

First dimension the number of samples for the channel.

uint32_t num_invalid_packets = {0}

the number invalid packets received while calculating the statisitcs.

Any packet that has a NaN for the scale is marked as being an invalid packet. This comes from the RECV.CORE that marks ignored, malformed, misdirected, misordered packets as invalid.

struct scalar_stats_t

Public Members

std::vector<std::vector<float>> mean_frequency_avg

the mean of the data for each polarisation and dimension, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<float>> mean_frequency_avg_rfi_excised

the mean of the data for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<float>> variance_frequency_avg

the variance of the data for each polarisation and dimension, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<float>> variance_frequency_avg_rfi_excised

the variance of the data for each polarisation and dimension, averaged over all channels, expect those flagged for RFI.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<uint32_t>> num_clipped_samples

number of clipped input samples (maximum level) for each polarisation, dimension, averaged over all channels.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).

std::vector<std::vector<uint32_t>> num_clipped_samples_rfi_excised

number of clipped input samples (maximum level) for each polarisation, dimension and channel, averaged over all channels, expect those flagged for RFI.

First dimension is polarisation (2 dimensions) Second dimension is the real and imaginary components (I and Q).