Commit 2953dc58 authored by Purves, Murray's avatar Purves, Murray
Browse files

Adding documentation comments to Spectrum stream classes

parent 7a137fc5
......@@ -149,8 +149,99 @@ class RADIX_PUBLIC SpectrumPCFStream
public:
SpectrumPCFStream(data_type container);
/**
* @brief read_from Read a PCF-formatted spectrum file
* @param file Path to the PCF formatted spectrum file
* @return Success (true)/failure (false) flag
*
* Requires data_type to have the following methods:
* (to support both PCF and SPE formats)
*
* setDhsVersion(bool dhsVersion);
* setEnergyCalibrationLabel(const std::string &energyCalibrationLabel);
* setEnergyCalibrationOffset(float energyCalibrationOffset);
* setEnergyCalibrationGain(float energyCalibrationGain);
* setEnergyCalibrationQuadraticTerm(float energyCalibrationQuadraticTerm);
* setEnergyCalibrationCubicTerm(float energyCalibrationCubicTerm);
* setEnergyCalibrationLowEnergy(float energyCalibrationLowEnergy);
* setLastModifiedHash(const std::string &lastModifiedHash);
* setUuid(const std::string &uuid);
* setInspection(const std::string &inspection);
* setLaneNumber(short laneNumber);
* setMeasurementRemark(const std::string &measurementRemark);
* setInstrumentType(const std::string &instrumentType);
* setManufacturer(const std::string &manufacturer);
* setInstrumentModel(const std::string &instrumentModel);
* setInstrumentID(const std::string &instrumentID);
* setItemDescription(const std::string &itemDescription);
* setMeasurementLocationName(const std::string &measurementLocationName);
* setMeasurementLocationCoords(const std::string &measurementLocationCoords);
* setItemDetectorDistance(short itemDetectorDistance);
* setOccupancyNumber(short occupancyNumber);
* setCargoType(const std::string &cargoType);
* setDeviationPairPresence(const std::string &deviationPairPresence);
* setDeviationPairEnergies(const
* std::array<std::array<std::array<std::array<float, 4>, 8>, 8>, 20>
* &deviationPairEnergies);
* setDeviationPairOffsets(const
* std::array<std::array<std::array<std::array<float, 4>, 8>, 8>, 20>
* &deviationPairOffsets);
* addSpectrumData(std::string title, std::string source,
* std::string description, std::string dateTime,
* std::string tag, float liveTime, float totalTime,
* float energyCalOffset, float energyCalGain,
* float energyCalQuadraticTerm, float energyCalCubicTerm,
* float energyCalLowEnergyTerm, float occupancyFlag,
* float totalNeutronCount, int numberOfChannels,
* std::vector<float> countsByChannel);
*/
bool read_from(const std::string &file);
/**
* @brief write_to Write a PCF-formatted spectrum file
* @param file Path to the PCF formatted spectrum file
*
* Requires data_type to have the following methods:
* (to support both PCF and SPE formats)
*
* short nrps() const;
* bool dhsVersion() const;
* std::string energyCalibrationLabel() const;
* float energyCalibrationOffset() const;
* float energyCalibrationGain() const;
* float energyCalibrationQuadraticTerm() const;
* float energyCalibrationCubicTerm() const;
* float energyCalibrationLowEnergy() const;
* std::string lastModifiedHash() const;
* std::string uuid() const;
* std::string inspection() const;
* short laneNumber() const;
* std::string measurementRemark() const;
* std::string instrumentType() const;
* std::string manufacturer() const;
* std::string instrumentModel() const;
* std::string instrumentID() const;
* std::string itemDescription() const;
* std::string measurementLocationName() const;
* std::string measurementLocationCoords() const;
* short itemDetectorDistance() const;
* short occupancyNumber() const;
* std::string cargoType() const;
* std::string deviationPairPresence() const;
* std::array<std::array<std::array<std::array<float, 4>, 8>, 8>, 20>
* deviationPairEnergies() const;
* std::array<std::array<std::array<std::array<float, 4>, 8>, 8>, 20>
* deviationPairOffsets() const;
* int spectrumDataCount();
* void spectrumData(int i, std::string &title, std::string &source,
* std::string &description, std::string &dateTime,
* std::string &tag, float &liveTime, float &totalTime,
* float &energyCalOffset, float &energyCalGain,
* float &energyCalQuadraticTerm, float &energyCalCubicTerm,
* float &energyCalLowEnergyTerm, float &occupancyFlag,
* float &totalNeutronCount, int &numberOfChannels,
* std::vector<float> &countsByChannel);
*/
bool write_to(const std::string &file) const;
private:
......@@ -164,22 +255,120 @@ class RADIX_PUBLIC SpectrumSPEStream
public:
SpectrumSPEStream(data_type container);
/**
* @brief read_from Read an SPE-formatted spectrum file
* @param file Path to the SPE formatted spectrum file
* @return Success (true)/failure (false) flag
*
* Requires data_type to have the following methods:
* (to support both PCF and SPE formats)
*
* setDhsVersion(bool dhsVersion);
* setEnergyCalibrationLabel(const std::string &energyCalibrationLabel);
* setEnergyCalibrationOffset(float energyCalibrationOffset);
* setEnergyCalibrationGain(float energyCalibrationGain);
* setEnergyCalibrationQuadraticTerm(float energyCalibrationQuadraticTerm);
* setEnergyCalibrationCubicTerm(float energyCalibrationCubicTerm);
* setEnergyCalibrationLowEnergy(float energyCalibrationLowEnergy);
* setLastModifiedHash(const std::string &lastModifiedHash);
* setUuid(const std::string &uuid);
* setInspection(const std::string &inspection);
* setLaneNumber(short laneNumber);
* setMeasurementRemark(const std::string &measurementRemark);
* setInstrumentType(const std::string &instrumentType);
* setManufacturer(const std::string &manufacturer);
* setInstrumentModel(const std::string &instrumentModel);
* setInstrumentID(const std::string &instrumentID);
* setItemDescription(const std::string &itemDescription);
* setMeasurementLocationName(const std::string &measurementLocationName);
* setMeasurementLocationCoords(const std::string &measurementLocationCoords);
* setItemDetectorDistance(short itemDetectorDistance);
* setOccupancyNumber(short occupancyNumber);
* setCargoType(const std::string &cargoType);
* setDeviationPairPresence(const std::string &deviationPairPresence);
* setDeviationPairEnergies(const
* std::array<std::array<std::array<std::array<float, 4>, 8>, 8>, 20>
* &deviationPairEnergies);
* setDeviationPairOffsets(const
* std::array<std::array<std::array<std::array<float, 4>, 8>, 8>, 20>
* &deviationPairOffsets);
* addSpectrumData(std::string title, std::string source,
* std::string description, std::string dateTime,
* std::string tag, float liveTime, float totalTime,
* float energyCalOffset, float energyCalGain,
* float energyCalQuadraticTerm, float energyCalCubicTerm,
* float energyCalLowEnergyTerm, float occupancyFlag,
* float totalNeutronCount, int numberOfChannels,
* std::vector<float> countsByChannel);
*/
bool read_from(const std::string &file);
/**
* @brief write_to Write an SPE-formatted spectrum file
* @param file Path to the SPE formatted spectrum file
*
* Requires data_type to have the following methods:
* (to support both PCF and SPE formats)
*
* short nrps() const;
* bool dhsVersion() const;
* std::string energyCalibrationLabel() const;
* float energyCalibrationOffset() const;
* float energyCalibrationGain() const;
* float energyCalibrationQuadraticTerm() const;
* float energyCalibrationCubicTerm() const;
* float energyCalibrationLowEnergy() const;
* std::string lastModifiedHash() const;
* std::string uuid() const;
* std::string inspection() const;
* short laneNumber() const;
* std::string measurementRemark() const;
* std::string instrumentType() const;
* std::string manufacturer() const;
* std::string instrumentModel() const;
* std::string instrumentID() const;
* std::string itemDescription() const;
* std::string measurementLocationName() const;
* std::string measurementLocationCoords() const;
* short itemDetectorDistance() const;
* short occupancyNumber() const;
* std::string cargoType() const;
* std::string deviationPairPresence() const;
* std::array<std::array<std::array<std::array<float, 4>, 8>, 8>, 20>
* deviationPairEnergies() const;
* std::array<std::array<std::array<std::array<float, 4>, 8>, 8>, 20>
* deviationPairOffsets() const;
* int spectrumDataCount();
* void spectrumData(int i, std::string &title, std::string &source,
* std::string &description, std::string &dateTime,
* std::string &tag, float &liveTime, float &totalTime,
* float &energyCalOffset, float &energyCalGain,
* float &energyCalQuadraticTerm, float &energyCalCubicTerm,
* float &energyCalLowEnergyTerm, float &occupancyFlag,
* float &totalNeutronCount, int &numberOfChannels,
* std::vector<float> &countsByChannel);
*/
bool write_to(const std::string &file) const;
private:
data_type mData;
// Read the measurement time part of the SPE file
void readMeasTim(std::ifstream &stream, float &liveTime, float &totalTime);
// Read the date measured part of the SPE file
void readDateMea(std::ifstream &stream, std::string &dateTime);
// Read the data part of the SPE file
void readData(std::ifstream &stream, int &firstChannel, int &totalEntries,
std::vector<float> &countsByChannel);
// Read the region of interest part of the SPE file
void readRoi(std::ifstream &stream, std::string &roi);
// Read the presets part of the SPE file
void readPresets(std::ifstream &stream,
std::vector<std::string> &presetLines);
// Read the energy fit part of the SPE file
void readEnerFit(std::ifstream &stream, const int totalEntries,
float &energyCalGain, float &energyCalOffset);
// Read the MCA calibration part of the SPE file
void readMcaCal(std::ifstream &stream, int &calInt,
std::vector<float> mcaCal);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment