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

A class for making sense of data from a Campbell Scientific Inc CSAT3 3D sonic anemometer. More...

#include <CSAT3_Sonic.h>

Inheritance diagram for nidas::dynld::isff::CSAT3_Sonic:
Inheritance graph
[legend]

Public Member Functions

 CSAT3_Sonic ()
 
 ~CSAT3_Sonic ()
 
void open (int flags) throw (nidas::util::IOException, nidas::util::InvalidParameterException)
 Open the serial port connected to this sonic. More...
 
float correctTcForPathCurvature (float tc, float u, float v, float w)
 No correction for path curvature is needed on the CSAT, so this method just returns an unchanged tc. More...
 
bool process (const Sample *samp, std::list< const Sample * > &results) throw ()
 Process a raw sample, which in this case means do a sscanf on the character string contents, creating a processed sample of binary floating point data. More...
 
void parseParameters () throw (nidas::util::InvalidParameterException)
 Parse the list of nidas::core::Parameter that are associated with this sensor. More...
 
std::string getSerialNumber (const std::string &str, std::string::size_type &index)
 Get serial number field and its index in "??" query output. More...
 
bool process (const nidas::core::Sample *samp, std::list< const nidas::core::Sample * > &results) throw ()
 Basic process method for sonic anemometer wind plus temperature: u,v,w,tc parsed from an ASCII sample. More...
 
void setBias (int i, double val)
 
double getBias (int i) const
 
double getVazimuth () const
 
void setVazimuth (double val)
 Wind vectors in geographic coordinates are expressed by U, the component of the wind blowing toward the east, and V, the component of the wind blowing toward the north. More...
 
double getLeanDegrees () const
 
void setLeanDegrees (double val)
 
double getLeanAzimuthDegrees () const
 
void setLeanAzimuthDegrees (double val)
 
void setDespike (bool val)
 
bool getDespike () const
 
void setMetek (int ismetek)
 
void setOutlierProbability (double val)
 
double getOutlierProbability () const
 
void setDiscLevelMultiplier (double val)
 
double getDiscLevelMultiplier () const
 
double getDiscLevel () const
 
void setTcOffset (double val)
 
double getTcOffset () const
 
void setTcSlope (double val)
 
double getTcSlope () const
 
void setDoHorizontalRotation (bool val)
 Should 2D horizontal rotations of U,V be applied? More...
 
void setDoTiltCorrection (bool val)
 Should 3D tilt corrections be applied? More...
 
void despike (nidas::core::dsm_time_t tt, float *uvwt, int n, bool *spikeOrMissing) throw ()
 
void offsetsTiltAndRotate (nidas::core::dsm_time_t tt, float *uvwt) throw ()
 Do standard bias removal, tilt correction and horizontal rotation of 3d sonic anemometer data. More...
 
void applyOrientation (nidas::core::dsm_time_t tt, float *uvwt) throw ()
 Apply orientation changes to the wind components. More...
 
void readOffsetsAnglesCalFile (nidas::core::dsm_time_t tt) throw ()
 Update the settings from the offsets and angles calibration file, if any. More...
 
void validate () throw (nidas::util::InvalidParameterException)
 Validate the configuration of this sensor. More...
 
void validateSscanfs () throw (nidas::util::InvalidParameterException)
 Warn user if number of scanf fields does not match number expected from variables in sample. More...
 
nidas::util::Termiostermios ()
 Expose the Termios. More...
 
const nidas::util::TermiosgetTermios () const
 Get a read-only copy of the Termios. More...
 
SampleScannerbuildSampleScanner () throw (nidas::util::InvalidParameterException)
 Calls CharacterSensor::buildSampleScanner(), and then sets the per-byte transmission delay for that scanner: SampleScanner::setUsecsPerByte(). More...
 
IODevicebuildIODevice () throw (nidas::util::IOException)
 Creates an IODevice depending on the device name prefix: name prefix type of IODevice inet: TCPSocketIODevice sock: TCPSocketIODevice usock: UDPSocketIODevice btspp: BluetoothRFCommSocketIODevice all others SerialPortIODevice. More...
 
void close () throw (nidas::util::IOException)
 close my associated device. More...
 
void applyTermios () throw (nidas::util::IOException)
 If the underlying IODevice is a SerialPortIODevice, update the current Termios to the device. More...
 
void setMessageParameters (unsigned int len, const std::string &sep, bool eom) throw (nidas::util::InvalidParameterException,nidas::util::IOException)
 Set message separator and message length parameters, which are used to parse and time-tag samples from the IODevice. More...
 
void printStatus (std::ostream &ostr) throw ()
 
bool isPrompting () const
 Is prompting active, i.e. More...
 
void startPrompting () throw (nidas::util::IOException)
 Start the prompters. More...
 
void stopPrompting () throw (nidas::util::IOException)
 
void fromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 Initialize myself from a xercesc::DOMElement. More...
 
int getUsecsPerByte () const
 If the underlying IODevice is a SerialPortIODevice, return the value of SerialPortIODevice::getUsecsPerByte(), otherwise return 0, which means no timetag correction for transmission delay will be applied. More...
 
void init () throw (nidas::util::InvalidParameterException)
 Initialize the CharacterSensor instance for post-processing. More...
 
const std::string & getMessageSeparator () const
 Get message separator with backslash sequences replaced by their intended character. More...
 
const std::string getBackslashedMessageSeparator () const
 Get message separator with backslash sequences added back. More...
 
bool getMessageSeparatorAtEOM () const
 
int getMessageLength () const
 
virtual void addPrompt (const std::string &promptString, double promptRate, double promptOffset)
 Prompting Sensors can have multiple prompts and rates. More...
 
const std::list< Prompt > & getPrompts () const
 
virtual bool isPrompted () const
 Is this a prompted sensor. More...
 
virtual void togglePrompting () throw (nidas::util::IOException)
 
void setInitString (const std::string &val)
 Set the initialization string(s) for this sensor. More...
 
const std::string & getInitString () const
 
virtual void sendInitString () throw (nidas::util::IOException)
 
bool getNullTerminated () const
 
int getNumScanfFailures () const
 How many samples have resulted in complete scanf failures - nothing parsed, because the sensor messages do not correspond to the sscanf format. More...
 
int getNumScanfPartials () const
 How many samples have been partially scanned, because a character in the middle of a message conflicts with the sscanf format. More...
 
const std::list< AsciiSscanf * > & getScanfers () const
 Return the list of AsciiSscanfs requested for this CharacterSensor. More...
 
int getMaxScanfFields () const
 The maximum number of fields in any of the AsciiSscanfs for this CharacterSensor. More...
 
bool doesAsciiSscanfs ()
 
void setDSMConfig (const DSMConfig *val)
 Set the DSMConfig for this sensor. More...
 
const DSMConfiggetDSMConfig () const
 What DSMConfig am I associated with? More...
 
const SitegetSite () const
 What Site am I associated with? More...
 
virtual void setDeviceName (const std::string &val)
 Set the name of the system device that the sensor is connected to. More...
 
virtual const std::string & getDeviceName () const
 Fetch the name of the system device that the sensor is connected to. More...
 
virtual void setClassName (const std::string &val)
 Set the class name. More...
 
virtual const std::string & getClassName () const
 Fetch the class name. More...
 
virtual void setCatalogName (const std::string &val)
 Set the name of the catalog entry for this sensor. More...
 
virtual const std::string & getCatalogName () const
 Fetch the name of the catalog entry for this sensor. More...
 
const std::string & getDSMName () const
 Fetch the DSM name. More...
 
virtual std::string getName () const
 Return a name that should fully identify this sensor. More...
 
const std::string & getLocation () const
 Location string. More...
 
void setLocation (const std::string &val)
 
const std::string & getSuffix () const
 Sensor suffix, which is added to variable names. More...
 
void setSuffix (const std::string &val)
 
int getStation () const
 
void setStation (int val)
 
void setHeight (const std::string &val)
 Set sensor height above ground via a string which is added to variable names. More...
 
void setHeight (float val)
 Set sensor height above ground. More...
 
const std::string & getHeightString () const
 Get sensor height above ground in a string. More...
 
float getHeight () const
 Get sensor height above ground. More...
 
void setDepth (const std::string &val)
 Set sensor depth below ground via a string which is added to variable names. More...
 
void setDepth (float val)
 Set sensor depth below ground. More...
 
const std::string & getDepthString () const
 Get sensor depth below ground in a string. More...
 
float getDepth () const
 Get sensor depth below ground. More...
 
const std::string & getFullSuffix () const
 Full sensor suffix, the concatenation of the sensor suffix, if any, and the height or depth string, if any. More...
 
std::string expandString (const std::string &input) const
 Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue(). More...
 
bool getTokenValue (const std::string &token, std::string &value) const
 Implement a lookup for tokens that I know about, like $HEIGHT. More...
 
const DictionarygetDictionary () const
 
SampleSourcegetRawSampleSource ()
 Implementation of SampleSource::getRawSampleSource(). More...
 
SampleSourcegetProcessedSampleSource ()
 Implementation of SampleSource::getProcessedSampleSource(). More...
 
const SampleTaggetRawSampleTag () const
 Convenience function to get my one-and-only raw SampleTag(). More...
 
virtual void addSampleTag (SampleTag *val) throw (nidas::util::InvalidParameterException)
 Add a SampleTag to this sensor. More...
 
virtual void removeSampleTag (SampleTag *val) throw ()
 Remove val from the list of SampleTags, and delete it. More...
 
std::list< const SampleTag * > getSampleTags () const
 Implementation of SampleSource::getSampleTags(). More...
 
std::list< SampleTag * > & getSampleTags ()
 Non-const method to get a list of non-const pointers to SampleTags. More...
 
SampleTagIterator getSampleTagIterator () const
 
void addSampleClient (SampleClient *c) throw ()
 Add a SampleClient to this SampleSource. More...
 
void removeSampleClient (SampleClient *c) throw ()
 Remove a SampleClient from this SampleSource This will also remove a SampleClient if it has been added with addSampleClientForTag(). More...
 
void addSampleClientForTag (SampleClient *client, const SampleTag *tag) throw ()
 Add a SampleClient to this SampleSource. More...
 
void removeSampleClientForTag (SampleClient *client, const SampleTag *tag) throw ()
 Remove a SampleClient for a given SampleTag from this SampleSource. More...
 
int getClientCount () const throw ()
 How many SampleClients are currently in my list. More...
 
void flush () throw ()
 Implementation of SampleClient::flush(). More...
 
void distributeRaw (const Sample *s) throw ()
 Distribute a raw sample which has been read from my file descriptor in real time. More...
 
const SampleStatsgetSampleStats () const
 
virtual int getReadFd () const
 
virtual int getWriteFd () const
 
virtual bool reopenOnIOException () const
 Whether to reopen this sensor on an IOException. More...
 
void setId (dsm_sample_id_t val)
 Set the various levels of the sensor identification. More...
 
void setSensorId (unsigned int val)
 
void setDSMId (unsigned int val)
 
dsm_sample_id_t getId () const
 Get the various levels of the samples identification. More...
 
unsigned int getDSMId () const
 
unsigned int getSensorId () const
 
virtual void setLatency (float val) throw (nidas::util::InvalidParameterException)
 Set desired latency, providing some control over the response time vs buffer efficiency tradeoff. More...
 
virtual float getLatency () const
 
virtual void setTimeoutMsecs (int val)
 Set the sensor timeout value in milliseconds. More...
 
virtual int getTimeoutMsecs () const
 
int getTimeoutCount () const
 
void incrementTimeoutCount ()
 
void addParameter (Parameter *val)
 Add a parameter to this DSMSensor. More...
 
const std::list< const
Parameter * > & 
getParameters () const
 Get list of parameters. More...
 
const ParametergetParameter (const std::string &name) const
 Fetch a parameter by name. More...
 
void setIODevice (IODevice *val)
 Set the IODevice for this sensor. More...
 
void setSampleScanner (SampleScanner *val)
 Set the SampleScanner for this sensor. More...
 
virtual int getDefaultMode () const
 How do I want to be opened. More...
 
virtual void setDefaultMode (int val)
 
virtual size_t getBytesAvailable () const throw (nidas::util::IOException)
 How many bytes are available to read on this sensor. More...
 
virtual size_t read (void *buf, size_t len) throw (nidas::util::IOException)
 Read from the device (duh). More...
 
virtual size_t read (void *buf, size_t len, int msecTimeout) throw (nidas::util::IOException)
 Read from the device with a timeout. More...
 
virtual size_t write (const void *buf, size_t len) throw (nidas::util::IOException)
 Write to the device (duh). More...
 
virtual void ioctl (int request, void *buf, size_t len) throw (nidas::util::IOException)
 Perform an ioctl on the device. More...
 
virtual bool readSamples () throw (nidas::util::IOException)
 Read samples from my associated file descriptor, and distribute() them to my RawSampleClient's. More...
 
virtual SamplenextSample ()
 Extract the next sample from the buffer. More...
 
virtual SamplereadSample () throw (nidas::util::IOException)
 Return the next sample. More...
 
bool receive (const Sample *s) throw ()
 A DSMSensor can be used as a SampleClient, meaning it receives its own raw samples. More...
 
void printStatusHeader (std::ostream &ostr) throw ()
 
void printStatusTrailer (std::ostream &ostr) throw ()
 
void calcStatistics (unsigned int periodUsec)
 Update the sensor sampling statistics. More...
 
unsigned int getMaxSampleLength () const
 
unsigned int getMinSampleLength () const
 
float getObservedSamplingRate () const
 
float getObservedDataRate () const
 
size_t getBadTimeTagCount () const
 
VariableIterator getVariableIterator () const
 
xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException)
 Create a DOMElement and append it to the parent. More...
 
xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException)
 Add my content into a DOMElement. More...
 
virtual void setTypeName (const std::string &val)
 Set the type name of this sensor, e.g. More...
 
virtual const std::string & getTypeName (void) const
 Get the type name of this sensor. More...
 
bool getDuplicateIdOK () const
 getDuplicateIdOK will be true if it is OK for samples from this sensor to have identical IDs to samples from another sensor. More...
 
void setDuplicateIdOK (bool val)
 Set the duplicate ID attribute of this DSMSensor. More...
 
virtual bool getApplyVariableConversions () const
 
virtual void setApplyVariableConversions (bool val)
 
virtual int getDriverTimeTagUsecs () const
 
virtual void setDriverTimeTagUsecs (int val)
 
void addCalFile (CalFile *val)
 Add a calibration file for this DSMSensor. More...
 
const std::map< std::string,
CalFile * > & 
getCalFiles ()
 Return the collection of CalFiles, mapped by name. More...
 
CalFilegetCalFile (const std::string &name)
 Return a CalFile by its getName(). More...
 
void removeCalFiles ()
 Remove all CalFiles. More...
 
virtual void executeXmlRpc (XmlRpc::XmlRpcValue &, XmlRpc::XmlRpcValue &) throw ()
 Method invoked when the DSMEngineIntf XmlRpcServer receives a "SensorAction" request, with a "device" string matching the string that this DSMSensor registers via DSMEngine::registerSensorWithXmlRpc(string,DSMServer*). More...
 
virtual const std::list
< SampleTag * > & 
getNonConstSampleTags ()
 We'll allow derived classes and calibration applications to change the SampleTags, so this method returns a list of non-constant SampleTags. More...
 
bool allowOpen ()
 
bool readBuffer () throw (nidas::util::IOException)
 Read into my SampleScanner's buffer. More...
 
bool readBuffer (int msecTimeout) throw (nidas::util::IOException)
 Read into my SampleScanner's buffer. More...
 

Static Public Member Functions

static const std::string getClassName (const xercesc::DOMElement *node, const Project *project) throw (nidas::util::InvalidParameterException)
 Crawl through the DOM tree for a DSMSensor to find the class name - scanning the catalog entry if necessary. More...
 
static void deleteLooper ()
 
static const XMLCh * getNamespaceURI ()
 

Static Public Attributes

static const float GAMMA_R = 402.684
 Conversion factor from speed of sound squared to Kelvin. More...
 

Protected Types

typedef
nidas::dynld::isff::WindOrienter 
WindOrienter
 
typedef
nidas::dynld::isff::WindRotator 
WindRotator
 
typedef
nidas::dynld::isff::WindTilter 
WindTilter
 

Protected Member Functions

void checkSampleTags () throw (nidas::util::InvalidParameterException)
 Check the SampleTags that are defined for this sensor. More...
 
void initPrompting () throw (nidas::util::IOException)
 Perform whatever is necessary to initialize prompting right after the device is opened. More...
 
void shutdownPrompting () throw (nidas::util::IOException)
 Shutdown prompting, typically done when a device is closed. More...
 
void unixDevInit (int flags) throw (nidas::util::IOException)
 
void setPromptRate (const double val)
 Set the rate at which <sensor> prompts are sent to this sensor. More...
 
double getPromptRate () const
 
void setPromptOffset (const double val)
 
double getPromptOffset () const
 
void setPromptString (const std::string &val)
 Set the <sensor> prompt string for this sensor. More...
 
const std::string & getPromptString () const
 
virtual int scanSample (AsciiSscanf *sscanf, const char *inputstr, float *data_ptr)
 
SampleT< float > * searchSampleScanners (const Sample *samp, SampleTag **stag_out=0) throw ()
 Search through the AsciiSscanf instances attached to this sensor, looking for the next scanner which parses at least one variable from the given raw sample. More...
 
void adjustTimeTag (SampleTag *stag, SampleT< float > *outs)
 Apply TimetagAdjuster and lag adjustments to the timetag of the given sample. More...
 
void clearBuffer ()
 Clear the internal buffer. More...
 
IODevicegetIODevice () const
 
SampleScannergetSampleScanner () const
 
void setFullSuffix (const std::string &val)
 
virtual int getLagUsecs () const
 Return the sampling lag for this sensor in microseconds. More...
 
virtual double getLagSecs () const
 Return the sampling lag for this sensor in seconds. More...
 
virtual void setLagSecs (double val)
 Set the sampling lag for this sensor in seconds. More...
 
void applyConversions (SampleTag *stag, SampleT< float > *outs, float *results=0)
 Perform variable conversions for the variables in stag whose values and sample time have been set in outs. More...
 
void trimUnparsed (SampleTag *stag, SampleT< float > *outs, int nparsed)
 Fill with floatNAN all the values past nparsed values in output sample outs, and trim the length of the sample to match the length of the variables in SampleTag stag. More...
 
VariableIndex findVariableIndex (const std::string &vprefix)
 Search all the sample tags for a variable whose name starts with the given prefix, and return it's index in the list of variables in the sample tag. More...
 

Static Protected Member Functions

static LoopergetLooper ()
 Fetch a pointer to a static instance of a Looper thread. More...
 

Protected Attributes

double _bias [3]
 
bool _allBiasesNaN
 
bool _despike
 
bool _metek
 
nidas::core::AdaptiveDespiker _despiker [4]
 
WindRotator _rotator
 
WindTilter _tilter
 
WindOrienter _orienter
 
double _tcOffset
 
double _tcSlope
 
bool _horizontalRotation
 Should horizontal rotation of U,V be performed? More...
 
bool _tiltCorrection
 Should 3D tilt correction be applied? More...
 
nidas::core::dsm_sample_id_t _sampleId
 Id of output sample. More...
 
int _diagIndex
 If user requests "diag" or "status", its index in the output sample. More...
 
int _ldiagIndex
 If user requests "ldiag", its index in the output sample. More...
 
int _spdIndex
 If user requests wind speed, variable name "spd", its index in the output sample. More...
 
int _dirIndex
 If user requests wind direction, variable name "dir", its index in the output sample. More...
 
unsigned int _noutVals
 
unsigned int _numParsed
 Number of variables that are parsed from input, i.e. More...
 
nidas::core::CalFile_oaCalFile
 CalFile containing wind offsets and rotation angles. More...
 
double _shadowFactor
 Transducer shadow (aka flow distortion) correction factor. More...
 
std::map< const SampleTag
*, TimetagAdjuster * > 
_ttadjusters
 
bool _openable
 Whether this sensor is allowed to be opened. More...
 

Static Protected Attributes

static const int DATA_GAP_USEC = 60000000
 

Private Member Functions

bool terminalMode () throw (nidas::util::IOException)
 
bool dataMode () throw (nidas::util::IOException)
 
std::string querySonic (int &acqrate, char &osc, std::string &serialNumber, std::string &revsion, int &rtsIndep, int &recSep) throw (nidas::util::IOException)
 Send a "??CR" string, and read the response, parsing out the acquisition rate, osc parameter, serial number and the software revision. More...
 
const char * getRateCommand (int rate, bool overSample) const
 
std::string sendRateCommand (const char *cmd) throw (nidas::util::IOException)
 
 CSAT3_Sonic (const CSAT3_Sonic &)
 No copying. More...
 
CSAT3_Sonicoperator= (const CSAT3_Sonic &)
 No assignment. More...
 

Private Attributes

size_t _windInLen
 expected input sample length of basic CSAT3 record. More...
 
size_t _totalInLen
 expected input sample length of basic CSAT3 record, with any additional fields added by NCAR/EOL "serializer" A2D. More...
 
int _windNumOut
 Requested number of output wind variables. More...
 
int _spikeIndex
 If user requests despike variables, e.g. More...
 
dsm_sample_id_t _windSampleId
 Output sample id of the wind sample. More...
 
std::vector< SampleTag * > _extraSampleTags
 Sample tags of extra "serializer" values. More...
 
dsm_time_t _timetags [2]
 
int _nttsave
 
int _counter
 
std::vector< short > _swapBuf
 
int _rate
 
bool _oversample
 
std::string _serialNumber
 
std::string _sonicLogFile
 
int _gapDtUsecs
 This is a limit for the inter-sample delta-T. More...
 
dsm_time_t _ttlast
 Last time tag. More...
 
bool _nanIfDiag
 Set winds and virtual temperature to NaN if diagnostic value is non-zero? More...
 
int _consecutiveOpenFailures
 Counter of how many times a open fails because it could't query the sonic serial number, and then get recognizable samples. More...
 
bool _checkConfiguration
 Whether to log the sonic parameters and set the rate in the open method. More...
 
bool _checkCounter
 Whether to check the counter in the data samples in order to detect missing samples. More...
 
nidas::core::TimetagAdjuster_ttadjuster
 

Detailed Description

A class for making sense of data from a Campbell Scientific Inc CSAT3 3D sonic anemometer.

This also supports records which have been altered by an NCAR/EOL "serializer" A2D, which digitizes voltages at the reporting rate of the sonic and inserts additional 2-byte A2D counts in the CSAT3 sample.

Member Typedef Documentation

Constructor & Destructor Documentation

CSAT3_Sonic::CSAT3_Sonic ( )
CSAT3_Sonic::~CSAT3_Sonic ( )
nidas::dynld::isff::CSAT3_Sonic::CSAT3_Sonic ( const CSAT3_Sonic )
private

No copying.

Member Function Documentation

void DSMSensor::addCalFile ( CalFile val)
inherited

Add a calibration file for this DSMSensor.

After this method is finished, DSMSensor will own the pointer, and will delete it in the DSMSensor destructor.

References nidas::core::DSMSensor::_calFiles, and nidas::core::CalFile::getName().

Referenced by nidas::core::DSMSensor::fromDOMElement().

void DSMSensor::addParameter ( Parameter val)
inherited

Add a parameter to this DSMSensor.

DSMSensor will then own the pointer and will delete it in its destructor. If a Parameter exists with the same name, it will be replaced with the new Parameter.

References nidas::core::DSMSensor::_constParameters, nidas::core::DSMSensor::_parameters, and nidas::core::Parameter::getName().

Referenced by nidas::core::DSMSensor::fromDOMElement().

virtual void nidas::core::CharacterSensor::addPrompt ( const std::string &  promptString,
double  promptRate,
double  promptOffset 
)
inlinevirtualinherited

Prompting Sensors can have multiple prompts and rates.

Add another prompt and rate to this sensor.

Parameters
promptStringMay contain backslash escape sequences.
promptRateprompts/sec.

References nidas::core::CharacterSensor::_prompted, nidas::core::CharacterSensor::_prompts, nidas::core::Prompt::setOffset(), nidas::core::Prompt::setRate(), and nidas::core::Prompt::setString().

Referenced by nidas::core::CharacterSensor::validate().

void nidas::core::DSMSensor::addSampleClient ( SampleClient c)
throw (
)
inlinevirtualinherited
void nidas::core::DSMSensor::addSampleClientForTag ( SampleClient client,
const SampleTag tag 
)
throw (
)
inlinevirtualinherited
void DSMSensor::addSampleTag ( SampleTag val)
throw (nidas::util::InvalidParameterException
)
virtualinherited

Add a SampleTag to this sensor.

DSMSensor will own the SampleTag. Throw an exception the DSMSensor cannot support the sample (bad rate, wrong number of variables, etc). Note that a SampleTag may be changed after it has been added. addSampleTag() is called when a sensor is initialized from the sensor catalog. The SampleTag may be modified later if it is overridden in the actual sensor entry. For this reason, it is wise to wait to scan the SampleTags of a DSMSensor in the validate(), init() or open() methods, which are invoked after fromDOMElement.

Reimplemented in nidas::dynld::isff::DAUSensor.

References GET_DSM_ID, GET_SHORT_ID, nidas::util::Logger::getInstance(), nidas::util::Logger::log(), and LOG_WARNING.

Referenced by nidas::dynld::isff::DAUSensor::addSampleTag(), nidas::dynld::RawSampleService::connect(), nidas::core::DSMSensor::fromDOMElement(), and main().

void CharacterSensor::adjustTimeTag ( SampleTag stag,
SampleT< float > *  outs 
)
protectedinherited
bool nidas::core::DSMSensor::allowOpen ( )
inlineinherited
void DSMSensor::applyConversions ( SampleTag stag,
SampleT< float > *  outs,
float *  results = 0 
)
protectedinherited

Perform variable conversions for the variables in stag whose values and sample time have been set in outs.

This method can be used by subclasses to apply any variable conversions associated with the variables in the given SampleTag, using a general algorithm which loops over each value in each variable. The min/max value limits of a variable are applied also, so if a variable value is converted but lies outside the min/max range, the value is set to floatNAN. Typically this can be the last step applied to the output sample of a sensor's process() method, and note that the sample time must already be set in the output sample outs, since that time will be used to look up conversions in calibration files.

If results is non-null, then the converted values are written into results instead of overwriting the values in outs. This is used when one variable's results may be used to filter other variables without replacing the one variable's results. An example is the Ifan variable in the TRH WisardMote. results must point to enough memory to hold all of the values in outs, including for any Variables with multiple values (getLength() > 1).

See Variable::convert().

References nidas::core::Variable::convert(), fp, nidas::core::SampleT< DataT >::getDataPtr(), nidas::core::Sample::getTimeTag(), and nidas::core::SampleTag::getVariables().

void Wind3D::applyOrientation ( nidas::core::dsm_time_t  tt,
float *  uvwt 
)
throw (
)
inherited

Apply orientation changes to the wind components.

void SerialSensor::applyTermios ( )
throw (nidas::util::IOException
)
inherited
IODevice * SerialSensor::buildIODevice ( )
throw (nidas::util::IOException
)
virtualinherited

Creates an IODevice depending on the device name prefix: name prefix type of IODevice inet: TCPSocketIODevice sock: TCPSocketIODevice usock: UDPSocketIODevice btspp: BluetoothRFCommSocketIODevice all others SerialPortIODevice.

If a SerialPortIODevice is created, the Termios of this SerialSensor is copied to the device, which will then be applied when the device is opened.

Reimplemented from nidas::core::CharacterSensor.

References nidas::core::SerialSensor::_rts485, nidas::core::SerialSensor::_serialDevice, nidas::core::SerialSensor::_termios, nidas::core::DSMSensor::getDeviceName(), nidas::core::SerialPortIODevice::setRTS485(), and nidas::core::SerialPortIODevice::termios().

SampleScanner * SerialSensor::buildSampleScanner ( )
throw (nidas::util::InvalidParameterException
)
virtualinherited
void nidas::core::DSMSensor::calcStatistics ( unsigned int  periodUsec)
inlineinherited

Update the sensor sampling statistics.

Should be called every periodUsec by a user of this sensor.

Parameters
periodUsecStatistics period.

References nidas::core::DSMSensor::_scanner, and nidas::core::SampleScanner::calcStatistics().

Referenced by nidas::core::SensorHandler::calcStatistics().

void CSAT3_Sonic::checkSampleTags ( )
throw (nidas::util::InvalidParameterException
)
protectedvirtual
void nidas::core::DSMSensor::clearBuffer ( )
inlineprotectedinherited
void SerialSensor::close ( )
throw (nidas::util::IOException
)
virtualinherited
float CSAT3_Sonic::correctTcForPathCurvature ( float  tc,
float  u,
float  v,
float  w 
)

No correction for path curvature is needed on the CSAT, so this method just returns an unchanged tc.

bool CSAT3_Sonic::dataMode ( )
throw (nidas::util::IOException
)
private
Returns
: true=data received, false=no or invalid data received.

References DLOG, ILOG, MSECS_PER_SEC, USECS_PER_MSEC, and USECS_PER_SEC.

void DSMSensor::deleteLooper ( )
staticinherited
void Wind3D::despike ( nidas::core::dsm_time_t  tt,
float *  uvwt,
int  n,
bool *  spikeOrMissing 
)
throw (
)
inherited
void nidas::core::DSMSensor::distributeRaw ( const Sample s)
throw (
)
inlineinherited

Distribute a raw sample which has been read from my file descriptor in real time.

References nidas::core::DSMSensor::_rawSource, and nidas::core::SampleSourceSupport::distribute().

bool CharacterSensor::doesAsciiSscanfs ( )
inherited
virtual void nidas::core::DSMSensor::executeXmlRpc ( XmlRpc::XmlRpcValue &  ,
XmlRpc::XmlRpcValue &   
)
throw (
)
inlinevirtualinherited

Method invoked when the DSMEngineIntf XmlRpcServer receives a "SensorAction" request, with a "device" string matching the string that this DSMSensor registers via DSMEngine::registerSensorWithXmlRpc(string,DSMServer*).

The default base class method does nothing.

Reimplemented in nidas::dynld::raf::DSMAnalogSensor, and nidas::dynld::raf::PSI9116_Sensor.

Referenced by nidas::core::DSMEngineIntf::SensorAction::execute().

std::string nidas::core::DSMSensor::expandString ( const std::string &  input) const
inlineinherited

Utility function to expand ${TOKEN} or $TOKEN fields in a string with their value from getTokenValue().

If curly brackets are not used, then the TOKEN should be delimited by a '/', a '.' or the end of string, e.g.: xxx/yyy/$ZZZ.dat

References nidas::core::DSMSensor::_dictionary, and nidas::core::Dictionary::expandString().

Referenced by nidas::core::DSMSensor::fromDOMElement(), and nidas::core::CalFile::open().

VariableIndex DSMSensor::findVariableIndex ( const std::string &  vprefix)
protectedinherited

Search all the sample tags for a variable whose name starts with the given prefix, and return it's index in the list of variables in the sample tag.

If no such variable is found, return -1.

References nidas::core::Variable::getName(), nidas::core::DSMSensor::getSampleTags(), and nidas::core::SampleTag::getVariables().

void nidas::core::DSMSensor::flush ( )
throw (
)
inlinevirtualinherited

Implementation of SampleClient::flush().

This is where a DSMSensor's process() method could send out any buffered results that might be ready.

Implements nidas::core::SampleClient.

Referenced by nidas::dynld::psql::PSQLProcessor::disconnect().

void SerialSensor::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtualinherited
virtual bool nidas::core::DSMSensor::getApplyVariableConversions ( ) const
inlinevirtualinherited
const std::string nidas::core::CharacterSensor::getBackslashedMessageSeparator ( ) const
inlineinherited

Get message separator with backslash sequences added back.

References nidas::core::CharacterSensor::_messageSeparator, and nidas::util::addBackslashSequences().

size_t nidas::core::DSMSensor::getBadTimeTagCount ( ) const
inlineinherited
double nidas::dynld::isff::Wind3D::getBias ( int  i) const
inlineinherited
virtual size_t nidas::core::DSMSensor::getBytesAvailable ( ) const
throw (nidas::util::IOException
)
inlinevirtualinherited

How many bytes are available to read on this sensor.

See Also
IODevice::getBytesAvailable().

References nidas::core::DSMSensor::_iodev, and nidas::core::IODevice::getBytesAvailable().

CalFile * DSMSensor::getCalFile ( const std::string &  name)
inherited

Return a CalFile by its getName().

Will return NULL if not found.

References nidas::core::DSMSensor::_calFiles.

const std::map<std::string,CalFile*>& nidas::core::DSMSensor::getCalFiles ( )
inlineinherited

Return the collection of CalFiles, mapped by name.

References nidas::core::DSMSensor::_calFiles.

Referenced by sensorTitle(), and PConfig::showCalFiles().

virtual const std::string& nidas::core::DSMSensor::getCatalogName ( ) const
inlinevirtualinherited
virtual const std::string& nidas::core::DSMSensor::getClassName ( ) const
inlinevirtualinherited
const string DSMSensor::getClassName ( const xercesc::DOMElement *  node,
const Project project 
)
throw (nidas::util::InvalidParameterException
)
staticinherited

Crawl through the DOM tree for a DSMSensor to find the class name - scanning the catalog entry if necessary.

References nidas::core::XDOMElement::getAttributeValue(), and nidas::core::DSMSensor::getClassName().

int nidas::core::DSMSensor::getClientCount ( ) const
throw (
)
inlinevirtualinherited

How many SampleClients are currently in my list.

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_source, and nidas::core::SampleSourceSupport::getClientCount().

virtual int nidas::core::DSMSensor::getDefaultMode ( ) const
inlinevirtualinherited

How do I want to be opened.

The user can ignore it if they want to.

Returns
one of O_RDONLY, O_WRONLY or O_RDWR.

References nidas::core::DSMSensor::_defaultMode.

Referenced by nidas::core::DSMSensor::fromDOMElement(), and nidas::core::SensorOpener::run().

float nidas::core::DSMSensor::getDepth ( ) const
inlineinherited

Get sensor depth below ground.

Returns
Depth of sensor below ground, in meters.

References nidas::core::DSMSensor::_height.

const std::string& nidas::core::DSMSensor::getDepthString ( ) const
inlineinherited

Get sensor depth below ground in a string.

Returns
Depth of sensor below ground, e.g. "5cm".

References nidas::core::DSMSensor::_depthString.

Referenced by SampleCounter::collectMetadata().

bool nidas::dynld::isff::Wind3D::getDespike ( ) const
inlineinherited
virtual const std::string& nidas::core::DSMSensor::getDeviceName ( ) const
inlinevirtualinherited
const Dictionary& nidas::core::DSMSensor::getDictionary ( ) const
inlineinherited
double nidas::dynld::isff::Wind3D::getDiscLevel ( ) const
inlineinherited
double nidas::dynld::isff::Wind3D::getDiscLevelMultiplier ( ) const
inlineinherited
virtual int nidas::core::DSMSensor::getDriverTimeTagUsecs ( ) const
inlinevirtualinherited
const DSMConfig* nidas::core::DSMSensor::getDSMConfig ( ) const
inlineinherited
unsigned int nidas::core::DSMSensor::getDSMId ( ) const
inlineinherited
const std::string & DSMSensor::getDSMName ( ) const
inherited
bool nidas::core::DSMSensor::getDuplicateIdOK ( ) const
inlineinherited

getDuplicateIdOK will be true if it is OK for samples from this sensor to have identical IDs to samples from another sensor.

That other sensor must also agree that dupicateIdOK are OK. This can be useful if one may not be certain of the device name, e.g. /dev/ttyUSB*, that the system will assign to a sensor may use, but there are identifiers in the data returned that allow one to sort things out. In general, getDuplicateID is false.

References nidas::core::DSMSensor::_duplicateIdOK.

Referenced by nidas::core::Site::validate(), and nidas::core::DSMConfig::validateSensorAndSampleIds().

const std::string& nidas::core::DSMSensor::getFullSuffix ( ) const
inlineinherited

Full sensor suffix, the concatenation of the sensor suffix, if any, and the height or depth string, if any.

The full sensor suffix are words 2 and 3 in the dot-separated name: variable[.sensor][.height][.site]

References nidas::core::DSMSensor::_fullSuffix.

Referenced by nidas::core::DSMSensor::fromDOMElement().

float nidas::core::DSMSensor::getHeight ( ) const
inlineinherited

Get sensor height above ground.

Returns
Height of sensor above ground, in meters. Nan if unknown.

References nidas::core::DSMSensor::_height.

const std::string& nidas::core::DSMSensor::getHeightString ( ) const
inlineinherited
dsm_sample_id_t nidas::core::DSMSensor::getId ( ) const
inlineinherited
const std::string& nidas::core::CharacterSensor::getInitString ( ) const
inlineinherited
IODevice* nidas::core::DSMSensor::getIODevice ( ) const
inlineprotectedinherited
virtual double nidas::core::DSMSensor::getLagSecs ( ) const
inlineprotectedvirtualinherited

Return the sampling lag for this sensor in seconds.

See getLagUsecs().

References nidas::core::DSMSensor::_lag, and USECS_PER_SEC.

virtual int nidas::core::DSMSensor::getLagUsecs ( ) const
inlineprotectedvirtualinherited

Return the sampling lag for this sensor in microseconds.

A positive lag means one should adjust the sample time tags for this sensor earlier in time to achieve a better estimate of the actual time to be associated for each sample. Derived classes can use this method in their process method to correct for inherent, constant, sampling lags of a sensor. A fixed sample lag, in fractional seconds, can be set for a sensor in the XML:

<sensor>
<parameter name="lag" type = "float" value="0.186"/>
</sensor>

The DSMSensor::fromDOM() method parses this parameter and sets the value of the lag.

References nidas::core::DSMSensor::_lag.

Referenced by nidas::core::CharacterSensor::adjustTimeTag().

virtual float nidas::core::DSMSensor::getLatency ( ) const
inlinevirtualinherited
double nidas::dynld::isff::Wind3D::getLeanAzimuthDegrees ( ) const
inlineinherited
double nidas::dynld::isff::Wind3D::getLeanDegrees ( ) const
inlineinherited
const std::string & DSMSensor::getLocation ( ) const
inherited

Location string.

A DSMConfig also has a Location. If the location has not been set for this DSMSensor, then the location of the DSMConfig will be returned.

References nidas::core::DSMSensor::_dsm, nidas::core::DSMSensor::_location, and nidas::core::DSMConfig::getLocation().

Referenced by SampleCounter::collectMetadata(), and nidas::core::DSMSensor::printStatusHeader().

Looper * DSMSensor::getLooper ( )
staticprotectedinherited
unsigned int nidas::core::DSMSensor::getMaxSampleLength ( ) const
inlineinherited
int nidas::core::CharacterSensor::getMaxScanfFields ( ) const
inlineinherited

The maximum number of fields in any of the AsciiSscanfs for this CharacterSensor.

Prior to scanning a message, a sample of this size must be allocated.

References nidas::core::CharacterSensor::_maxScanfFields.

int nidas::core::CharacterSensor::getMessageLength ( ) const
inlineinherited
const std::string& nidas::core::CharacterSensor::getMessageSeparator ( ) const
inlineinherited

Get message separator with backslash sequences replaced by their intended character.

References nidas::core::CharacterSensor::_messageSeparator.

Referenced by nidas::core::CharacterSensor::buildSampleScanner().

bool nidas::core::CharacterSensor::getMessageSeparatorAtEOM ( ) const
inlineinherited
unsigned int nidas::core::DSMSensor::getMinSampleLength ( ) const
inlineinherited
virtual std::string nidas::core::DSMSensor::getName ( ) const
inlinevirtualinherited

Return a name that should fully identify this sensor.

This name could be used in informative messages. The returned name has this format: dsmName:deviceName.

References nidas::core::DSMSensor::getDeviceName(), and nidas::core::DSMSensor::getDSMName().

Referenced by nidas::core::SensorHandler::add(), nidas::core::SamplePipeline::addSampleClient(), nidas::core::SerialSensor::buildSampleScanner(), nidas::dynld::psql::PSQLProcessor::connect(), nidas::core::SamplePipeline::connect(), nidas::dynld::raf::CVIProcessor::connectSource(), nidas::dynld::raf::DSMArincSensor::fromDOMElement(), nidas::core::DSMSensor::fromDOMElement(), nidas::core::SensorHandler::PolledDSMSensor::getName(), nidas::core::SensorHandler::incrementFullBufferReads(), nidas::dynld::raf::UHSAS_Serial::init(), nidas::dynld::WxtSensor::init(), nidas::core::CharacterSensor::init(), nidas::dynld::raf::DSMArincSensor::init(), nidas::dynld::raf::TwoD64_USB::init_parameters(), nidas::dynld::raf::TwoD_USB::init_parameters(), nidas::core::TimetagAdjuster::log(), nidas::core::DSMSensor::printStatusHeader(), nidas::core::DSMSensor::readSamples(), nidas::core::SensorOpener::run(), nidas::dynld::WxtSensor::scanSample(), nidas::dynld::raf::UHSAS_Serial::sendInitString(), nidas::core::DSMConfig::sensorFromDOMElement(), PConfig::showAll(), nidas::core::CharacterSensor::startPrompting(), nidas::core::CharacterSensor::stopPrompting(), nidas::dynld::raf::UDPArincSensor::validate(), nidas::dynld::A2DSensor::validate(), nidas::core::CharacterSensor::validate(), nidas::dynld::raf::SppSerial::validate(), nidas::core::Site::validate(), nidas::core::DSMSensor::validate(), nidas::core::DSMConfig::validateSensorAndSampleIds(), nidas::core::CharacterSensor::validateSscanfs(), nidas::core::MessageStreamScanner::warnBackwardsStepTimeTag(), nidas::core::MessageStreamScanner::warnNonIncrTimeTag(), nidas::dynld::WxtSensor::wxtValidateSscanfs(), and nidas::dynld::raf::UHSAS_Serial::~UHSAS_Serial().

static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
virtual const std::list<SampleTag*>& nidas::core::DSMSensor::getNonConstSampleTags ( )
inlinevirtualinherited

We'll allow derived classes and calibration applications to change the SampleTags, so this method returns a list of non-constant SampleTags.

References nidas::core::DSMSensor::_sampleTags.

bool nidas::core::CharacterSensor::getNullTerminated ( ) const
inlineinherited
int nidas::core::CharacterSensor::getNumScanfFailures ( ) const
inlineinherited

How many samples have resulted in complete scanf failures - nothing parsed, because the sensor messages do not correspond to the sscanf format.

References nidas::core::CharacterSensor::_scanfFailures.

int nidas::core::CharacterSensor::getNumScanfPartials ( ) const
inlineinherited

How many samples have been partially scanned, because a character in the middle of a message conflicts with the sscanf format.

References nidas::core::CharacterSensor::_scanfPartials.

float nidas::core::DSMSensor::getObservedDataRate ( ) const
inlineinherited
float nidas::core::DSMSensor::getObservedSamplingRate ( ) const
inlineinherited
double nidas::dynld::isff::Wind3D::getOutlierProbability ( ) const
inlineinherited
const Parameter * DSMSensor::getParameter ( const std::string &  name) const
inherited
const std::list<const Parameter*>& nidas::core::DSMSensor::getParameters ( ) const
inlineinherited

Get list of parameters.

References nidas::core::DSMSensor::_constParameters.

Referenced by nidas::dynld::A2DSensor::validate().

SampleSource* nidas::core::DSMSensor::getProcessedSampleSource ( )
inlinevirtualinherited

Implementation of SampleSource::getProcessedSampleSource().

Return the SampleSource for processed samples from this DSMSensor.

Implements nidas::core::SampleSource.

Referenced by nidas::dynld::RawSampleService::schedule().

double nidas::core::CharacterSensor::getPromptOffset ( ) const
inlineprotectedinherited
double nidas::core::CharacterSensor::getPromptRate ( ) const
inlineprotectedinherited
const std::list<Prompt>& nidas::core::CharacterSensor::getPrompts ( ) const
inlineinherited
const std::string& nidas::core::CharacterSensor::getPromptString ( ) const
inlineprotectedinherited
const char * CSAT3_Sonic::getRateCommand ( int  rate,
bool  overSample 
) const
private

References rate.

SampleSource* nidas::core::DSMSensor::getRawSampleSource ( )
inlinevirtualinherited

Implementation of SampleSource::getRawSampleSource().

Return the SampleSource for raw samples from this DSMSensor. A DSMSensor is only a SampleSource of raw samples when running in real-time, not during post-processing.

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_rawSource.

Referenced by nidas::core::RemoteSerialConnection::close(), and nidas::dynld::RawSampleService::schedule().

const SampleTag* nidas::core::DSMSensor::getRawSampleTag ( ) const
inlineinherited
virtual int nidas::core::DSMSensor::getReadFd ( ) const
inlinevirtualinherited
SampleScanner* nidas::core::DSMSensor::getSampleScanner ( ) const
inlineprotectedinherited
const SampleStats& nidas::core::DSMSensor::getSampleStats ( ) const
inlinevirtualinherited
SampleTagIterator nidas::core::DSMSensor::getSampleTagIterator ( ) const
inlinevirtualinherited
std::list<const SampleTag*> nidas::core::DSMSensor::getSampleTags ( ) const
inlinevirtualinherited
std::list<SampleTag*>& nidas::core::DSMSensor::getSampleTags ( )
inlineinherited

Non-const method to get a list of non-const pointers to SampleTags.

References nidas::core::DSMSensor::_sampleTags.

const std::list<AsciiSscanf*>& nidas::core::CharacterSensor::getScanfers ( ) const
inlineinherited

Return the list of AsciiSscanfs requested for this CharacterSensor.

This list is only valid after the init() method has been called.

References nidas::core::CharacterSensor::_sscanfers.

Referenced by nidas::dynld::raf::UHSAS_Serial::init(), nidas::dynld::WxtSensor::init(), and nidas::dynld::WxtSensor::wxtValidateSscanfs().

unsigned int nidas::core::DSMSensor::getSensorId ( ) const
inlineinherited
string CSAT3_Sonic::getSerialNumber ( const std::string &  str,
std::string::size_type &  index 
)

Get serial number field and its index in "??" query output.

const Site * DSMSensor::getSite ( ) const
inherited
int nidas::core::DSMSensor::getStation ( ) const
inlineinherited
const std::string& nidas::core::DSMSensor::getSuffix ( ) const
inlineinherited

Sensor suffix, which is added to variable names.

It is only necessary to have a sensor suffix to make variable names unique. For example, if there are multiple sensors at the same height, with common variable names, then one can use a sensor suffix to make unique names. The sensor suffix is the second dot-separated word in a variable name, where only the first word is required: variable[.sensor][.height][.site]

References nidas::core::DSMSensor::_suffix.

Referenced by ExtractFast2D::countParticles(), nidas::core::DSMSensor::fromDOMElement(), nidas::core::DSMSensor::MyDictionary::getTokenValue(), ExtractFast2D::run(), ExtractDMT::run(), sensorTitle(), nidas::core::DSMSensor::setDepth(), and nidas::core::DSMSensor::setHeight().

double nidas::dynld::isff::Wind3D::getTcOffset ( ) const
inlineinherited
double nidas::dynld::isff::Wind3D::getTcSlope ( ) const
inlineinherited
const nidas::util::Termios& nidas::core::SerialSensor::getTermios ( ) const
inlineinherited

Get a read-only copy of the Termios.

int nidas::core::DSMSensor::getTimeoutCount ( ) const
inlineinherited
virtual int nidas::core::DSMSensor::getTimeoutMsecs ( ) const
inlinevirtualinherited
bool nidas::core::DSMSensor::getTokenValue ( const std::string &  token,
std::string &  value 
) const
inlineinherited

Implement a lookup for tokens that I know about, like $HEIGHT.

For other tokens, call getDSMConfig()->getTokenValue(token,value);

References nidas::core::DSMSensor::_dictionary, and nidas::core::DSMSensor::MyDictionary::getTokenValue().

virtual const std::string& nidas::core::DSMSensor::getTypeName ( void  ) const
inlinevirtualinherited

Get the type name of this sensor.

References nidas::core::DSMSensor::_typeName.

int SerialSensor::getUsecsPerByte ( ) const
inherited

If the underlying IODevice is a SerialPortIODevice, return the value of SerialPortIODevice::getUsecsPerByte(), otherwise return 0, which means no timetag correction for transmission delay will be applied.

References nidas::core::SerialSensor::_serialDevice, and nidas::core::SerialPortIODevice::getUsecsPerByte().

Referenced by nidas::core::SerialSensor::buildSampleScanner().

VariableIterator DSMSensor::getVariableIterator ( ) const
inherited
double nidas::dynld::isff::Wind3D::getVazimuth ( ) const
inlineinherited
virtual int nidas::core::DSMSensor::getWriteFd ( ) const
inlinevirtualinherited
void nidas::core::DSMSensor::incrementTimeoutCount ( )
inlineinherited
void CharacterSensor::init ( )
throw (nidas::util::InvalidParameterException
)
virtualinherited
void SerialSensor::initPrompting ( )
throw (nidas::util::IOException
)
protectedinherited
virtual void nidas::core::DSMSensor::ioctl ( int  request,
void *  buf,
size_t  len 
)
throw (nidas::util::IOException
)
inlinevirtualinherited

Perform an ioctl on the device.

request is an integer value which must be supported by the device. Normally this is a value from a header file for the device.

References nidas::core::DSMSensor::_iodev, nidas::core::IODevice::ioctl(), and len.

virtual bool nidas::core::CharacterSensor::isPrompted ( ) const
inlinevirtualinherited

Is this a prompted sensor.

Will be true if setPromptString() has been called with a non-empty string, and setPromptRate() has been called with a rate other than IRIG_ZERO_HZ.

References nidas::core::CharacterSensor::_prompted.

Referenced by nidas::core::SerialSensor::initPrompting(), nidas::core::SerialSensor::startPrompting(), and nidas::core::SerialSensor::stopPrompting().

bool nidas::core::SerialSensor::isPrompting ( ) const
inlinevirtualinherited

Is prompting active, i.e.

isPrompted() is true, and startPrompting has been called?

Reimplemented from nidas::core::CharacterSensor.

virtual Sample* nidas::core::DSMSensor::nextSample ( )
inlinevirtualinherited
void Wind3D::offsetsTiltAndRotate ( nidas::core::dsm_time_t  tt,
float *  uvwt 
)
throw (
)
inherited

Do standard bias removal, tilt correction and horizontal rotation of 3d sonic anemometer data.

time tag of the data, used to search for a parameter a file containing a calibration time series.

Parameters
uvwtPointer to an array of 4 floats, containing u,v,w and tc(virtual temperature). New values are written back via the pointers.
void CSAT3_Sonic::open ( int  flags)
throw (nidas::util::IOException,
nidas::util::InvalidParameterException
)
virtual

Open the serial port connected to this sonic.

open() also queries the sonic, with "??", for its status message, which contains, amongst other things, the serial number and the current sampling rate configuration. This information is gathered as samples, and will be archived. It is also optionally logged, if a "soniclog" string parameter is specified, which contains the path name of the log file. If the user has specified a rate parameter, which differs from the sonic's current configuration, then a command is sent to change the rate. Note that if the commands or the format of the CSAT3 sonic responses change, then this method, or the stopSonic(),querySonic() or startSonic() methods will likely need to be changed.

Reimplemented from nidas::core::SerialSensor.

Reimplemented in nidas::dynld::isff::CSI_IRGA_Sonic.

References DLOG, nidas::util::UTime::format(), nidas::core::SerialSensor::open(), PLOG, nidas::util::trimString(), USECS_PER_MSEC, nidas::util::Exception::what(), and WLOG.

CSAT3_Sonic& nidas::dynld::isff::CSAT3_Sonic::operator= ( const CSAT3_Sonic )
private

No assignment.

void CSAT3_Sonic::parseParameters ( )
throw (nidas::util::InvalidParameterException
)
virtual
void SerialSensor::printStatus ( std::ostream &  ostr)
throw (
)
virtualinherited
void DSMSensor::printStatusHeader ( std::ostream &  ostr)
throw (
)
inherited
void DSMSensor::printStatusTrailer ( std::ostream &  ostr)
throw (
)
inherited
bool Wind3D::process ( const nidas::core::Sample samp,
std::list< const nidas::core::Sample * > &  results 
)
throw (
)
inherited

Basic process method for sonic anemometer wind plus temperature: u,v,w,tc parsed from an ASCII sample.

Applies despiking, orientation corrections, bias, tilts and horizontal rotations, as configured.

References nidas::dynld::isff::metek::Apply3DCorrect(), nidas::util::dirFromUV(), nidas::core::floatNAN, nidas::core::Sample::freeReference(), nidas::core::Sample::getConstVoidDataPtr(), nidas::core::Sample::getDataByteLength(), nidas::core::Sample::getDataLength(), nidas::core::Sample::getTimeTag(), and nidas::core::CharacterSensor::process().

bool CSAT3_Sonic::process ( const Sample ,
std::list< const Sample * > &  result 
)
throw (
)
virtual
string CSAT3_Sonic::querySonic ( int &  acqrate,
char &  osc,
std::string &  serialNumber,
std::string &  revsion,
int &  rtsIndep,
int &  recSep 
)
throw (nidas::util::IOException
)
private

Send a "??CR" string, and read the response, parsing out the acquisition rate, osc parameter, serial number and the software revision.

rtsIndep is the setting of the "ri" parameter. For our free-running 3-wire mode, we want it to be ri=1, so that the RS232 drivers on the sonic are always on, not dependent on RTS.

recSep is the setting of the "rs" parameter. NIDAS expects a record separator (0x55AA), so it is set to rs=1.

Both of these can be set in EEPROM, following the procedure in section 12 of the CSAT3 manual.

References nidas::util::addBackslashSequences(), DLOG, getSerialNumber(), MSECS_PER_SEC, and USECS_PER_SEC.

virtual size_t nidas::core::DSMSensor::read ( void *  buf,
size_t  len 
)
throw (nidas::util::IOException
)
inlinevirtualinherited

Read from the device (duh).

Behaves like the read(2) system call, without a file descriptor argument, and with an IOException.

References nidas::core::DSMSensor::_iodev, len, and nidas::core::IODevice::read().

Referenced by main().

virtual size_t nidas::core::DSMSensor::read ( void *  buf,
size_t  len,
int  msecTimeout 
)
throw (nidas::util::IOException
)
inlinevirtualinherited

Read from the device with a timeout.

References nidas::core::DSMSensor::_iodev, len, and nidas::core::IODevice::read().

bool nidas::core::DSMSensor::readBuffer ( )
throw (nidas::util::IOException
)
inlineinherited
bool nidas::core::DSMSensor::readBuffer ( int  msecTimeout)
throw (nidas::util::IOException
)
inlineinherited
void Wind3D::readOffsetsAnglesCalFile ( nidas::core::dsm_time_t  tt)
throw (
)
inherited

Update the settings from the offsets and angles calibration file, if any.

References nidas::core::floatNAN, nidas::util::Logger::getInstance(), nidas::util::Logger::log(), LOG_WARNING, and nidas::util::Exception::what().

Sample * DSMSensor::readSample ( )
throw (nidas::util::IOException
)
virtualinherited

Return the next sample.

Buffer(s) will be read if necessary.

References nidas::core::DSMSensor::nextSample(), and nidas::core::DSMSensor::readBuffer().

Referenced by DmdA2dCk::run().

bool DSMSensor::readSamples ( )
throw (nidas::util::IOException
)
virtualinherited

Read samples from my associated file descriptor, and distribute() them to my RawSampleClient's.

This method is called by SensorHander, when select/poll indicates that data is available on the file descriptor returned by getReadFd(). This is a convienence method which does a readBuffer() to read available data from the DSMSensor into a buffer, and then repeatedly calls nextSample() to extract all samples out of that buffer.

References nidas::core::DSMSensor::_rawSource, nidas::core::SampleSourceSupport::distribute(), DLOG, nidas::core::DSMSensor::getDSMConfig(), nidas::core::DSMSensor::getDSMId(), nidas::core::Project::getName(), nidas::core::DSMSensor::getName(), nidas::core::DSMConfig::getProject(), nidas::core::DSMSensor::getSensorId(), nidas::core::DSMSensor::nextSample(), and nidas::core::DSMSensor::readBuffer().

Referenced by DmdA2dCk::run().

bool DSMSensor::receive ( const Sample s)
throw (
)
virtualinherited

A DSMSensor can be used as a SampleClient, meaning it receives its own raw samples.

In real-time operations, a DSMSensor can be added as a raw SampleClient of itself, using addRawSampleClient(). In post-processing, a DSMSensor typically receives samples with its own sample id from a SampleSorter. receive() then applies further processing via the process() method.

Implements nidas::core::SampleClient.

void DSMSensor::removeCalFiles ( )
inherited

Remove all CalFiles.

References nidas::core::DSMSensor::_calFiles.

Referenced by nidas::core::DSMSensor::~DSMSensor().

void nidas::core::DSMSensor::removeSampleClient ( SampleClient c)
throw (
)
inlinevirtualinherited
void nidas::core::DSMSensor::removeSampleClientForTag ( SampleClient client,
const SampleTag tag 
)
throw (
)
inlinevirtualinherited

Remove a SampleClient for a given SampleTag from this SampleSource.

The pointer to the SampleClient must remain valid, until after it is removed.

Implements nidas::core::SampleSource.

References nidas::core::DSMSensor::_source, and nidas::core::SampleSourceSupport::removeSampleClientForTag().

Referenced by nidas::core::SamplePipeline::removeSampleClientForTag().

void DSMSensor::removeSampleTag ( SampleTag val)
throw (
)
virtualinherited

Remove val from the list of SampleTags, and delete it.

virtual bool nidas::core::DSMSensor::reopenOnIOException ( ) const
inlinevirtualinherited

Whether to reopen this sensor on an IOException.

The base method returns true. Over-ride if a reopen should not be attempted.

int CharacterSensor::scanSample ( AsciiSscanf sscanf,
const char *  inputstr,
float *  data_ptr 
)
protectedvirtualinherited
SampleT< float > * CharacterSensor::searchSampleScanners ( const Sample samp,
SampleTag **  stag_out = 0 
)
throw (
)
protectedinherited

Search through the AsciiSscanf instances attached to this sensor, looking for the next scanner which parses at least one variable from the given raw sample.

The search picks up after the last scanner which matched a sample. The parsed values are added to a new Sample, and a pointer to the new Sample is returned. If stag_out is non-null, it is set to the SampleTag pointer for the AsciiSscanf which matched. If no scanners match this sample, then this returns null. The returned Sample has a reference which must be freed by the caller or passed on. Any unparsed variables in the returned sample are filled with NaN using trimUnparsed(). The time tag of the new Sample is set to the time of raw sample samp. No other time tag adjustments or variable conversions are applied, that is up to the caller.

References nidas::util::LogContext::active(), nidas::core::CHAR_ST, nidas::core::SampleT< DataT >::freeReference(), nidas::core::SampleT< DataT >::getConstVoidDataPtr(), nidas::core::SampleT< DataT >::getDataPtr(), nidas::core::AsciiSscanf::getFormat(), nidas::core::SampleTag::getId(), nidas::core::AsciiSscanf::getNumberOfFields(), nidas::core::AsciiSscanf::getSampleTag(), nidas::util::LogContext::log(), LOG_DEBUG, nidas::core::Sample::setId(), and nidas::core::Sample::setTimeTag().

void CharacterSensor::sendInitString ( )
throw (nidas::util::IOException
)
virtualinherited
string CSAT3_Sonic::sendRateCommand ( const char *  cmd)
throw (nidas::util::IOException
)
private

References DLOG, and MSECS_PER_SEC.

virtual void nidas::core::DSMSensor::setApplyVariableConversions ( bool  val)
inlinevirtualinherited
void Wind3D::setBias ( int  i,
double  val 
)
inherited
virtual void nidas::core::DSMSensor::setCatalogName ( const std::string &  val)
inlinevirtualinherited

Set the name of the catalog entry for this sensor.

References nidas::core::DSMSensor::_catalogName.

Referenced by nidas::core::DSMSensor::fromDOMElement().

virtual void nidas::core::DSMSensor::setClassName ( const std::string &  val)
inlinevirtualinherited

Set the class name.

In the usual usage this method is not used, and getClassName() is over-ridden in a derived class to return a constant string.

References nidas::core::DSMSensor::_className.

Referenced by nidas::core::DSMSensor::fromDOMElement().

virtual void nidas::core::DSMSensor::setDefaultMode ( int  val)
inlinevirtualinherited
void DSMSensor::setDepth ( const std::string &  val)
inherited

Set sensor depth below ground via a string which is added to variable names.

Parameters
valString containing sensor below and units in meters (m) or centimeters(cm), e.g. "5cm". This depth string is added to all the variable names, with a "." separator, so that a variable "Tsoil" for this sensor becomes "Tsoil.5cm".

References nidas::core::DSMSensor::_depthString, nidas::core::DSMSensor::_height, nidas::core::DSMSensor::_heightString, nidas::core::floatNAN, nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setFullSuffix().

Referenced by nidas::core::DSMSensor::fromDOMElement().

void DSMSensor::setDepth ( float  val)
inherited

Set sensor depth below ground.

Parameters
valdepth below ground, in meters. The depth is converted to centimeters and is added to all the variable names, with a "." separator, so that a variable "Tsoil" for this sensor becomes "Tsoil.5cm".

References nidas::core::DSMSensor::_depthString, nidas::core::DSMSensor::_height, nidas::core::DSMSensor::_heightString, nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setFullSuffix().

void nidas::dynld::isff::Wind3D::setDespike ( bool  val)
inlineinherited
virtual void nidas::core::DSMSensor::setDeviceName ( const std::string &  val)
inlinevirtualinherited

Set the name of the system device that the sensor is connected to.

Parameters
valName of device, e.g. "/dev/xxx0".

References nidas::core::DSMSensor::_devname.

Referenced by nidas::core::DSMSensor::fromDOMElement(), and main().

void nidas::dynld::isff::Wind3D::setDiscLevelMultiplier ( double  val)
inlineinherited
void nidas::dynld::isff::Wind3D::setDoHorizontalRotation ( bool  val)
inlineinherited

Should 2D horizontal rotations of U,V be applied?

References nidas::dynld::isff::Wind3D::_horizontalRotation.

void nidas::dynld::isff::Wind3D::setDoTiltCorrection ( bool  val)
inlineinherited

Should 3D tilt corrections be applied?

References nidas::dynld::isff::Wind3D::_tiltCorrection.

virtual void nidas::core::DSMSensor::setDriverTimeTagUsecs ( int  val)
inlinevirtualinherited
void DSMSensor::setDSMConfig ( const DSMConfig val)
inherited
void nidas::core::DSMSensor::setDSMId ( unsigned int  val)
inlineinherited
void nidas::core::DSMSensor::setDuplicateIdOK ( bool  val)
inlineinherited

Set the duplicate ID attribute of this DSMSensor.

References nidas::core::DSMSensor::_duplicateIdOK.

Referenced by nidas::core::DSMSensor::fromDOMElement().

void nidas::core::DSMSensor::setFullSuffix ( const std::string &  val)
inlineprotectedinherited
void DSMSensor::setHeight ( const std::string &  val)
inherited

Set sensor height above ground via a string which is added to variable names.

Parameters
valString containing sensor height and units in meters (m) or centimeters(cm), e.g. "15m". This height string is added to all the variable names, with a "." separator, so that a variable "u" for this sensor becomes "u.15m".

References nidas::core::DSMSensor::_depthString, nidas::core::DSMSensor::_height, nidas::core::DSMSensor::_heightString, nidas::core::floatNAN, nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setFullSuffix().

Referenced by nidas::core::DSMSensor::fromDOMElement().

void DSMSensor::setHeight ( float  val)
inherited

Set sensor height above ground.

Parameters
valheight above ground, in meters. The height is added to all the variable names, with a "." separator, so that a variable "u" for this sensor becomes "u.15m".

References nidas::core::DSMSensor::_depthString, nidas::core::DSMSensor::_height, nidas::core::DSMSensor::_heightString, nidas::core::DSMSensor::getSuffix(), and nidas::core::DSMSensor::setFullSuffix().

void nidas::core::DSMSensor::setId ( dsm_sample_id_t  val)
inlineinherited

Set the various levels of the sensor identification.

A sensor ID is a 32-bit value comprised of four parts: 6-bit sample type id (not used by DSMSensor), 10-bit DSM id, and 16-bit sensor+sample ids.

References nidas::core::DSMSensor::_id, and SET_FULL_ID.

void nidas::core::CharacterSensor::setInitString ( const std::string &  val)
inlineinherited

Set the initialization string(s) for this sensor.

The init string may contain backslash escape sequences like the prompt string.

References nidas::core::CharacterSensor::_initString.

void nidas::core::DSMSensor::setIODevice ( IODevice val)
inlineinherited

Set the IODevice for this sensor.

DSMSensor then owns the pointer and will delete it in its destructor.

References nidas::core::DSMSensor::_iodev.

virtual void nidas::core::DSMSensor::setLagSecs ( double  val)
inlineprotectedvirtualinherited

Set the sampling lag for this sensor in seconds.

This lag should then used to correct the timetags of the processed samples in the process() method of derived classes. Note that this lag is not used to alter the timetags of the raw samples. Raw samples are saved with the un-altered timetag that was determined at the moment they were sampled.

The lag is stored as a signed integer of microseconds, so lags should be between += 2147 seconds. No warning or exception is given if the value exceeds that limit. If your lag is greater than that I suggest you junk your sensor! A positive lag means one should adjust the sample time tags for this sensor earlier in time to achieve a better estimate of the actual time to be associated for each sample. A fixed sample lag, in fractional seconds, can be set for a sensor in the XML:

<parameter name="lag" type = "float" value="0.186"/>

The DSMSensor::fromDOM() method parses this parameter and calls this method to set the lag. process() methods in derived classes must apply this lag value. The DSMSensor base class does not adjust time tags of processed samples.

References nidas::core::DSMSensor::_lag, and USECS_PER_SEC.

Referenced by nidas::core::DSMSensor::fromDOMElement().

virtual void nidas::core::DSMSensor::setLatency ( float  val)
throw (nidas::util::InvalidParameterException
)
inlinevirtualinherited

Set desired latency, providing some control over the response time vs buffer efficiency tradeoff.

Setting a latency of 1/10 sec means buffer data in the driver for a 1/10 sec, then send the data to user space. Generally it should be set before doing a sensor open().

Parameters
valLatency, in seconds.

References nidas::core::DSMSensor::_latency.

Referenced by nidas::dynld::A2DSensor::A2DSensor(), nidas::core::DSMSensor::fromDOMElement(), and nidas::dynld::A2DSensor::validate().

void nidas::dynld::isff::Wind3D::setLeanAzimuthDegrees ( double  val)
inlineinherited
void nidas::dynld::isff::Wind3D::setLeanDegrees ( double  val)
inlineinherited
void nidas::core::DSMSensor::setLocation ( const std::string &  val)
inlineinherited
void SerialSensor::setMessageParameters ( unsigned int  len,
const std::string &  sep,
bool  eom 
)
throw (nidas::util::InvalidParameterException,
nidas::util::IOException
)
virtualinherited

Set message separator and message length parameters, which are used to parse and time-tag samples from the IODevice.

Reimplemented from nidas::core::CharacterSensor.

References len, and nidas::core::CharacterSensor::setMessageParameters().

void nidas::dynld::isff::Wind3D::setMetek ( int  ismetek)
inlineinherited
void nidas::dynld::isff::Wind3D::setOutlierProbability ( double  val)
inlineinherited
void nidas::core::CharacterSensor::setPromptOffset ( const double  val)
inlineprotectedinherited
void nidas::core::CharacterSensor::setPromptRate ( const double  val)
inlineprotectedinherited

Set the rate at which <sensor> prompts are sent to this sensor.

This will be set on a CharacterSensor if a <prompt> element is found for <sensor>, not as a sub-element of <sample>.

References nidas::core::CharacterSensor::_promptRate.

void nidas::core::CharacterSensor::setPromptString ( const std::string &  val)
inlineprotectedinherited

Set the <sensor> prompt string for this sensor.

The prompt string may contain backslash escape sequences and null characters, so be carefull when copying to a char*.

References nidas::core::CharacterSensor::_promptString.

void nidas::core::DSMSensor::setSampleScanner ( SampleScanner val)
inlineinherited

Set the SampleScanner for this sensor.

DSMSensor then owns the pointer and will delete it in its destructor.

References nidas::core::DSMSensor::_scanner.

void nidas::core::DSMSensor::setSensorId ( unsigned int  val)
inlineinherited
void DSMSensor::setStation ( int  val)
inherited
void DSMSensor::setSuffix ( const std::string &  val)
inherited
void nidas::dynld::isff::Wind3D::setTcOffset ( double  val)
inlineinherited
void nidas::dynld::isff::Wind3D::setTcSlope ( double  val)
inlineinherited
virtual void nidas::core::DSMSensor::setTimeoutMsecs ( int  val)
inlinevirtualinherited

Set the sensor timeout value in milliseconds.

A value of 0 means no timeout (e.g. infinite). If no data is received for this period, then the sensor is closed, and re-opened. For efficiency reasons, the system may not actually detect a sensor timeout of less than 1 second, so setting it to less than 1000 milliseconds will likely not reduce the time before a sensor timeout is detected.

References nidas::core::DSMSensor::_timeoutMsecs.

Referenced by nidas::core::RemoteSerialConnection::close(), and nidas::core::DSMSensor::fromDOMElement().

virtual void nidas::core::DSMSensor::setTypeName ( const std::string &  val)
inlinevirtualinherited

Set the type name of this sensor, e.g.

: "ACME Model 99 Mach7 Particle Disambiguator". This is meant for descriptive purposes only, and is not meant to change the behavior of a sensor object.

References nidas::core::DSMSensor::_typeName.

Referenced by nidas::core::DSMSensor::fromDOMElement().

void nidas::dynld::isff::Wind3D::setVazimuth ( double  val)
inlineinherited

Wind vectors in geographic coordinates are expressed by U, the component of the wind blowing toward the east, and V, the component of the wind blowing toward the north.

If the V axis of a sonic anemometer is pointing north then no rotation is necessary to convert from sonic coordinates to geographic. So the compass azimuth (0=north,90=east, etc) of the sonic +V axis is the angle between geographic and sonic coordinates.

References nidas::dynld::isff::Wind3D::_rotator, and nidas::dynld::isff::WindRotator::setAngleDegrees().

void SerialSensor::shutdownPrompting ( )
throw (nidas::util::IOException
)
protectedinherited

Shutdown prompting, typically done when a device is closed.

References nidas::core::SerialSensor::_prompters, and nidas::core::SerialSensor::stopPrompting().

Referenced by nidas::core::SerialSensor::close().

void SerialSensor::startPrompting ( )
throw (nidas::util::IOException
)
virtualinherited
void SerialSensor::stopPrompting ( )
throw (nidas::util::IOException
)
virtualinherited
bool CSAT3_Sonic::terminalMode ( )
throw (nidas::util::IOException
)
private
Returns
: true=successful, '>' prompt received, and then no data.

References DLOG, MSECS_PER_SEC, nidas::util::Exception::what(), and WLOG.

nidas::util::Termios& nidas::core::SerialSensor::termios ( )
inlineinherited

Expose the Termios.

One must call applyTermios() to apply any changes to the serial port.

xercesc::DOMElement * DSMSensor::toDOMElement ( xercesc::DOMElement *  node,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited

Add my content into a DOMElement.

Reimplemented from nidas::core::DOMable.

Referenced by nidas::core::DSMSensor::toDOMParent().

xercesc::DOMElement * DSMSensor::toDOMParent ( xercesc::DOMElement *  parent,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
virtual void nidas::core::CharacterSensor::togglePrompting ( )
throw (nidas::util::IOException
)
inlinevirtualinherited
void DSMSensor::trimUnparsed ( SampleTag stag,
SampleT< float > *  outs,
int  nparsed 
)
protectedinherited

Fill with floatNAN all the values past nparsed values in output sample outs, and trim the length of the sample to match the length of the variables in SampleTag stag.

process() methods which support partial scans of messages can use this to finalize an output sample according to the SampleTag that was matched with it and the number of values parsed.

References nidas::core::floatNAN, fp, nidas::core::SampleT< DataT >::getDataPtr(), nidas::core::Variable::getLength(), nidas::core::SampleTag::getVariables(), and nidas::core::SampleT< DataT >::setDataLength().

void nidas::core::SerialSensor::unixDevInit ( int  flags)
throw (nidas::util::IOException
)
protectedinherited
void Wind3D::validate ( )
throw (nidas::util::InvalidParameterException
)
virtualinherited

Validate the configuration of this sensor.

Calls the base class validate(), parseParameters(), and checkSampleTags().

Reimplemented from nidas::core::CharacterSensor.

References nidas::core::CharacterSensor::validate().

void Wind3D::validateSscanfs ( )
throw (nidas::util::InvalidParameterException
)
virtualinherited

Warn user if number of scanf fields does not match number expected from variables in sample.

Reimplemented from nidas::core::CharacterSensor.

References nidas::core::AsciiSscanf::getNumberOfFields().

virtual size_t nidas::core::DSMSensor::write ( const void *  buf,
size_t  len 
)
throw (nidas::util::IOException
)
inlinevirtualinherited

Write to the device (duh).

Behaves like write(2) system call, without a file descriptor argument, and with an IOException.

References nidas::core::DSMSensor::_iodev, len, and nidas::core::IODevice::write().

Referenced by nidas::dynld::raf::UHSAS_Serial::sendInitString(), and nidas::core::CharacterSensor::sendInitString().

Member Data Documentation

bool nidas::dynld::isff::Wind3D::_allBiasesNaN
protectedinherited
double nidas::dynld::isff::Wind3D::_bias[3]
protectedinherited
bool nidas::dynld::isff::CSAT3_Sonic::_checkConfiguration
private

Whether to log the sonic parameters and set the rate in the open method.

If false, simple open the port.

bool nidas::dynld::isff::CSAT3_Sonic::_checkCounter
private

Whether to check the counter in the data samples in order to detect missing samples.

If so, 16 is added to the diagbits variable if the counter is other than the last counter + 1, mod 64.

int nidas::dynld::isff::CSAT3_Sonic::_consecutiveOpenFailures
private

Counter of how many times a open fails because it could't query the sonic serial number, and then get recognizable samples.

int nidas::dynld::isff::CSAT3_Sonic::_counter
private
bool nidas::dynld::isff::Wind3D::_despike
protectedinherited
nidas::core::AdaptiveDespiker nidas::dynld::isff::Wind3D::_despiker[4]
protectedinherited
int nidas::dynld::isff::Wind3D::_diagIndex
protectedinherited

If user requests "diag" or "status", its index in the output sample.

int nidas::dynld::isff::Wind3D::_dirIndex
protectedinherited

If user requests wind direction, variable name "dir", its index in the output sample.

std::vector<SampleTag*> nidas::dynld::isff::CSAT3_Sonic::_extraSampleTags
private

Sample tags of extra "serializer" values.

int nidas::dynld::isff::CSAT3_Sonic::_gapDtUsecs
private

This is a limit for the inter-sample delta-T.

If the delta-T is greater than this value, then the saved values of the previous two sample time tags are discarded, and the correction for the 2 sample internal CSAT3 buffer is restarted, resulting in a discard of the previous 2 samples.

bool nidas::dynld::isff::Wind3D::_horizontalRotation
protectedinherited

Should horizontal rotation of U,V be performed?

Referenced by nidas::dynld::isff::Wind3D::setDoHorizontalRotation().

int nidas::dynld::isff::Wind3D::_ldiagIndex
protectedinherited

If user requests "ldiag", its index in the output sample.

bool nidas::dynld::isff::Wind3D::_metek
protectedinherited
bool nidas::dynld::isff::CSAT3_Sonic::_nanIfDiag
private

Set winds and virtual temperature to NaN if diagnostic value is non-zero?

unsigned int nidas::dynld::isff::Wind3D::_noutVals
protectedinherited
int nidas::dynld::isff::CSAT3_Sonic::_nttsave
private
unsigned int nidas::dynld::isff::Wind3D::_numParsed
protectedinherited

Number of variables that are parsed from input, i.e.

not derived.

nidas::core::CalFile* nidas::dynld::isff::Wind3D::_oaCalFile
protectedinherited

CalFile containing wind offsets and rotation angles.

bool nidas::core::DSMSensor::_openable
protectedinherited

Whether this sensor is allowed to be opened.

Most cases the answer is yes/true. But certain sensors should not be opened due to implementation. e.g. DSMArincSensor when used in conjunction with the UDPArincSensor for then Alta ENET appliance.

The fallout from setting this to false is that the sensor will not be added to SensorHandler.

Referenced by nidas::core::DSMSensor::allowOpen().

WindOrienter nidas::dynld::isff::Wind3D::_orienter
protectedinherited
bool nidas::dynld::isff::CSAT3_Sonic::_oversample
private
int nidas::dynld::isff::CSAT3_Sonic::_rate
private
WindRotator nidas::dynld::isff::Wind3D::_rotator
protectedinherited
nidas::core::dsm_sample_id_t nidas::dynld::isff::Wind3D::_sampleId
protectedinherited

Id of output sample.

std::string nidas::dynld::isff::CSAT3_Sonic::_serialNumber
private
double nidas::dynld::isff::Wind3D::_shadowFactor
protectedinherited

Transducer shadow (aka flow distortion) correction factor.

This value can be set in the XML with a sensor parameter called "shadowFactor".

std::string nidas::dynld::isff::CSAT3_Sonic::_sonicLogFile
private
int nidas::dynld::isff::Wind3D::_spdIndex
protectedinherited

If user requests wind speed, variable name "spd", its index in the output sample.

int nidas::dynld::isff::CSAT3_Sonic::_spikeIndex
private

If user requests despike variables, e.g.

"uflag","vflag","wflag","tcflag", the index of "uflag" in the output variables.

std::vector<short> nidas::dynld::isff::CSAT3_Sonic::_swapBuf
private
double nidas::dynld::isff::Wind3D::_tcOffset
protectedinherited
double nidas::dynld::isff::Wind3D::_tcSlope
protectedinherited
bool nidas::dynld::isff::Wind3D::_tiltCorrection
protectedinherited

Should 3D tilt correction be applied?

Referenced by nidas::dynld::isff::Wind3D::setDoTiltCorrection().

WindTilter nidas::dynld::isff::Wind3D::_tilter
protectedinherited
dsm_time_t nidas::dynld::isff::CSAT3_Sonic::_timetags[2]
private
size_t nidas::dynld::isff::CSAT3_Sonic::_totalInLen
private

expected input sample length of basic CSAT3 record, with any additional fields added by NCAR/EOL "serializer" A2D.

nidas::core::TimetagAdjuster* nidas::dynld::isff::CSAT3_Sonic::_ttadjuster
private
std::map<const SampleTag*, TimetagAdjuster*> nidas::core::CharacterSensor::_ttadjusters
protectedinherited
dsm_time_t nidas::dynld::isff::CSAT3_Sonic::_ttlast
private

Last time tag.

size_t nidas::dynld::isff::CSAT3_Sonic::_windInLen
private

expected input sample length of basic CSAT3 record.

int nidas::dynld::isff::CSAT3_Sonic::_windNumOut
private

Requested number of output wind variables.

dsm_sample_id_t nidas::dynld::isff::CSAT3_Sonic::_windSampleId
private

Output sample id of the wind sample.

const int nidas::dynld::isff::Wind3D::DATA_GAP_USEC = 60000000
staticprotectedinherited
const float CSAT3_Sonic::GAMMA_R = 402.684
static

Conversion factor from speed of sound squared to Kelvin.

See Appendix C of the "CSAT3 Three Dimensional Sonic Anemometer Instruction Manual". The sonic virtual temperature Ts, can be approximated from the measured speed of sound: Ts = c^2 / (Gamma_d * Rd) - 273.15 Where Gamma_d is the ratio of specific heat of dry air at constant pressure to that at constant volume. The usual approximation is: Gamma_d = 1.4 Rd is the gas constant for dry air, 287.04 J/K/kg: GAMMA_R = Gamma_d * Rd = 401.856

static const float GAMMA_R = 401.856;

However, up to early 2012 (NIDAS revision 6420) we used 20.067^2=402.684 for GAMMA_R, so until we clear this matter up, we'll use that value.


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