Class StatProcessor

Class Documentation

class StatProcessor

A class that does the core computation of statistics per block of data.

Public Functions

StatProcessor(const ska::pst::common::AsciiHeader &data_config, const ska::pst::common::AsciiHeader &weights_config)

Create instance of a Stat Processor object.

Parameters
  • data_config – the configuration current data stream involving the data block.

  • weights_config – the configuration current data stream involving the weights block.

virtual ~StatProcessor()

Destroy the Stat Processor object.

void add_publisher(std::shared_ptr<StatPublisher> publisher)
Parameters

publisher

bool validate_segment(const ska::pst::common::SegmentProducer::Segment &segment)

check the segement properties to determine if it can be successfully proessed.

Parameters

segment – the data segment to be inspected

Returns

true the data segement can be processed

Returns

false the data segement cannot be processed

bool process(const ska::pst::common::SegmentProducer::Segment &segment)

process the current block of data and weights.

This method will ensure that the statistics are computed and then published.

Parameters

segment – the segment of data and weights for which statistics are computed and published.

Returns

true the segment was fully processed, statistics computed and published.

Returns

false the segement was interrupted before the statistics could be computed and published.

void interrupt()

Interrupt the processing of the segment, specifically the statistics computation.

Protected Attributes

std::shared_ptr<StatStorage> storage

shared pointer a statistics storage, shared also with the computer and publisher

std::unique_ptr<StatComputer> computer

unique pointer for the stat computer.

std::vector<std::shared_ptr<StatPublisher>> publishers

unique pointer to each of the statistics publishers.

ska::pst::common::AsciiHeader data_config

the configuration for the current stream of voltage data.

ska::pst::common::AsciiHeader weights_config

the configuration for the current stream of voltage weights.

uint32_t data_resolution

minimum resolution of the input data stream involving the data block

uint32_t weights_resolution

minimum resolution of the input data stream involving the weights block

uint32_t nchan = {0}

total number of channels

uint32_t req_time_bins = {0}

the requested number of time bins in the spectrogram

uint32_t req_freq_bins = {0}

the requested number of frequency bins in the the spectrogram

Protected Static Attributes

static constexpr uint32_t default_ntime_bins = 1024

default number of time bins in spectrogram

static constexpr uint32_t default_nfreq_bins = 1024

default number of frequency bins in spectrogram

static constexpr uint32_t max_freq_bins = 2048

maximum allowed number of frequency bins in spectrogram

static constexpr uint32_t max_time_bins = 32768

maximum allowed number of time bins in spectrogram