nidas v1.2.3
Public Member Functions | Protected Attributes | List of all members
nidas::dynld::isff::WindOrienter Class Reference

A class for rotating winds according to different orientations of the wind sensor. More...

#include <WindOrienter.h>

Public Member Functions

 WindOrienter ()
 
void applyOrientation (float *uvwt)
 Apply orientation changes to the wind components.
 
bool applyOrientation2D (float *u, float *v)
 Apply the current orientation to 2D components.
 
void setOrientation (const std::string &orientation, const std::string &name="")
 Parse the orientation parameter and set the vectors which translate the axes and signs of the wind sensor components.
 
bool handleParameter (const nidas::core::Parameter *parameter, const std::string &name)
 If the given parameter is "orientation", call setOrientation() with the value.
 

Protected Attributes

bool _unusualOrientation
 Is the sonic oriented in a unusual way, e.g.
 
int _tx [3]
 Index transform vector for wind components.
 
int _sx [3]
 Wind component sign conversion.
 

Detailed Description

A class for rotating winds according to different orientations of the wind sensor.

Constructor & Destructor Documentation

◆ WindOrienter()

WindOrienter::WindOrienter ( )

References _sx, _tx, and nidas::core::getSample().

Member Function Documentation

◆ applyOrientation()

void WindOrienter::applyOrientation ( float * uvwt)

Apply orientation changes to the wind components.

Parameters
uvwtis a float array of the three components, u, v, w. The components are transformed and then written back into uvwt.

References _sx, _tx, _unusualOrientation, and nidas::core::getSample().

Referenced by applyOrientation2D(), nidas::dynld::isff::ATIK_Sonic::process(), and setOrientation().

◆ applyOrientation2D()

bool WindOrienter::applyOrientation2D ( float * u,
float * v )

Apply the current orientation to 2D components.

This is like applyOrientation(), except only the u and v components are transformed. A 2D transformation is the same as 3D where w is zero, but this is more convenient to call for 2D instruments. Note this only works for orientations where the result is in the same plane, such as flipped. Use applyOrientation() with a zero w component to transform a 2D vector into 3D.

Returns
true if a transformation was applied, false otherwise.

References _unusualOrientation, and applyOrientation().

◆ handleParameter()

bool WindOrienter::handleParameter ( const nidas::core::Parameter * parameter,
const std::string & name )

If the given parameter is "orientation", call setOrientation() with the value.

Throws InvalidParameterException if the parameter is the wrong length or type or the value does not match one of the supported orientations. Return true if the parameter was handled, false otherwise. Pass name to include a sensor name in log and exception messages.

References nidas::core::Project::getInstance(), setOrientation(), and nidas::core::Parameter::STRING_PARAM.

Referenced by nidas::dynld::isff::Wind2D::fromDOMElement(), and nidas::dynld::isff::Wind3D::parseParameters().

◆ setOrientation()

void WindOrienter::setOrientation ( const std::string & orientation,
const std::string & name = "" )

Parse the orientation parameter and set the vectors which translate the axes and signs of the wind sensor components.

The parameter must be one string: 'normal' (default), 'down', 'lefthanded', 'flipped' or 'horizontal'. Throws InvalidParameterException if the string cannot be parsed. Pass name to include an identifying name in log messages about which sensor is being oriented.

References _sx, _tx, _unusualOrientation, applyOrientation(), and DLOG.

Referenced by handleParameter().

Member Data Documentation

◆ _sx

int nidas::dynld::isff::WindOrienter::_sx[3]
protected

Wind component sign conversion.

Also used for unusual sonic orientations, as when the sonic is hanging down, and the sign of v is flipped.

Referenced by applyOrientation(), setOrientation(), and WindOrienter().

◆ _tx

int nidas::dynld::isff::WindOrienter::_tx[3]
protected

Index transform vector for wind components.

Used for unusual sonic orientations, as when the sonic is hanging down, when the usual sonic w axis becomes the new u axis, u becomes w and v becomes -v.

Referenced by applyOrientation(), setOrientation(), and WindOrienter().

◆ _unusualOrientation

bool nidas::dynld::isff::WindOrienter::_unusualOrientation
protected

Is the sonic oriented in a unusual way, e.g.

upside-down, etc?

Referenced by applyOrientation(), applyOrientation2D(), and setOrientation().


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