26#ifndef NIDAS_CORE_A2DCONVERTER_H
27#define NIDAS_CORE_A2DCONVERTER_H
31namespace nidas {
namespace core {
87 void setGain(
int ichan,
int val);
96 virtual float convert(
int ichan,
float counts)
const = 0;
101 virtual void set(
int ichan,
const float* d,
int nd) = 0;
103 virtual void get(
int ichan,
float* d,
int nd)
const = 0;
182 float convert(
int ichan,
float counts)
const;
187 void set(
int ichan,
const float* d,
int nd);
189 void get(
int ichan,
float* d,
int nd)
const;
226 float convert(
int ichan,
float counts)
const;
231 void set(
int ichan,
const float* d,
int nd);
233 void get(
int ichan,
float* d,
int nd)
const;
Virtual class with methods for performing conversions from integer A2D counts to floating point volta...
Definition A2DConverter.h:61
int _ncoefs
Number of coefficients in the conversion.
Definition A2DConverter.h:149
void readCalFile(CalFile *cf, dsm_time_t tt)
Read records from a CalFile for calibration coefficients with time tags less than or equal to tt,...
Definition A2DConverter.cc:285
int * _bipolar
Polarity setting, 1=bi-polar.
Definition A2DConverter.h:160
void setGain(int ichan, int val)
Definition A2DConverter.cc:90
A2DConverter(const A2DConverter &x)
No copy.
int getBipolar(int ichan) const
Definition A2DConverter.cc:97
virtual float convert(int ichan, float counts) const =0
Convert a count to a floating point value.
int _maxNumChannels
How many channels on the A2D.
Definition A2DConverter.h:137
void setBipolar(int ichan, int val)
Definition A2DConverter.cc:103
A2DConverter & operator=(const A2DConverter &x)
No assign.
virtual void get(int ichan, float *d, int nd) const =0
virtual void setNAN(int ichan)=0
int getGain(int ichan) const
Gain of each channel.
Definition A2DConverter.cc:84
virtual ~A2DConverter()
Definition A2DConverter.cc:51
virtual void set(int ichan, const float *d, int nd)=0
Set the initial conversion for a channel.
int * _gain
Gain setting of each channel.
Definition A2DConverter.h:154
int getMaxNumChannels() const
Maximum possible number of channels.
Definition A2DConverter.h:72
A2DConverter(int nchan, int ncoefs)
Definition A2DConverter.cc:39
int getNumConfigChannels() const
One plus the index of the last active channel.
Definition A2DConverter.h:78
int _numConfigChannels
A configured channel has a gain > 0.
Definition A2DConverter.h:144
A class for reading ASCII files containing a time series of calibration data.
Definition CalFile.h:166
A2DConverter for applying a linear conversion to A2D counts values.
Definition A2DConverter.h:175
void setNAN()
Definition A2DConverter.cc:183
float convert(int ichan, float counts) const
Convert a count to a floating point value.
Definition A2DConverter.cc:154
float * _mx
Conversion slopes for each channel.
Definition A2DConverter.h:205
~LinearA2DConverter()
Definition A2DConverter.cc:119
LinearA2DConverter & operator=(const LinearA2DConverter &x)
No assign.
LinearA2DConverter(int nchan)
Definition A2DConverter.cc:108
LinearA2DConverter(const LinearA2DConverter &x)
No copy.
float * _b
Conversion intercepts for each channel.
Definition A2DConverter.h:200
void get(int ichan, float *d, int nd) const
Definition A2DConverter.cc:168
void set(int ichan, const float *d, int nd)
Set the initial linear conversion for a channel.
Definition A2DConverter.cc:160
A2DConverter for applying a polynomial conversion to A2D counts values.
Definition A2DConverter.h:219
void get(int ichan, float *d, int nd) const
Definition A2DConverter.cc:250
PolyA2DConverter(const PolyA2DConverter &x)
No copy.
PolyA2DConverter(int nchan, int ncoefs)
Definition A2DConverter.cc:190
void set(int ichan, const float *d, int nd)
Set the initial polynomial conversion for a channel.
Definition A2DConverter.cc:239
~PolyA2DConverter()
Definition A2DConverter.cc:201
void setNAN()
Definition A2DConverter.cc:265
PolyA2DConverter & operator=(const PolyA2DConverter &x)
No assign.
float ** _d
Definition A2DConverter.h:240
float convert(int ichan, float counts) const
Convert a count to a floating point value.
Definition A2DConverter.cc:271
long long dsm_time_t
Posix time in microseconds, the number of non-leap microseconds since 1970 Jan 1 00:00 UTC.
Definition Sample.h:62
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31