Class Index Cross Index Namespace Index

Class FrameCPP::Version_3_4_5::AdcData

ADC Data
Contained in: FrameCPP::Version_3_4_5
Derived from: FrameCPP::Version_3_4_5::Base FrameCPP::FrAdcDataBase
Derived by: none

#include "../../../../../lib/framecpp/src/Version3_4_5/adcdata.hh"


public function member index:

AdcData(); Default Constructor.
AdcData(const AdcData& adcData); Copy Constructor.
AdcData(const std::string& name, INT_4U group, INT_4U channel, INT_4U nBits, const REAL_8& sampleRate, REAL_4 bias = 0.0, REAL_4 slope = 1.0, const std::string& units = "counts", const REAL_8& fShift = 0.0, const Time& timeOffset = Time( 0, 0 ), INT_2U dataValid = 0, const REAL_4& phase = 0.0); Constructor.
inline void appendComment(const std::string& comment); Appends a comment.
inline REAL_4 getBias() const; Bias
inline INT_4U getChannelGroup() const; Group number
inline INT_4U getChannelNumber() const; Channel number
virtual INT_2U getClassId() const;
inline const std::string& getComment() const; Comment
inline INT_2U getDataValid() const; Data valid flag
inline REAL_8 getFShift() const; Frequency shift
inline INT_2U getInstance() const; Instance number.
inline INT_4U getNBits() const; Number of bits
const std::string& getName() const;
inline INT_2U getOverRange() const; Get data valid flag (known as OverRange before)
inline REAL_4 getPhase() const; Phase of heterodyning signal at start of dataset
static SH getSH(); Structure Header
static SH getSH3(); Structure Header
static SH getSH4(); Structure Header
inline REAL_8 getSampleRate() const; Sample Rate
inline REAL_4 getSlope() const; Slope
inline const Time& getTimeOffset() const; Time Offset
inline const std::string& getUnits() const; Slope Units
inline bool operator !=(const AdcData& adcData) const; Not-equal comparison.
const AdcData& operator +=(const AdcData& adcData); += Assignment Operator.
const AdcData& operator =(const AdcData& adcData); Assignment Operator.
bool operator ==(const AdcData& adcData) const; Equal comparison.
inline AdcData::AuxContainer& refAux(); Auxiliary Info container
inline const AdcData::AuxContainer& refAux() const; Auxiliary Info container
inline FrameCPP::Version_3_4_5::AdcData::DataContainer& refData(); Data Container
inline const AdcData::DataContainer& refData() const; Data Container
inline void setBias(REAL_4 bias); Set the bias
inline void setDataValid(INT_2U flag); Set the data valid flag.
inline void setSlope(REAL_4 slope); Set the slope
inline void setTimeOffset(const Time& time); Set time offset
 

private function member index:

static AdcData* read(FrameReaderBase& in); Reads an AdcData object from an FrameReaderBase object.
static AdcData* read3(FrameReaderBase& in); Version 3 frame reading method.
static AdcData* read4(FrameReaderBase& in); Version 4 frame reading method.
virtual void write(Output& out) const; Write an AdcData object
 

Description:

This class represents ADC data. It is modeled after the FrAdcData structure in the Frame Specification, LIGO-T970130-B-E.

The AdcData class encapsulates the following attributes for an ADC channel: Phase of heterodyning signal at start of data set
AttributeDescription
name Channel name
comment Comment
channelGroup ADC group number
channelNumberChannel number
nBits Number of bits in A/D output
bias DC bias on channel (Volts @ ADC_counts = 0)
slope ADC calibration: input units/count
units Adc calibrartion: input units for slope
sampleRate Data acquisistion rate, samples / sec
timeOffset For triggered data lasting less than one frame, the integer seconds & nanoseconds start time relative to frame start.
fShift Frequency shift if signal has been heterodyned before ADC:

fShift = (f_heterodyne - fNyquist@sampleRate)

phase
dataValid Data valid flag: dataValid = 0 means data is valid, non-zero implies data is suspect/not valid.

This data is available through accessor methods. The data can't be modified, however. The only exceptions to this are the comment field (which can be appended to), and the dataValid flag.

The AdcData object is also a container for two types of data:
DataDescription
dataA container of Frame Vect objects which contain the sampled data.
aux A container of Vect objects holding user-provided information. Its use is generic.

The data is accessed through the container objects inside AdcData. These are accessed via the refData and refAux methods.


Function Member Descriptions:


FrameCPP::Version_3_4_5::AdcData::AdcData - Default Constructor.


AdcData();
This creates an AdcData object with the following properties:

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::AdcData - Copy Constructor.


AdcData(const AdcData& adcData);
A deep copy is performed for owned objects.

Parameters:
ParameterDescription
const AdcData& adcDataObject to be copied.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.



FrameCPP::Version_3_4_5::AdcData::AdcData - Constructor.


AdcData(const std::string& name, INT_4U group, INT_4U channel, INT_4U nBits, const REAL_8& sampleRate, REAL_4 bias = 0.0, REAL_4 slope = 1.0, const std::string& units = "counts", const REAL_8& fShift = 0.0, const Time& timeOffset = Time( 0, 0 ), INT_2U dataValid = 0, const REAL_4& phase = 0.0);
This creates an AdcData object with the specified properties. Additionally, the comment is set to "" (no comment).

Parameters:
ParameterDescription
const std::string& nameChanel name
INT_4U channelGroupChannel groups
INT_4U channelNumberChannel number
INT_4U nBitsNumber of bits in A/D output
const REAL_8& sampleRateData acquisition rate, samples/sec.
REAL_4 biasDC Bias on channel. Default: 0.0.
REAL_4 slopeInput units/count. Default: 1.0.
const std::string& unitsUnits for slope. Default: "counts".
const REAL_8& fShiftFrequency shift if signal has been heterodyned before ADC. Default: 0.0.
const REAL_4& phaseHeterodyning signal phase. Default: 0.0.
const Time& timeOffsetTime offset relative to frame start. Default: Time( 0, 0 ) (no offset).
bool dataValidData valid flag. Default: 0 (data is valid)

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::appendComment - Appends a comment.


inline void appendComment(const std::string& comment);
This method adds a comment followed by a newline to the end of the current list of comments.

Parameters:
ParameterDescription
const std::string& commentThe comment to append.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.



FrameCPP::Version_3_4_5::AdcData::getBias - Bias


inline REAL_4 getBias() const;
Gets the bias. This is the DC bias on channel (Volts @ ADC_counts = 0).

Return value:
REAL_4- Number of bits.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getChannelGroup - Group number


inline INT_4U getChannelGroup() const;
Gets channel group number.

Return value:
INT_4U- Group number.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getChannelNumber - Channel number


inline INT_4U getChannelNumber() const;
Gets the channel number.

Return value:
INT_4U- Channel number.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getClassId


virtual INT_2U getClassId() const;



FrameCPP::Version_3_4_5::AdcData::getComment - Comment


inline const std::string& getComment() const;
Gets the comment.

Return value:
const std::string&- Comment.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getDataValid - Data valid flag


inline INT_2U getDataValid() const;
Gets the data valid flag.

dataValid = 0 -> ADC data valid.
dataValid != 0 -> ADC data suspect/not valid.


Return value:
INT_2U- Data valid flag.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getFShift - Frequency shift


inline REAL_8 getFShift() const;
This is the frequency shift if the signal has been heterodyned before the ADC: fShift = (f_heterodyne - fNyquist@sampleRate).

Return value:
REAL_8- Frequency shift.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getInstance - Instance number.


inline INT_2U getInstance() const;
Gets ADC structure instance (valid only if frame read from disk)

Return value:
INT_2U- Instance number.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getNBits - Number of bits


inline INT_4U getNBits() const;
Gets the number of bits in A/D output.

Return value:
INT_4U- Number of bits.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getName


const std::string& getName() const;



FrameCPP::Version_3_4_5::AdcData::getOverRange - Get data valid flag (known as OverRange before)


inline INT_2U getOverRange() const;
Gets the data valid flag.

dataValid = 0 -> ADC data valid.
dataValid != 0 -> ADC data suspect/not valid.


Return value:
INT_2U- Data valid flag.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getPhase - Phase of heterodyning signal at start of dataset


inline REAL_4 getPhase() const;
In the heterodyning process the real time series is multiplied by cos[2*PI*fShift(t-t0)+phase] to get the real part and by -sin[2*PI*fShift(t-t0)+phase] (note the minus sign) to get the imaginary part of the resulting complex time series. The time origin t0 is the beginning of the frame.

Return value:
REAL_4- Phase.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getSH - Structure Header


static SH getSH();
Constructs the Structure Header for this class.

Return value:
SH- ADC data structure header.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.



FrameCPP::Version_3_4_5::AdcData::getSH3 - Structure Header


static SH getSH3();
Constructs the data format version 3 Structure Header for this class.

Return value:
SH- Structure header.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.



FrameCPP::Version_3_4_5::AdcData::getSH4 - Structure Header


static SH getSH4();
Constructs the data format version 4 Structure Header for this class.

Return value:
SH- Structure header.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.



FrameCPP::Version_3_4_5::AdcData::getSampleRate - Sample Rate


inline REAL_8 getSampleRate() const;
Returns the data aquisition rate, samples/sec.

Return value:
REAL_8- Sampling rate.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getSlope - Slope


inline REAL_4 getSlope() const;
Gets the slope. ADC calibration: input units/count.

Return value:
REAL_4- Slope.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getTimeOffset - Time Offset


inline const Time& getTimeOffset() const;
Returns the time offset. For triggered data lasting less than one frame, this is the integer seconds and nanoseconds start time relative to the frame start.

Return value:
const Time&- Time offset.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::getUnits - Slope Units


inline const std::string& getUnits() const;
Gets the units for the slope.

Return value:
const std::string&- Slope units.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::operator != - Not-equal comparison.


inline bool operator !=(const AdcData& adcData) const;
Determines whether two adc objects are not equal. All contained data is compared.

Parameters:
ParameterDescription
const AdcData& adcDataThe object to compare with.

Return value:
bool- True if the objects are not equal.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::operator += - += Assignment Operator.


const AdcData& operator +=(const AdcData& adcData);

Parameters:
ParameterDescription
const AdcData& adcData

Return value:
const AdcData&

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.
frame_mismatchADC mismatch



FrameCPP::Version_3_4_5::AdcData::operator = - Assignment Operator.


const AdcData& operator =(const AdcData& adcData);
A deep copy is performed for owned objects.

Parameters:
ParameterDescription
const AdcData& adcDataObejct to be assigned.

Return value:
const AdcData&- This object.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.



FrameCPP::Version_3_4_5::AdcData::operator == - Equal comparison.


bool operator ==(const AdcData& adcData) const;
Determines whether two AdcData objects are equal. For this comparison, all of the data is compared.

Parameters:
ParameterDescription
const AdcData& adcDataThe object to compare with.

Return value:
bool- true if the objects are equal.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::read - Reads an AdcData object from an FrameReaderBase object.


static AdcData* read(FrameReaderBase& in);
This method creates a dynamically allocated object. This method is called indirectly by the FrameReader class. This is a private method, access is granted through the ObjectProxy< AdcData > class which is a friend.

*NOTE* This method allocates memory and returns a pointer to it. The user is responsible for freeing this memory.


Parameters:
ParameterDescription
FrameReaderBase& inInput data stream object.

Return value:
AdcData*- Newly allocated.

Exceptions:
ExceptionDescription
std::bad_allocMemory allocation failed.
read_failureRead failed.



FrameCPP::Version_3_4_5::AdcData::read3 - Version 3 frame reading method.


static AdcData* read3(FrameReaderBase& in);



FrameCPP::Version_3_4_5::AdcData::read4 - Version 4 frame reading method.


static AdcData* read4(FrameReaderBase& in);



FrameCPP::Version_3_4_5::AdcData::refAux - Auxiliary Info container


inline AdcData::AuxContainer& refAux();
Get the container which contains user-provided information.

Return value:
SearchContainer< Vect, &Vect::getName >&- Aux data.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::refAux - Auxiliary Info container


inline const AdcData::AuxContainer& refAux() const;
Get the container which contains user-provided information.

Return value:
const SearchContainer< Vect, &Vect::getName >&- Aux data.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::refData - Data Container


inline FrameCPP::Version_3_4_5::AdcData::DataContainer& refData();
Get the container which contains the sampled data.

Return value:
SearchContainer< Vect, &Vect::getName >&- Adc data.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::refData - Data Container


inline const AdcData::DataContainer& refData() const;
Get the container which contains the sampled data.

Return value:
const SearchContainer< Vect, &Vect::getName >&- Adc data.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::setBias - Set the bias


inline void setBias(REAL_4 bias);

Parameters:
ParameterDescription
biasSignal conversion offset.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::setDataValid - Set the data valid flag.


inline void setDataValid(INT_2U flag);

Parameters:
ParameterDescription
INT_2U flagSet if data is suspect.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::setSlope - Set the slope


inline void setSlope(REAL_4 slope);

Parameters:
ParameterDescription
slopeSignal conversion linear coefficient.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::setTimeOffset - Set time offset


inline void setTimeOffset(const Time& time);

Parameters:
ParameterDescription
timeTime offset.

Exceptions:
ExceptionDescription
None.



FrameCPP::Version_3_4_5::AdcData::write - Write an AdcData object


virtual void write(Output& out) const;
Writes an AdcData object to an Output object.

Parameters:
ParameterDescription
Output& out outOutput data stream object.

Exceptions:
ExceptionDescription
write_failureWrite failure occured.



Variable Member Descriptions:


FrameCPP::Version_3_4_5::AdcData::mAux - User-provided data

Container< Vect > mAux;

FrameCPP::Version_3_4_5::AdcData::mBias - DC Bias on channel

REAL_4 mBias;

FrameCPP::Version_3_4_5::AdcData::mChannelGroup - Channel group

INT_4U mChannelGroup;

FrameCPP::Version_3_4_5::AdcData::mChannelNumber - Channel number

INT_4U mChannelNumber;

FrameCPP::Version_3_4_5::AdcData::mComment - Comment

std::string mComment;

FrameCPP::Version_3_4_5::AdcData::mData - Adc data.

Container< Vect > mData;

FrameCPP::Version_3_4_5::AdcData::mDataValid - Data valid flag.

INT_2U mDataValid;

FrameCPP::Version_3_4_5::AdcData::mFShift - Frequency shift (if heterodyned before ADC)

REAL_8 mFShift;

FrameCPP::Version_3_4_5::AdcData::mInstance - This object's instance number (when read from file)

INT_2U mInstance;

FrameCPP::Version_3_4_5::AdcData::mNBits - Number of bits in A/D output

INT_4U mNBits;

FrameCPP::Version_3_4_5::AdcData::mName - Channel name.

std::string mName;

FrameCPP::Version_3_4_5::AdcData::mPhase - Phase of heterodyning signal at start of dataset

REAL_4 mPhase;

FrameCPP::Version_3_4_5::AdcData::mSampleRate - Acquisition rate, samples/sec

REAL_8 mSampleRate;

FrameCPP::Version_3_4_5::AdcData::mSlope - Slope: Input units/count

REAL_4 mSlope;

FrameCPP::Version_3_4_5::AdcData::mTimeOffset - Time offset from frame start

Time mTimeOffset;

FrameCPP::Version_3_4_5::AdcData::mUnits - Units for slope

std::string mUnits;