nidas  v1.2-1520
WindTilter.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  ** 2006, 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_DNYLD_ISFF_WINDTILTER_H
28 #define NIDAS_DNYLD_ISFF_WINDTILTER_H
29 
30 #include <math.h> // for M_PI
31 
32 namespace nidas { namespace dynld { namespace isff {
33 
119 class WindTilter {
120 public:
121 
122  WindTilter();
123 
124  double getLeanDegrees() const
125  {
126  return _lean * 180.0 / M_PI;
127  }
128 
129  void setLeanDegrees(double val)
130  {
131  _lean = val * M_PI / 180.0;
132  computeMatrix();
133  }
134 
135  double getLeanAzimuthDegrees() const
136  {
137  return _leanaz * 180.0 / M_PI;
138  }
139 
140  void setLeanAzimuthDegrees(double val)
141  {
142  _leanaz = val * M_PI / 180.;
143  if (!_identity) computeMatrix();
144  }
145 
146  bool isIdentity() const
147  {
148  return _identity;
149  }
150 
151  void rotate(float*u, float*v, float*w) const;
152 
153 private:
154 
155  void computeMatrix();
156 
157  double _lean;
158 
159  double _leanaz;
160 
161  bool _identity;
162 
163  double _mat[3][3];
164 
166 };
167 
168 
169 }}} // namespace nidas namespace dynld namespace isff
170 
171 #endif
double _leanaz
Definition: WindTilter.h:159
WindTilter()
Definition: WindTilter.cc:11
double _lean
Definition: WindTilter.h:157
void setLeanDegrees(double val)
Definition: WindTilter.h:129
double getLeanAzimuthDegrees() const
Definition: WindTilter.h:135
bool UP_IS_SONIC_W
Definition: WindTilter.h:165
WindTilter is used to apply a 3d rotation matrix to a wind vector.
Definition: WindTilter.h:119
bool isIdentity() const
Definition: WindTilter.h:146
bool _identity
Definition: WindTilter.h:161
double getLeanDegrees() const
Definition: WindTilter.h:124
void rotate(float *u, float *v, float *w) const
Definition: WindTilter.cc:19
void setLeanAzimuthDegrees(double val)
Definition: WindTilter.h:140
double _mat[3][3]
Definition: WindTilter.h:163
void computeMatrix()
Definition: WindTilter.cc:37