nidas  v1.2-1520
ParoSci_202BG_Calibration.h
Go to the documentation of this file.
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
2 // vim: set shiftwidth=4 softtabstop=4 expandtab:
3 /*
4  ********************************************************************
5  ** NIDAS: NCAR In-situ Data Acquistion Software
6  **
7  ** 2008, 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 #ifndef NIDAS_DYNLD_PAROSCI_202BG_CALIBRATION_h
27 #define NIDAS_DYNLD_PAROSCI_202BG_CALIBRATION_h
28 
29 #include <nidas/core/Sample.h>
30 #include <nidas/core/CalFile.h>
31 #include <nidas/util/Exception.h>
32 
33 using namespace nidas::core;
34 
35 namespace nidas { namespace dynld {
36 
41 
42 public:
43 
45 
46  void readCalFile(nidas::core::CalFile* cf, dsm_time_t tt)
48 
49  void setU0(float val) { _U0 = val; }
50 
51  void setYs(float v0, float v1, float v2, float v3)
52  {
53  _Y[0] = v0; _Y[1] = v1; _Y[2] = v2; _Y[3] = v3;
54  }
55 
56  void setCs(float v0, float v1, float v2)
57  {
58  _C[0] = v0; _C[1] = v1; _C[2] = v2;
59  }
60 
61  void setDs(float v0, float v1)
62  {
63  _D[0] = v0; _D[1] = v1;
64  }
65 
66  void setTs(float v0, float v1, float v2, float v3, float v4)
67  {
68  _T[0] = v0; _T[1] = v1; _T[2] = v2; _T[3] = v3; _T[4] = v4;
69  }
70 
71  void setCommonModeCoefs(float v0, float v1, float v2, float v3)
72  {
73  _a[0] = v0; _a[1] = v1; _b = v2; _P0 = v3;
74  }
75 
76  float getU0() const { return _U0; }
77 
78  double computeTemperature(double usec);
79 
80  double computePressure(double tper, double pper);
81 
82  double correctPressure(double pgauge, double pstatic);
83 
84 private:
85 
86 
87  float _U0;
88 
89  float _Y[4];
90 
91  float _C[3];
92 
93  float _D[2];
94 
95  float _T[5];
96 
97  float _a[2];
98 
99  float _b;
100 
101  float _P0;
102 
103 };
104 
105 }} // namespace nidas namespace dynld
106 
107 #endif
A class for reading ASCII files containing a time series of calibration data.
Definition: CalFile.h:164
float _b
Definition: ParoSci_202BG_Calibration.h:99
float _P0
Definition: ParoSci_202BG_Calibration.h:101
void setU0(float val)
Definition: ParoSci_202BG_Calibration.h:49
void setTs(float v0, float v1, float v2, float v3, float v4)
Definition: ParoSci_202BG_Calibration.h:66
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:61
void setCs(float v0, float v1, float v2)
Definition: ParoSci_202BG_Calibration.h:56
void setYs(float v0, float v1, float v2, float v3)
Definition: ParoSci_202BG_Calibration.h:51
float getU0() const
Definition: ParoSci_202BG_Calibration.h:76
float _U0
Definition: ParoSci_202BG_Calibration.h:87
Definition: Exception.h:35
void setDs(float v0, float v1)
Definition: ParoSci_202BG_Calibration.h:61
Support for reading a calibration file for a ParoScientific 202BG sensor.
Definition: ParoSci_202BG_Calibration.h:40
void setCommonModeCoefs(float v0, float v1, float v2, float v3)
Definition: ParoSci_202BG_Calibration.h:71