Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
QuantityMap Class Reference

Registry for regular quantities appearing in weather radar. More...

#include <QuantityMap.h>

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

Public Types

typedef std::map< std::string, Quantitymap_t
 

Public Member Functions

 QuantityMap ()
 Default constructor.
 
 QuantityMap (const QuantityMap &m)
 Copy constructor.
 
 QuantityMap (const std::initializer_list< std::pair< std::string, Quantity > > &inits)
 Constructor for ... ?
 
QuantityMapoperator= (const std::initializer_list< std::pair< std::string, Quantity > > &inits)
 
void assign (const std::initializer_list< std::pair< std::string, Quantity > > &inits)
 
bool hasKey (const std::string &key) const
 Checks if an exact match, without checking variants, is found.
 
bool hasQuantity (const std::string &key) const
 Checks if an exact match or a variant, is found.
 
iterator retrieve (const std::string &key)
 Tries to find a quantity, first by exact match, or then among variants.
 
const_iterator retrieve (const std::string &key) const
 Tries to find a quantity, first by exact match, or then among variants.
 
const Quantityget (const std::string &key) const
 
Quantityget (const std::string &key)
 
bool setQuantityDefaults (EncodingODIM &dst, const std::string &quantity, const std::string &values="") const
 Sets default values of given quantity without assigning the quantity. Optionally overrides with user values.
 
bool setQuantityDefaults (ODIM &dst) const
 
template<class D >
bool setQuantityDefaults (PlainData< D > &dstData, const std::string &quantity="", const std::string &values="") const
 
template<class M >
bool isNormalized (const M odim) const
 Checks if data.
 
std::ostream & toStream (std::ostream &ostr) const
 Output.
 

Public Attributes

const QuantityDBZ
 
const QuantityVRAD
 
const QuantityZDR
 
const QuantityRHOHV
 
const QuantityKDP
 
const QuantityQIND
 
const QuantityPROB
 

Detailed Description

Registry for regular quantities appearing in weather radar.

In the map, each entry is a rack::Quantity, providing a short description and default encoding.

Also variants of similar quantities are supported. Practically, the quantities are stored primarily by a general name in uppercase letters (like "DBZ"). If a quantity is queried with the general name, it is found directly with that map key.

If a similar quantity (like "TH") or a related specific quantity (like "DBZHCX") is searched for, then an additional, deeper search uses direct string matching and regular expressions and finds the main entry (in this case, that stored with key "DBZ").

In this context, by similar or related we mean quantities that are physically related and should use similar encodings and palettes. Consequently, as a convention, default palettes of regular quantities can be automatically associated with related, similar quantities automatically through rack::QuantityMap .

Constructor & Destructor Documentation

◆ QuantityMap()

QuantityMap ( const std::initializer_list< std::pair< std::string, Quantity > > &  inits)

Constructor for ... ?

Constructor for init lists.

Member Function Documentation

◆ hasKey()

bool hasKey ( const std::string &  key) const
inline

Checks if an exact match, without checking variants, is found.

See also
hasQuantity()

◆ hasQuantity()

bool hasQuantity ( const std::string &  key) const
inline

Checks if an exact match or a variant, is found.

See also
hasKey()

◆ retrieve() [1/2]

QuantityMap::iterator retrieve ( const std::string &  key)

Tries to find a quantity, first by exact match, or then among variants.

First, uses map_t::find(). If a match is found, iterator pointing to it is returned. If not, the map is revisited and all the variants are tested as well.

Returns
- a valid iterator or map_t::end()

◆ retrieve() [2/2]

QuantityMap::const_iterator retrieve ( const std::string &  key) const

Tries to find a quantity, first by exact match, or then among variants.

First, uses map_t::find(). If a match is found, iterator pointing to it is returned. If not, the map is revisited and all the variants are tested as well.

Returns
- a valid iterator or map_t::end()

◆ setQuantityDefaults() [1/2]

bool setQuantityDefaults ( EncodingODIM dst,
const std::string &  quantity,
const std::string &  values = "" 
) const

Sets default values of given quantity without assigning the quantity. Optionally overrides with user values.

Parameters
quantity- the quantity according to which the encoding will be set.
values- str values, comma-separated
Returns
- true, if type could be set / derived

Use user-defined type. If not supplied, use default type.

find type conf for this Quantity and basetype

◆ setQuantityDefaults() [2/2]

template<class D >
bool setQuantityDefaults ( PlainData< D > &  dstData,
const std::string &  quantity = "",
const std::string &  values = "" 
) const
inline
Template Parameters
D- data source type (PolarSrc, CartesianDst, ...)
Parameters
quantity- the quantity according to which the encoding will be set; if empty, current quantity will be used
values- comma-separated settings to override default values
Returns
- true, if type could be set / derived

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