Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
ProductOp< MS, MD > Class Template Referenceabstract

Polar and Cartesian products. More...

#include <ProductOp.h>

Inheritance diagram for ProductOp< MS, MD >:
Inheritance graph
[legend]
Collaboration diagram for ProductOp< MS, MD >:
Collaboration graph
[legend]

Public Types

typedef SrcType< MS const > src_t
 Type of input, that is, source.
 
typedef DstType< MD > dst_t
 Type of output, that is, destination.
 
- Public Types inherited from ProductConf
enum  OutputDataVerbosity { DEFAULT =0 , INTERMEDIATE =1 , DEBUG =2 , QUALITY =4 }
 Determines if also intermediate results (1) are saved. See –store.
 
typedef drain::EnumFlagger< drain::MultiFlagger< OutputDataVerbosity > > OutputFlagger
 

Public Member Functions

 ProductOp (const std::string &name, const std::string &description)
 Default constructor.
 
 ProductOp (const ProductOp &product)
 
virtual const std::string & getOutputQuantity (const std::string &inputQuantity="") const
 Returns the primary output quantity (ODIM what:quantity , like DBZH) More...
 
virtual void processH5 (const Hi5Tree &src, Hi5Tree &dst) const
 
virtual void computeSingleProduct (const DataSetMap< src_t > &srcSweeps, DataSet< dst_t > &dstProduct) const
 Traverse the data applicable for this product and create new, processed data (volume or polar product). More...
 
virtual void processDataSet (const DataSet< src_t > &srcSweep, DataSet< DstType< MD > > &dstProduct) const
 Process the data of a single sweep and and write the result to given product. More...
 
virtual void processData (const Data< src_t > &srcData, Data< dst_t > &dstData) const
 
- Public Member Functions inherited from ProductBase
const std::string & getLastArguments () const
 
virtual ~ProductBase ()
 Destructor.
 
void setDataSelector (const DataSelector &selector)
 Copies the conditions of another selector.
 
const DataSelectorgetDataSelector () const
 Returns the data selector of this operator.
 
DataSelectorgetDataSelector ()
 Returns the data selector of this operator.
 
void help (std::ostream &ostr=std::cout, bool showDescription=true) const
 Dumps the help of this operator.
 
const drain::ReferenceMapgetAllowedEncoding () const
 Returns a map of encoding parameters that can be changed by the user.
 
virtual void setEncodingRequest (const std::string &p)
 Set encoding parameters for the result: type,gain,offset,undetect,nodata. More...
 
void setAllowedEncoding (const std::string &keys)
 
- Public Member Functions inherited from ProductConf
 ProductConf ()
 Default constructor.
 
 ProductConf (const ProductConf &conf)
 Copy constructor.
 
- 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 Attributes

MD odim
 The default data parameters for encoding output (the product).
 
- Public Attributes inherited from ProductConf
DataSelector dataSelector
 
std::string targetEncoding
 How the (main) output is encoded.
 
ODIMPathElem appendResults
 If set, appends outputs in an hdf5 structure instead of overwriting. More...
 
OutputFlagger outputDataVerbosity = DEFAULT
 

Protected Member Functions

virtual void setGeometry (const MS &srcODIM, PlainData< dst_t > &dstData) const =0
 Sets automagically the suitable dst parameters. More...
 
virtual void initDst (const MS &srcODIM, PlainData< dst_t > &dstData) const
 initialises dst data by setting suitable ODIM metadata and geometry.
 
virtual void setEncoding (const ODIM &srcODIM, PlainData< dst_t > &dstData) const
 Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product. More...
 
void setEncodingNEW (PlainData< dst_t > &dstData, const std::string quantity="", const std::string type="") const
 Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product. More...
 
- Protected Member Functions inherited from ProductBase
 ProductBase (const std::string &name, const std::string &description)
 Default constructor.
 
 ProductBase (const ProductBase &product)
 
void storeLastArguments (const std::string &p) override
 Called after setParameters()
 
- Protected Member Functions inherited from BeanLike
virtual void updateBean () const
 Called after setParameters()
 

Additional Inherited Members

- Static Public Member Functions inherited from ProductBase
static void completeEncoding (ODIM &productODIM, const std::string &targetEncoding)
 Modifies encoding. If type is changed, resets scaling first. More...
 
static void applyODIM (ODIM &productODIM, const ODIM &srcODIM, bool applyDefaults=false)
 Sets target quantity and encoding, if unset. If input odim. More...
 
static void setRackVersion (drain::VariableMap &metadata)
 
- Static Protected Member Functions inherited from ProductBase
static void setODIMspecials (ODIM &productODIM)
 Sets target encoding.
 
- Protected Attributes inherited from ProductBase
std::string lastArguments
 
drain::ReferenceMap allowedEncoding
 Defines which encoding parameters can be changed by the user from command line. More...
 
- Protected Attributes inherited from BeanLike
const std::string name
 
const std::string description
 
ReferenceMap parameters
 

Detailed Description

template<class MS, class MD>
class rack::ProductOp< MS, MD >

Polar and Cartesian products.

Template Parameters
MS- input (source) metadata type: PolarODIM or CartesianODIM.
MD- output (destination) metadata type: PolarODIM or CartesianODIM.

Member Function Documentation

◆ computeSingleProduct()

void computeSingleProduct ( const DataSetMap< src_t > &  srcSweeps,
DataSet< dst_t > &  dstProduct 
) const
virtual

Traverse the data applicable for this product and create new, processed data (volume or polar product).

The input data is stored in SweepMapSrc, as Map indexed with elevation angles, containing sweep data

  • typically reflectivity data (DBZH) but generally any parameter measured by radar. The applicable data is set by selector.quantity, typically in the constructor of a derived class.

Pick main product data and assign (modified) odim data

◆ getOutputQuantity()

virtual const std::string& getOutputQuantity ( const std::string &  inputQuantity = "") const
inlinevirtual

Returns the primary output quantity (ODIM what:quantity , like DBZH)

The ODIM quantity of this product

Parameters
defaultQuantity- input quantity or a quantity overriding default output quantity of this product

◆ processDataSet()

void processDataSet ( const DataSet< src_t > &  srcSweep,
DataSet< DstType< MD > > &  dstProduct 
) const
virtual

Process the data of a single sweep and and write the result to given product.

Notice:

  • several product data arrays may be generated
  • also quality field(s) may be added
  • overwriting original data may occur, if input data (src) is also given as output (dst); this is desired action esp. in anomaly removal

◆ processH5()

void processH5 ( const Hi5Tree &  src,
Hi5Tree &  dst 
) const
virtual

Usually, the operator does not need groups sorted by elevation.

Main operation

◆ setEncoding()

void setEncoding ( const ODIM srcODIM,
PlainData< dst_t > &  dstData 
) const
protectedvirtual

Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product.

Determines output encoding based on

  • output data (parameters already set in dstData)
  • this->odim (values set in constructor and targetEncoding)
  • targetEncoding
See also
setGeometry Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product. Determines output encoding based on
  • input data (srcODIM)
  • output data (parameters already set in dstData)
  • this->odim (values set in constructor and targetEncoding)
  • targetEncoding
setGeometry

This applies always.

◆ setEncodingNEW()

void setEncodingNEW ( PlainData< dst_t > &  dstData,
const std::string  quantity = "",
const std::string  type = "" 
) const
protected

Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product.

Determines output encoding based on

  • output data (parameters already set in dstData)
  • this->odim (values set in constructor and targetEncoding)
  • targetEncoding
See also
setGeometry
Parameters
quantity- if given, applied as a "template", standard quantity to be copied; also odim.type, if empty, is set.
type- if given, odim.type is always changed
quantity- if given, applied as a "template", standard quantity to be copied; also odim.type, if empty, is set.
type- if given, odim.type is always changed

This applies always.

◆ setGeometry()

virtual void setGeometry ( const MS &  srcODIM,
PlainData< dst_t > &  dstData 
) const
protectedpure virtual

Sets automagically the suitable dst parameters.

Derives geometry for the resulting dst from three sources of parameters: the implicit operator parameters this->odim and the two function parameters

Parameters
srcODIM- metadata of the incoming data
dstODIM- metadata of the result (sometimes partially set).

Default implementation as an empty function, because some operators like VerticalProfileOp will not use?


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