nidas  v1.2-1520
NCAR_TRH.h
Go to the documentation of this file.
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*-
2 // vim: set shiftwidth=4 softtabstop=4 expandtab:
3 /*
4  ********************************************************************
5  ** NIDAS: NCAR In-situ Data Acquistion Software
6  **
7  ** 2014, Copyright University Corporation for Atmospheric Research
8  **
9  ** This program is free software; you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation; either version 2 of the License, or
12  ** (at your option) any later version.
13  **
14  ** This program is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** The LICENSE.txt file accompanying this software contains
20  ** a copy of the GNU General Public License. If it is not found,
21  ** write to the Free Software Foundation, Inc.,
22  ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  **
24  ********************************************************************
25 */
26 
27 #ifndef NIDAS_DYNLD_ISFF_NCAR_TRH_H
28 #define NIDAS_DYNLD_ISFF_NCAR_TRH_H
29 
30 #include <vector>
31 
34 
35 namespace nidas { namespace dynld { namespace isff {
36 
37 class HandleRawT;
38 class HandleRawRH;
39 
51 {
52 public:
53 
54  NCAR_TRH();
55 
56  ~NCAR_TRH();
57 
59 
60  bool process(const nidas::core::Sample* samp,
61  std::list<const nidas::core::Sample*>& results) throw();
62 
63  void
64  ifanFilter(std::list<const nidas::core::Sample*>& results);
65 
66  double
67  tempFromRaw(double traw);
68 
69  double
70  rhFromRaw(double rhraw, double temp_cal);
71 
81  void
82  setRawTempCoefficients(float* begin = 0, float* end = 0);
83 
93  void
94  setRawRHCoefficients(float* begin = 0, float* end = 0);
95 
96  std::vector<float>
98 
99  std::vector<float>
101 
102 private:
103 
104  void
106  nidas::core::Variable* var, float* fp);
107 
110 
113 
124 
125  float _minIfan;
126  float _maxIfan;
127 
135 
142 
146  std::vector<float> _Ta;
147  std::vector<float> _Ha;
148 
151 
152  std::vector<VariableIndex> _compute_order;
153 
154  void convertNext(const VariableIndex& vi);
155 
156  // no copying
157  NCAR_TRH(const NCAR_TRH& x);
158 
159  // no assignment
160  NCAR_TRH& operator=(const NCAR_TRH& x);
161 
162 };
163 
164 }}} // namespace nidas namespace dynld namespace isff
165 
166 #endif
nidas::core::CalFileHandler CalFileHandler
Definition: NCAR_TRH.h:112
A class for reading ASCII files containing a time series of calibration data.
Definition: CalFile.h:164
Support for a sensor that is sending packets on a TCP socket, a UDP socket, a Bluetooth RF Comm socke...
Definition: SerialSensor.h:64
double tempFromRaw(double traw)
Here are the lines from the SHT PIC code.
Definition: NCAR_TRH.cc:295
Sensor class for the NCAR hygrothermometer, built at EOL.
Definition: NCAR_TRH.h:50
float _maxIfan
Definition: NCAR_TRH.h:126
std::vector< float > getRawRHCoefficients()
Definition: NCAR_TRH.cc:209
VariableIndex _rhraw
Definition: NCAR_TRH.h:134
Class describing a sampled variable.
Definition: Variable.h:46
bool handleRawRH(nidas::core::CalFile *cf)
Definition: NCAR_TRH.cc:254
std::vector< VariableIndex > _compute_order
Definition: NCAR_TRH.h:152
VariableIndex _t
Indices of the processed T and RH variables, in case they need to be replaced with a direct conversio...
Definition: NCAR_TRH.h:140
nidas::core::VariableIndex VariableIndex
Definition: NCAR_TRH.h:111
CalFileHandler * _raw_rh_handler
Definition: NCAR_TRH.h:150
~NCAR_TRH()
Definition: NCAR_TRH.cc:65
std::vector< float > _Ha
Definition: NCAR_TRH.h:147
void setRawTempCoefficients(float *begin=0, float *end=0)
Set the three polynomial coefficients which enable converting the raw temperature counts variable Tra...
Definition: NCAR_TRH.cc:186
void convertNext(const VariableIndex &vi)
Definition: NCAR_TRH.cc:72
VariableIndex _ifan
In the validate() method the variables generated by this sensor class are scanned, and if one matches &quot;Ifan&quot; then its index, min and max values are copied to these class members.
Definition: NCAR_TRH.h:123
bool process(const nidas::core::Sample *samp, std::list< const nidas::core::Sample * > &results)
Definition: NCAR_TRH.cc:345
This is the interface for handling CalFile records as they are read by a VariableConverter.
Definition: VariableConverter.h:57
std::vector< float > _Ta
Coefficients for calculating T and RH from the raw counts.
Definition: NCAR_TRH.h:146
Interface to a data sample.
Definition: Sample.h:189
float _minIfan
Definition: NCAR_TRH.h:125
bool handleRawT(nidas::core::CalFile *cf)
Definition: NCAR_TRH.cc:217
std::vector< float > getRawTempCoefficients()
Definition: NCAR_TRH.cc:201
A VariableIndex associates a Variable pointer with it&#39;s index into it&#39;s SampleTag.
Definition: VariableIndex.h:51
void validate()
Implementation of DSMSensor::validate for a Character Sensor.
Definition: NCAR_TRH.cc:86
CalFileHandler * _raw_t_handler
Definition: NCAR_TRH.h:149
void convertVariable(nidas::core::SampleT< float > *outs, nidas::core::Variable *var, float *fp)
Definition: NCAR_TRH.cc:315
static int char **FILE * fp
Definition: sing.cc:928
VariableIndex _traw
The indices of the raw T and RH variables are saved in case a calibration record specifies raw conver...
Definition: NCAR_TRH.h:133
void setRawRHCoefficients(float *begin=0, float *end=0)
Set the five polynomial coefficients which enable converting the raw temperature RH variable RHraw in...
Definition: NCAR_TRH.cc:193
NCAR_TRH & operator=(const NCAR_TRH &x)
void ifanFilter(std::list< const nidas::core::Sample * > &results)
Definition: NCAR_TRH.cc:378
NCAR_TRH()
Definition: NCAR_TRH.cc:45
Definition: InvalidParameterException.h:35
VariableIndex _rh
Definition: NCAR_TRH.h:141
double rhFromRaw(double rhraw, double temp_cal)
Definition: NCAR_TRH.cc:304