Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
DataCoder Class Reference

Converts ODIM encoded data (with markers) to natural values and backwards. More...

#include <DataCoder.h>

Inheritance diagram for DataCoder:
Inheritance graph
[legend]
Collaboration diagram for DataCoder:
Collaboration graph
[legend]

Public Member Functions

 DataCoder (const ODIM &dataODIM)
 Without quality (with impicit quality)
 
 DataCoder (const ODIM &dataODIM, const ODIM &qualityODIM)
 
 DataCoder (const DataCoder &converter)
 
virtual double getNoReadingMarker () const override
 
virtual bool decode (double &value) const override
 Converts storage data containing marker codes etc to natural scale.
 
virtual bool decode (double &value, double &weight) const override
 Converts storage data containing marker codes etc to natural scale. More...
 
virtual void encode (double &value, double &weight) const override
 Converts natural-scale data to storage data containing marker codes etc. More...
 
virtual void encodeWeight (double &weight) const override
 Converts natural-scale data to storage data, applying marker codes if needed.
 
virtual void encodeDiff (double &diff) const override
 When using unsigned types, encoding typically requires adding a positive bias and scaling the data.
 
void init ()
 Creates a naive quality field: data=1.0, undetect/nodata=0.0. More...
 
- Public Member Functions inherited from BeanLike
virtual const std::string & getName () const
 Return the name of an instance.
 
virtual const std::string & getDescription () const
 Return a brief description.
 
bool hasParameters () const
 
template<class F >
getParameter (const std::string &p) const
 Gets a single parameter.
 
const ReferenceMapgetParameters () const
 
ReferenceMapgetParameters ()
 
template<class F >
void setParametersFromEntries (const F &args)
 
void setParameters (std::initializer_list< Variable::init_pair_t > args)
 Grants access to (if above hidden)
 
virtual void setParameters (const std::string &p, char assignmentSymbol='=', char separatorSymbol=0)
 Sets comma-separated parameters in a predetermined order "a,b,c" or by specifing them "b=2". More...
 
template<class T >
void setParameters (const std::map< std::string, T > &args)
 Set parameters.
 
template<class T >
void setParameters (const SmartMap< T > &args)
 Set parameters.
 
void setParameter (const std::string &p, const Castable &value)
 Sets a single parameter.
 
template<class T >
void setParameter (const std::string &p, const VariableT< T > &value)
 
template<class F >
void setParameter (const std::string &p, const F &value)
 Sets a single parameter. More...
 
template<class F >
void setParameter (const std::string &p, std::initializer_list< F > value)
 Sets a single parameter.
 
BeanLikeoperator= (const BeanLike &b)
 
virtual std::ostream & toStream (std::ostream &ostr, bool compact=true) const
 
 BeanLike (const BeanLike &b)
 
 BeanLike (const std::string &name, const std::string &description="")
 
- Public Member Functions inherited from AccumulationConverter
virtual void encodeCount (double &weight) const
 Converts natural-scale data to storage data, applying marker codes if needed.
 
virtual void encodeStdDev (double &stdDev) const
 
double getNoDataMarker () const
 Returns the value when weight==0.0. Physically, this relates to results obtained under measurement accuracy.
 
virtual std::ostream & toOstr (std::ostream &ostr) const
 

Public Attributes

double defaultQuality
 If source data has no quality field, this value is applied for (detected) data.
 
double undetectValue
 Physical value applied in locations marked with undetect . This should be compatible with the quantity, say DBZH or RHOHV. More...
 
bool SKIP_UNDETECT
 
const ODIMdataODIM
 
const ODIMqualityODIM
 
ODIM defaultDataODIM
 
ODIM defaultQualityODIM
 
- Public Attributes inherited from AccumulationConverter
std::string type
 Default output storage data type.
 

Static Public Attributes

static double undetectQualityCoeff
 Quality, relative to data quality, applied in locations marked with undetect .
 

Protected Attributes

double minCodeValue
 In extraction (encoding), values lower than this value will be marked undetect .
 
double detectionThreshold
 A physical value greater than undetectValue. In \i encoding, lower values will be marked undetect . See init(). More...
 
- Protected Attributes inherited from BeanLike
const std::string name
 
const std::string description
 
ReferenceMap parameters
 

Additional Inherited Members

- Protected Member Functions inherited from BeanLike
virtual void storeLastArguments (const std::string &p)
 Called after setParameters()
 
virtual void updateBean () const
 Called after setParameters()
 

Detailed Description

Converts ODIM encoded data (with markers) to natural values and backwards.

Converts ODIM encoded data with nodata and undetect markers to natural values and backwards.

Note: typically one instance is used for either decoding or encoding, not both!

Member Function Documentation

◆ decode()

bool decode ( double &  value,
double &  weight 
) const
overridevirtual

Converts storage data containing marker codes etc to natural scale.

Note: handling undetect is decided outside, ie. if count > 0 but weight = 0. (In that case this function is probably not called.)

Reimplemented from AccumulationConverter.

◆ encode()

void encode ( double &  value,
double &  weight 
) const
overridevirtual

Converts natural-scale data to storage data containing marker codes etc.

Does not use weight...

Reimplemented from AccumulationConverter.

◆ init()

void init ( )

Creates a naive quality field: data=1.0, undetect/nodata=0.0.

 Class-specific extension, ie not inherited from base class.

void encodeDataToWeight(double value, double & weight) const;

Member Data Documentation

◆ detectionThreshold

double detectionThreshold
protected

A physical value greater than undetectValue. In \i encoding, lower values will be marked undetect . See init().

Remember to call init() if dataODIM has been changed.

◆ undetectValue

double undetectValue

Physical value applied in locations marked with undetect . This should be compatible with the quantity, say DBZH or RHOHV.

In decoding, if undetectWeight>0, data marked undetect will replaced with this value.

Remember to call init() if dataODIM has been changed.


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