Class FileProcessor

Class Documentation

class FileProcessor

Class used for processing input voltage data files to calculate the output statistics.

Public Functions

FileProcessor()

Create an instance of a File Processor object.

FileProcessor(const std::string &data_filename, const std::string &weights_filename)

Construct and build an instance of a File Processor object.

Parameters
  • data_filename – path to the data file to process.

  • weights_filename – the path to the weights file for the data file.

virtual ~FileProcessor()

Destroy the File Processor object.

void process()

Process the file based on the configuration passed in the constructor.

std::string get_output_filename(const std::string &data_filename) const

Returns the filename for the output statistics file.

  1. the output filename has the same stem as the data_filename with the extension replaced by ‘h5’; e.g. data_filename = something.data -> output_filename = something.h5

  2. if data_filename has a parent folder, then the output_filename has a parent folder with the stem replaced by ‘stat’ and the stat folder is created; e.g. a) data_filename = parent/something.dada -> output_filename = stat/something.h5 b) data_filename = /absolute/path/to/something.data -> output_stat_filename = /absolute/path/stat/something.h5

Parameters

data_filename – the name of the input data file

Returns

the output filename, created according to the following rules:

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

Throws an exception if the data and weights files do not start at the same heap offset.

This test should be migrated to ska::pst::common::HeapLayout (see https://jira.skatelescope.org/browse/AT3-534)

Parameters
  • data_config – the header from the data file

  • weights_config – the header from the weights file