Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
DataTools Class Reference

Tool for selecting datasets based on paths, quantities and min/max elevations. More...

#include <DataTools.h>

Public Types

typedef std::map< std::string, ODIMPathElem > quantity_map
 

Static Public Member Functions

static TreeFileInfo & getTreeFileInfo ()
 
template<class M >
static void getAttributes (const Hi5Tree &src, const Hi5Tree::path_t &path, M &attributes, bool updateOnly=false)
 Traverses upward in hierachy to find the value of the given PolarODIM where, what, or how attribute.
 
static void getQuantityMap (const Hi5Tree &srcDataset, ODIMPathElemMap &m)
 
static void updateInternalAttributes (Hi5Tree &src)
 Copies values of what , where and how attributes to internal attributes down to data[n] groups.
 
static void updateInternalAttributes (const Hi5Tree &)
 This const version does nothing, but is needed for Data:: #supdateTree3()
 
static void updateCoordinatePolicy (Hi5Tree &src, const drain::image::CoordinatePolicy &policy=drain::image::CoordinatePolicy(drain::image::EdgePolicy::LIMIT))
 
static int getMaxRange (const Hi5Tree &src, bool projected=true)
 
static void superDump (const Hi5Tree &src, std::ostream &ostr=std::cerr)
 Tree output designed above all for debugging.
 
static void adjustWhatObject (Hi5Tree &src)
 If polar data contains single or several elevations, mark SCAN or PVOL, respectively.
 
static bool treeToStream (const Hi5Tree::node_data_t &data, std::ostream &ostr)
 (Un)mark groups along a path for deletion by Hi5Base::deleteExcluded()
 
static drain::VariableMap & getAttributeStyles ()
 List of most important ODIM attributes (with style suggestion).
 

Static Protected Member Functions

static void updateInternalAttributes (Hi5Tree &src, const drain::FlexVariableMap &attributes)
 Removes the children of the tree if Node::exclude is set.
 

Detailed Description

Tool for selecting datasets based on paths, quantities and min/max elevations.

Applies drain::RegExp in matching.

Member Function Documentation

◆ getAttributes()

template<class M >
void getAttributes ( const Hi5Tree &  src,
const Hi5Tree::path_t &  path,
M &  attributes,
bool  updateOnly = false 
)
static

Traverses upward in hierachy to find the value of the given PolarODIM where, what, or how attribute.

Parameters
src- structure to be searched
path- starting path, to be continued upwards Collects PolarODIM /where, /what and /how attributes recursively along the path and stores them in a std::map<std::string,T> (e.g. VariableMap or ReferenceMap, ODIM). Does not change attributes of src.
See also
updateAttributes()

◆ getMaxRange()

int getMaxRange ( const Hi5Tree &  src,
bool  projected = true 
)
static

Future option: limit elevation angle range.

◆ treeToStream()

bool treeToStream ( const Hi5Tree::node_data_t &  data,
std::ostream &  ostr 
)
static

(Un)mark groups along a path for deletion by Hi5Base::deleteExcluded()

Tree attribute formatter Applied by drain::TreeUtils::dump(). Example:

drain::TreeUtils::dump(ctx.getHi5(RackContext::CURRENT), output, DataTools::treeToStream);
Output utility. Opens stdout with "-". Closes upon destruction.
Definition Output.h:55
static bool dump(const TR &tree, std::ostream &ostr=std::cout, bool(*callBack)(const typename TR::node_data_t &, std::ostream &)=TreeUtils::dataDumper, const std::string &indent="")
Render a tree using character graphics.
Definition TreeUtils.h:153
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1293
static bool treeToStream(const Hi5Tree::node_data_t &data, std::ostream &ostr)
(Un)mark groups along a path for deletion by Hi5Base::deleteExcluded()
Definition DataTools.cpp:222
Returns
– true, if data is empty, ie. no attributes or data array.

◆ updateInternalAttributes() [1/3]

static void updateInternalAttributes ( const Hi5Tree &  )
inlinestatic

This const version does nothing, but is needed for Data:: #supdateTree3()

See also
updateAttributes(Hi5Tree & src, const drain::FlexVariableMap & attributes)

◆ updateInternalAttributes() [2/3]

void updateInternalAttributes ( Hi5Tree &  src)
static

Copies values of what , where and how attributes to internal attributes down to data[n] groups.

Traverses the data tree, updates the data (image) attributes along the path down to data[n] level; the lowest groups containing data arrays, that is data groups, are not updated.

Note that also the coordinate policy is updated, because the corresponding variable is linked by ImageFrame::init().

Typically, this is called on the root.

See also
updateAttributes(Hi5Tree & src, const drain::FlexVariableMap & attributes)

◆ updateInternalAttributes() [3/3]

void updateInternalAttributes ( Hi5Tree &  src,
const drain::FlexVariableMap &  attributes 
)
staticprotected

Removes the children of the tree if Node::exclude is set.

\return - true if children were removed

static bool removeIfExcluded_REMOVE(Hi5Tree & dst); Does nothing

\return - false (always, as nothing will be removed)

static bool removeIfExcluded(const Hi5Tree & src){ return false; }; Copies values of what , where and how attributes to internal attributes down to data[n] groups. Traverses the data tree, updates the data (image) attributes along the path down to data[n] level; the lowest groups containing data arrays, that is data groups, are not updated.

Note that also the coordinate policy is updated, because the corresponding variable is linked by ImageFrame::init().

Typically, this is called on the root.

See also
updateAttributes(Hi5Tree & src)

Write to "hidden" variables of this node (src).

Step 1: collect local values of /what, /where, and /how groups, overwriting attributes initialised to parent values.


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