![]() |
|
Converts HDF5 data to use desired data type, scaling and encoding (ODIM gain, offset, undetect and nodata values). More...
#include <DataConversionOp.h>


Public Types | |
| typedef SrcType< M const > | src_t |
| typedef DstType< M > | dst_t |
Public Types inherited from RadarProductOp< M, M > | |
| typedef SrcType< M const > | src_t |
| Type of input, that is, source. | |
| typedef DstType< M > | 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 Types inherited from BeanLike | |
| typedef ReferenceMap | map_t |
| Reference map type used to store this bean's parameters (name -> linked variable). | |
Public Member Functions | |
| DataConversionOp (const std::string &type="C", double gain=1.0, double offset=0.0, double undetect=0.0, double nodata=255.0, std::string copyGroupSuffix="") | |
| virtual void | processH5 (const Hi5Tree &src, Hi5Tree &dst) const |
| Ensures data to be in standard type and scaling. Makes a converted copy if needed. | |
| virtual void | processDataSet (const DataSet< src_t > &srcSweep, DataSet< dst_t > &dstProduct) const |
| void | processImage (const PlainData< src_t > &src, drain::image::Image &dst) const |
| void | processImage (const ODIM &odimSrc, const drain::image::ImageFrame &src, const ODIM &odimDst, drain::image::Image &dst) const |
| Converts src to dst such that dst applies desired gain, offset, undetect and nodata values. | |
| void | processImage2023 (const ODIM &srcOdim, const drain::image::ImageFrame &src, drain::image::Image &dst) const |
| void | traverseImageFrame (const ODIM &odimSrc, const drain::image::ImageFrame &src, const ODIM &odimDst, drain::image::ImageFrame &dst) const |
| void | setGeometry (const M &srcODIM, PlainData< dst_t > &dstData) const |
| Sets automagically the suitable dst parameters. | |
Public Member Functions inherited from RadarProductOp< M, M > | |
| RadarProductOp (const std::string &name, const std::string &description) | |
| Default constructor. | |
| RadarProductOp (const RadarProductOp &product) | |
| virtual const std::string & | getOutputQuantity (const std::string &inputQuantity="") const |
Returns the primary output quantity (ODIM what:quantity , like DBZH) | |
| 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). | |
| virtual void | processDataSet (const DataSet< src_t > &srcSweep, DataSet< DstType< M > > &dstProduct) const |
| Process the data of a single sweep and and write the result to given product. | |
| 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 DataSelector & | getDataSelector () const |
| Returns the data selector of this operator. | |
| DataSelector & | getDataSelector () |
| 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::ReferenceMap & | getAllowedEncoding () 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. | |
| 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 | |
| BeanLike (const BeanLike &b) | |
Copy constructor. Re-links parameters to the member variables of this (new) instance. | |
| BeanLike (const std::string &name, const std::string &description="") | |
| Constructor. | |
| 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 |
| Tells if any parameters have been linked (registered) for this bean. | |
| template<class F > | |
| F | getParameter (const std::string &p) const |
| Gets a single parameter. | |
| const map_t & | getParameters () const |
| Returns the parameter map (const access). | |
| map_t & | getParameters () |
| Returns the parameter map. | |
| template<class F > | |
| void | setParametersFromEntries (const F &args) |
| Sets several parameters at once from a sequence of key-value pairs. | |
| 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". | |
| 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. | |
| template<class F > | |
| void | setParameter (const std::string &p, std::initializer_list< F > value) |
| Sets a single parameter. | |
| BeanLike & | operator= (const BeanLike &b) |
| Assigns the parameter values of another bean (by key) to this one's own parameters. | |
| virtual std::ostream & | toStream (std::ostream &ostr, bool compact=true) const |
| Prints the name, description and current parameter values. | |
Static Public Member Functions | |
| static PlainData< DstType< M > > & | getNormalizedData (const DataSet< src_t > &srcDataSet, DataSet< dst_t > &dstDataSet, const std::string &quantity) |
Static Public Member Functions inherited from ProductBase | |
| static void | applyODIM (ODIM &productODIM, const ODIM &defaultODIM, bool useDefaults=false) |
| Modifies encoding. If type is changed, resets scaling first. | |
| static void | setRackVersion (drain::VariableMap &metadata) |
Protected Attributes | |
| std::string | copyGroupSuffix |
| Suffix for trailing path element ("/data") for storing the original. | |
Protected Attributes inherited from ProductBase | |
| std::string | lastArguments |
| drain::ReferenceMap | allowedEncoding |
| Defines which encoding parameters can be changed by the user from command line. | |
Protected Attributes inherited from BeanLike | |
| const std::string | name |
| Name of this bean, typically also the name of the (derived) class. | |
| const std::string | description |
| Brief, human-readable description of this bean. | |
| map_t | parameters |
| Parameters (name -> linked variable), typically linked to member variables of the derived class. | |
Additional Inherited Members | |
Public Attributes inherited from RadarProductOp< M, M > | |
| M | 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. | |
| ODIMPathElem | appendResultQuality = ODIMPathElem::DATA |
| OutputFlagger | outputDataVerbosity = DEFAULT |
Protected Member Functions inherited from RadarProductOp< M, M > | |
| virtual void | initDst (const M &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. | |
| void | setEncodingNEW (PlainData< dst_t > &dstData, const std::string &quantity="", const std::string &args="") const |
| Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product. | |
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() | |
Static Protected Member Functions inherited from ProductBase | |
| static void | setODIMspecials (ODIM &productODIM) |
| Sets target encoding. | |
Converts HDF5 data to use desired data type, scaling and encoding (ODIM gain, offset, undetect and nodata values).
| M | - ODIM type |
|
virtual |
SWAP & delete
Ensures data to be in standard type and scaling. Makes a converted copy if needed.
Converts src to dst such that dst applies desired gain, offset, undetect and nodata values.
The operator does not need groups sorted by elevation.
Reimplemented from RadarProductOp< M, M >.
| void processImage | ( | const ODIM & | odimSrc, |
| const drain::image::ImageFrame & | src, | ||
| const ODIM & | odimDst, | ||
| drain::image::Image & | dst | ||
| ) | const |
Converts src to dst such that dst applies desired gain, offset, undetect and nodata values.
Sometimes this is applied directly (for alpha channel ops).
|
inlinevirtual |
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
| srcODIM | - metadata of the incoming data |
| dstData | - the result (its metadata is sometimes partially set already). |
Default implementation as an empty function, because some operators like VerticalProfileOp will not use?
Implements RadarProductOp< M, M >.
| void traverseImageFrame | ( | const ODIM & | odimSrc, |
| const drain::image::ImageFrame & | src, | ||
| const ODIM & | odimDst, | ||
| drain::image::ImageFrame & | dst | ||
| ) | const |
Checks 'undetect' first because 'undetect' and 'nodata' may be the same code
1.9.8