nidas  v1.2-1520
Public Member Functions | Private Member Functions | Private Attributes | List of all members
nidas::dynld::isff::WindTilter Class Reference

WindTilter is used to apply a 3d rotation matrix to a wind vector. More...

#include <WindTilter.h>

Public Member Functions

 WindTilter ()
 
double getLeanDegrees () const
 
void setLeanDegrees (double val)
 
double getLeanAzimuthDegrees () const
 
void setLeanAzimuthDegrees (double val)
 
bool isIdentity () const
 
void rotate (float *u, float *v, float *w) const
 

Private Member Functions

void computeMatrix ()
 

Private Attributes

double _lean
 
double _leanaz
 
bool _identity
 
double _mat [3][3]
 
bool UP_IS_SONIC_W
 

Detailed Description

WindTilter is used to apply a 3d rotation matrix to a wind vector.

WindTilter generates a matrix for rotating 3d wind vectors from an orthogonal sonic coordinate system to a new coordinate system whose w axis is defined by two angles, lean and leanaz. It is commonly used to rotate sonic wind data to mean flow coordinates, whose w axis is normal to the plane of the observed flow.

lean is the angle in radians between the flow normal and the sonic w axis (0 <= lean <= 180)

leanaz is the clock angle in radians from the sonic u axis to the projection of the flow normal in the sonic uv plane, positive toward the sonic v axis. (0 <= leanaz < 360)

The unit axes of sonic coordinates: Us, Vs, Ws The unix axes of the flow coordiate system: Uf, Vf, Wf

This is primarily a rotation of the W axis. The Uf axis remains in the plane of Us and an "up" direction.

In sonic (aka instrument coordinates) the Wf axis is sin(lean) * cos(leanaz) sin(lean) * sin(leanaz) cos(lean)

Once you have the Wf axis defining the Uf,Vf plane, there is some uncertainty about where to put the Uf axis on that plane.

If Uf is the intersection of the normal plane with the old Us,Ws plane, then Uf = Vs X Wf cross product of Vs and Wf = (0 1 0) X Wf In sonic coords Vs is just (0 1 0) Then normalize Uf. The above method is used when UP_IS_SONIC_W == true

If Uf is the intersection of the flow normal plane with the Wf,Us plane, then

Uf = (Wf X Us) X Wf (normalized)

The above method is used when UP_IS_SONIC_W == false

Right now the default value of UP_IS_SONIC_W is false.

I suppose if you had your sonic on the side of a steep hill you may want "up" to be the sonic W axis.


How to determine the flow normal from sonic wind data.

The value of W in flow coordinates (Wf) is the dot product of the corrected sonic wind vector (us-uoff,vs-voff,ws-woff) with the Wf unit vector, in sonic coordinates. uoff, voff and woff are the sonic biases.

Wf = (us-uoff) * sin(lean)cos(leanaz) + (vs-voff)*sin(lean)sin(leanaz)

An averaged Wf is by definition zero, which gives an equation for wsbar in terms of usbar and vsbar.

wsbar = woff - (usbar-uoff)*tan(lean)cos(leanaz)

Therefore wsbar should look like a linear function of the corrected and averaged U and V components from the sonic, (uscor=usbar-uoff):

wsbar = b1 + b2 * uscor + b3 * vscor

One can determine these b coefficients with a minimum variance fit, and

b1 = woff b2 = -tan(lean)cos(leanaz) b3 = -tan(lean)sin(leanaz)

lean and leanaz are therefore: lean = atan(sqrt(b2*b2 + b3*b3)) leanaz = atan2(-b3,-b2)

Version
$Revision$
Author
$Author$

Constructor & Destructor Documentation

WindTilter::WindTilter ( )

References _mat.

Member Function Documentation

void WindTilter::computeMatrix ( )
private
double nidas::dynld::isff::WindTilter::getLeanAzimuthDegrees ( ) const
inline
double nidas::dynld::isff::WindTilter::getLeanDegrees ( ) const
inline
bool nidas::dynld::isff::WindTilter::isIdentity ( ) const
inline

References _identity.

void WindTilter::rotate ( float *  u,
float *  v,
float *  w 
) const

References _identity, and _mat.

void nidas::dynld::isff::WindTilter::setLeanAzimuthDegrees ( double  val)
inline
void nidas::dynld::isff::WindTilter::setLeanDegrees ( double  val)
inline

Member Data Documentation

bool nidas::dynld::isff::WindTilter::_identity
private
double nidas::dynld::isff::WindTilter::_lean
private
double nidas::dynld::isff::WindTilter::_leanaz
private
double nidas::dynld::isff::WindTilter::_mat[3][3]
private

Referenced by computeMatrix(), rotate(), and WindTilter().

bool nidas::dynld::isff::WindTilter::UP_IS_SONIC_W
private

Referenced by computeMatrix().


The documentation for this class was generated from the following files: