![]() |
|
Registry for regular quantities appearing in weather radar. More...
#include <QuantityMap.h>
Public Types | |
typedef std::map< std::string, Quantity > | map_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 ... ? | |
QuantityMap & | operator= (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 Quantity & | get (const std::string &key) const |
Quantity & | get (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 Quantity & | DBZ |
const Quantity & | VRAD |
const Quantity & | ZDR |
const Quantity & | RHOHV |
const Quantity & | KDP |
const Quantity & | QIND |
const Quantity & | PROB |
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 .
QuantityMap | ( | const std::initializer_list< std::pair< std::string, Quantity > > & | inits | ) |
Constructor for ... ?
Constructor for init lists.
|
inline |
Checks if an exact match, without checking variants, is found.
|
inline |
Checks if an exact match or a variant, is found.
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.
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.
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.
quantity | - the quantity according to which the encoding will be set. |
values | - str values, comma-separated |
Use user-defined type. If not supplied, use default type.
find type conf for this Quantity and basetype
|
inline |
D | - data source type (PolarSrc, CartesianDst, ...) |
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 |