Loading...
Searching...
No Matches
EchoTopOpOld.h
1/*
2
3MIT License
4
5Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26/*
27Part of Rack development has been done in the BALTRAD projects part-financed
28by the European Union (European Regional Development Fund and European
29Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30*/
31#ifndef ECHOTOP2_OP_H_
32#define ECHOTOP2_OP_H_
33
34//#include <algorithm>
35//#include "RackOp.h"
36#include "CumulativeProductOp.h"
37
38namespace rack
39{
40
41using namespace drain::image;
42
43
46
47public:
48
49 EchoTopOpOld(bool top = true, double minDBZ = 20.0, double dbzRef = -50.0, double hRef = 15000.0, bool aboveSeaLevel=true) : //, const std::string & type="C", double gain=0.01, long int nbins=0, double rscale=0) :
50 CumulativeProductOp(__FUNCTION__, "Computes maximum (or minimum) altitude of echo.", "WAVG,8,1"), top(top) {
51
52 parameters.link("minDBZ", this->minDBZ = minDBZ, "dBZ");
53 parameters.link("dbzReference", this->dbzRef = dbzRef, "dBZ");
54 parameters.link("altitudeReference", this->hRef = hRef, "metres");
55 parameters.link("aboveSeaLevel", this->aboveSeaLevel = aboveSeaLevel, "false=radar site|true=sea level");
56
57 odim.product = "ETOP";
58 odim.quantity = "HGHT";
59 odim.type = "C";
60
61 dataSelector.setQuantities("^DBZH$");
62
63 };
64
65 virtual inline
66 const std::string & getOutputQuantity(const std::string & inputQuantity = "") const {
67 return odim.quantity;
68 }
69
70 double minDBZ;
71 double dbzRef; // = -50.0;
72 double hRef; // = 15000.0;
73
74 //bool aboveSeaLevel;
75
76 const bool top;
77
78
79
80protected:
81
82 virtual
83 void updateODIM(PolarODIM & odim) const {
84 // odim.prodpar = altitude // FAILS because prodpar is an std::string.
85 odim["what:prodpar"] = minDBZ;
86 };
87
88 //void processData(const Data<PolarSrc> & data, PolarAccumulator & accumulator) const;
89 void processData(const Data<PolarSrc> & data, RadarAccumulator<Accumulator,PolarODIM> & accumulator) const;
90
91};
92
93
94
95
96
97} // ::rack
98
99#endif /*POLARMax_H_*/
100
101// Rack
Base class for flat (2D) products computed in the polar coordinate system.
Definition CumulativeProductOp.h:59
void setQuantities(const std::string &s)
Sets basic quantities and quality quantities. These sets are separated by '/'.
Definition DataSelector.cpp:282
Height of echo exceeding a reflectivity threshold.
Definition EchoTopOpOld.h:45
void processData(const Data< PolarSrc > &data, RadarAccumulator< Accumulator, PolarODIM > &accumulator) const
Definition EchoTopOpOld.cpp:42
virtual const std::string & getOutputQuantity(const std::string &inputQuantity="") const
Returns the primary output quantity (ODIM what:quantity , like DBZH)
Definition EchoTopOpOld.h:66
Metadata structure for single-radar data (polar scans, volumes and products).
Definition PolarODIM.h:45
MD odim
The default data parameters for encoding output (the product).
Definition RadarProductOp.h:101
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition DataSelector.cpp:44