38#ifndef RACK_PRODUCT_OP
39#define RACK_PRODUCT_OP "ProductOP"
49#include <drain/RegExp.h>
50#include <drain/util/SmartMap.h>
51#include <drain/util/TreeOrdered.h>
54#include "data/DataSelector.h"
56#include "data/ODIMPath.h"
57#include "data/ODIMPathTools.h"
58#include "data/QuantityMap.h"
65#include "ProductBase.h"
77template <
class MS,
class MD>
97 std::cerr <<
'#' <<
__FUNCTION__ <<
" copy ct " << product.
getName() << this->dataSelector <<
'\n';
117 if (!
odim.quantity.empty())
118 return odim.quantity;
250template <
class MS,
class MD>
255 if (
dstData.odim.quantity.empty()){
256 dstData.odim.quantity = quantity;
265 const std::string &
qty = quantity.empty() ?
dstData.odim.quantity : quantity;
268 mout.warn(
"No quantity in metadata or as argument" );
285 dstData.data.setScaling(odim.scaling);
314 // dst.odim.product = odim.product; ?
322template <
class MS,
class MD>
327 dst.odim.completeEncoding( this->targetEncoding);
334 dst.data.setScaling(dst.odim.scaling);
340template <
class MS,
class MD>
347 mout.note(getName(),
':', *
this);
348 mout.debug2(
"DataSelector: ", this->dataSelector);
355 mout.debug3(
"collect the applicable paths");
364 this->dataSelector.getPaths(src,
dataPaths);
365 mout.debug3(
"populate the dataset map, paths=" ,
dataPaths.size() );
369 mout.experimental(
"adding: " , index ,
'\t' , path);
405 mout.note(
"Copying: ", key);
406 mout.unimplemented(
"consider and test .data.attributes instead");
431 dst[
"what"].data.attributes[
"object"] = this->odim.object;
432 dstProduct[
"what"].data.attributes[
"product"] = odim.product;
433 dstProduct[
"what"].data.attributes[
"prodpar"] = odim.prodpar;
435 ProductBase::setRackVersion(
dstProduct[
"how"].data.attributes);
442template <
class MS,
class MD>
446 mout.debug3(
"start" );
449 mout.warn(
"no data" );
452 for (
const auto & entry: src) {
453 mout.debug3(
"calling processDataSet for elev=", entry.first,
" #datasets=", entry.second.size());
468template <
class MS,
class MD>
474 mout.debug(
"start" );
478 mout.debug(
"target quantity: " , odim.quantity );
481 const std::string & quantity = !odim.quantity.empty() ? odim.quantity :
srcData.odim.quantity;
483 dstData.odim.quantity = quantity;
const std::string description
Brief, human-readable description of this bean.
Definition BeanLike.h:309
virtual const std::string & getName() const
Return the name of an instance.
Definition BeanLike.h:89
const std::string name
Name of this bean, typically also the name of the (derived) class.
Definition BeanLike.h:306
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition Log.h:326
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1293
DOC: Add class description.
Definition ODIMPath.h:82
static const group_t WHAT
Metadata group /what , at any depth.
Definition ODIMPath.h:127
static const group_t DATASET
First level group, /dataset + digit .
Definition ODIMPath.h:106
static const group_t HOW
Metadata group /how , at any depth.
Definition ODIMPath.h:133
static const group_t DATA
Second level group, /data + digit .
Definition ODIMPath.h:109
static const group_t WHERE
Metadata group /where , at any depth.
Definition ODIMPath.h:130
ODIM metadata (quantity, gain, offset, undetect, nodata, date, time)
Definition ODIM.h:79
Base class for radar data processors. Input can be in polar or Cartesian coordinates.
Definition ProductBase.h:82
static void applyODIM(ODIM &productODIM, const ODIM &defaultODIM, bool useDefaults=false)
Modifies encoding. If type is changed, resets scaling first.
Definition ProductBase.cpp:120
ODIMPathElem appendResults
If set, appends outputs in an hdf5 structure instead of overwriting.
Definition ProductConf.h:92
Registry for regular quantities appearing in weather radar.
Definition QuantityMap.h:67
Polar and Cartesian products.
Definition RadarProductOp.h:78
DstType< MD > dst_t
Type of output, that is, destination.
Definition RadarProductOp.h:86
virtual void processH5(const Hi5Tree &src, Hi5Tree &dst) const
Definition RadarProductOp.h:341
SrcType< MS const > src_t
Type of input, that is, source.
Definition RadarProductOp.h:83
RadarProductOp(const std::string &name, const std::string &description)
Default constructor.
Definition RadarProductOp.h:91
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.
Definition RadarProductOp.h:251
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...
Definition RadarProductOp.h:443
virtual void setEncoding(const ODIM &srcODIM, PlainData< dst_t > &dstData) const
Sets applicable encoding parametes (type, gain, offset, undetect, nodata) for this product.
Definition RadarProductOp.h:323
MD odim
The default data parameters for encoding output (the product).
Definition RadarProductOp.h:101
virtual const std::string & getOutputQuantity(const std::string &inputQuantity="") const
Returns the primary output quantity (ODIM what:quantity , like DBZH)
Definition RadarProductOp.h:116
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.
Definition RadarProductOp.h:469
virtual void initDst(const MS &srcODIM, PlainData< dst_t > &dstData) const
initialises dst data by setting suitable ODIM metadata and geometry.
Definition RadarProductOp.h:176
virtual void setGeometry(const MS &srcODIM, PlainData< dst_t > &dstData) const =0
Sets automagically the suitable dst parameters.
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition AltitudeOp.cpp:42
QuantityMap & getQuantityMap()
Definition QuantityMap.cpp:282