Class Index | Cross Index | Namespace Index |
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 |
The AdcData class encapsulates the following attributes for an ADC channel:
Attribute | Description |
name | Channel name |
comment | Comment |
channelGroup | ADC group number |
channelNumber | Channel 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 | Phase of heterodyning signal at start of data set|
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:
Data | Description |
data | A 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.
This creates an AdcData object with the following properties:
- name = "none"
- comment = ""
- groupNumber = 0
- channelNumber = 0
- nBits = 8
- bias = 0
- slope = 1.0
- units = "" (dimensionless)
- sampleRate = 0.0
- timeOffset = 0 seconds, 0 nanoseconds
- fShift = 0.0
- Phase = 0.0
- dataValid = 0
- No other data.
Exceptions:
Exception | Description |
None. |
A deep copy is performed for owned objects.
Parameters:
Parameter | Description |
const AdcData& adcData | Object to be copied. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
This creates an AdcData object with the specified properties. Additionally, the comment is set to "" (no comment).
Parameters:
Parameter | Description |
const std::string& name | Chanel name |
INT_4U channelGroup | Channel groups |
INT_4U channelNumber | Channel number |
INT_4U nBits | Number of bits in A/D output |
const REAL_8& sampleRate | Data acquisition rate, samples/sec. |
REAL_4 bias | DC Bias on channel. Default: 0.0. |
REAL_4 slope | Input units/count. Default: 1.0. |
const std::string& units | Units for slope. Default: "counts". |
const REAL_8& fShift | Frequency shift if signal has been heterodyned before ADC. Default: 0.0. |
const REAL_4& phase | Heterodyning signal phase. Default: 0.0. |
const Time& timeOffset | Time offset relative to frame start. Default: Time( 0, 0 ) (no offset). |
bool dataValid | Data valid flag. Default: 0 (data is valid) |
Exceptions:
Exception | Description |
None. |
This method adds a comment followed by a newline to the end of the current list of comments.
Parameters:
Parameter | Description |
const std::string& comment | The comment to append. |
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Gets the bias. This is the DC bias on channel (Volts @ ADC_counts = 0).
Return value:
REAL_4- Number of bits.
Exceptions:
Exception | Description |
None. |
Gets channel group number.
Return value:
INT_4U- Group number.
Exceptions:
Exception | Description |
None. |
Gets the channel number.
Return value:
INT_4U- Channel number.
Exceptions:
Exception | Description |
None. |
Gets the comment.
Return value:
const std::string&- Comment.
Exceptions:
Exception | Description |
None. |
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:
Exception | Description |
None. |
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:
Exception | Description |
None. |
Gets ADC structure instance (valid only if frame read from disk)
Return value:
INT_2U- Instance number.
Exceptions:
Exception | Description |
None. |
Gets the number of bits in A/D output.
Return value:
INT_4U- Number of bits.
Exceptions:
Exception | Description |
None. |
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:
Exception | Description |
None. |
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:
Exception | Description |
None. |
Constructs the Structure Header for this class.
Return value:
SH- ADC data structure header.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Constructs the data format version 3 Structure Header for this class.
Return value:
SH- Structure header.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Constructs the data format version 4 Structure Header for this class.
Return value:
SH- Structure header.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Returns the data aquisition rate, samples/sec.
Return value:
REAL_8- Sampling rate.
Exceptions:
Exception | Description |
None. |
Gets the slope. ADC calibration: input units/count.
Return value:
REAL_4- Slope.
Exceptions:
Exception | Description |
None. |
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:
Exception | Description |
None. |
Gets the units for the slope.
Return value:
const std::string&- Slope units.
Exceptions:
Exception | Description |
None. |
Determines whether two adc objects are not equal. All contained data is compared.
Parameters:
Parameter | Description |
const AdcData& adcData | The object to compare with. |
Return value:
bool- True if the objects are not equal.
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
const AdcData& adcData |
Return value:
const AdcData&
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
frame_mismatch | ADC mismatch |
A deep copy is performed for owned objects.
Parameters:
Parameter | Description |
const AdcData& adcData | Obejct to be assigned. |
Return value:
const AdcData&- This object.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
Determines whether two AdcData objects are equal. For this comparison, all of the data is compared.
Parameters:
Parameter | Description |
const AdcData& adcData | The object to compare with. |
Return value:
bool- true if the objects are equal.
Exceptions:
Exception | Description |
None. |
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:
Parameter | Description |
FrameReaderBase& in | Input data stream object. |
Return value:
AdcData*- Newly allocated.
Exceptions:
Exception | Description |
std::bad_alloc | Memory allocation failed. |
read_failure | Read failed. |
Get the container which contains user-provided information.
Return value:
SearchContainer< Vect, &Vect::getName >&- Aux data.
Exceptions:
Exception | Description |
None. |
Get the container which contains user-provided information.
Return value:
const SearchContainer< Vect, &Vect::getName >&- Aux data.
Exceptions:
Exception | Description |
None. |
Get the container which contains the sampled data.
Return value:
SearchContainer< Vect, &Vect::getName >&- Adc data.
Exceptions:
Exception | Description |
None. |
Get the container which contains the sampled data.
Return value:
const SearchContainer< Vect, &Vect::getName >&- Adc data.
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
bias | Signal conversion offset. |
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
INT_2U flag | Set if data is suspect. |
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
slope | Signal conversion linear coefficient. |
Exceptions:
Exception | Description |
None. |
Parameters:
Parameter | Description |
time | Time offset. |
Exceptions:
Exception | Description |
None. |
Writes an AdcData object to an Output object.
Parameters:
Parameter | Description |
Output& out out | Output data stream object. |
Exceptions:
Exception | Description |
write_failure | Write failure occured. |