Loading...
Searching...
No Matches
ConvOp.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
32#ifndef POLARCB_H_
33#define POLARCB_H_
34
35#include <algorithm>
36#include "radar/Geometry.h"
37
38//#include "RackOp.h"
39#include "PolarProductOp.h"
40
41namespace rack
42{
43
44using namespace drain::image;
45
46
47
49
52class ConvOp : public PolarProductOp {
53
54public:
55
57
64 /* EI KÄYTÖSSÄ \subsection alg_Cb
65 *
66 * Radar measurement is sparse; the dBZ threshold lies seldom at the beam but more often between two beams or outside all the beams.
67 * In computing the
68 *
69 * - (a) Between lower and higher dBZ: the height is interpolated
70 * - (b) Under \c undetect and above higher dBZ: the height is interpolated, assuming reference measurement \f$ (z_{r},h_{r}) \f$
71 * - (c) Above two highest beams, which have higher, decreasing dBZ values : the height is extrapolated
72 * - (d) Above two highest beams, which have higher, increasing dBZ values : the height is extrapolated; lower quality is assigned
73 * - (e) Above higher dBZ and \undetect measurement : the height is extrapolated; lower quality is assigned
74 *
75 * \image html Cb-principle.png "The location of the dBZ threshold with respect to measurements on the beam."
76 * \image latex Cb-principle.png "The location of the dBZ threshold with respect to measurements on the beam."
77 *
78 */
80
112 //
113 ConvOp(double maxEchoThreshold = 25.0, double cellDiameter = 3.0, double echoTopThreshold = 2.0, double echoTopDBZ = 20.0, double smoothRad = 0.0, double smoothAzm = 0.0) :
114 PolarProductOp(__FUNCTION__, "Computes the probability of convection based on fuzzy cell intensity, area and height."), top(true) {
115
116 parameters.link("maxEchoThreshold", this->maxEchoThreshold = maxEchoThreshold, "dBZ");
117 parameters.link("cellDiameter", this->cellDiameter = cellDiameter, "km");
118 parameters.link("echoTopThreshold", this->echoTopThreshold = echoTopThreshold, "km");
119 parameters.link("echoTopDBZ", this->echoTopDBZ = echoTopDBZ, "dBZ");
120
121 parameters.link("smoothAzm", this->smoothAzm = smoothAzm, "deg");
122 parameters.link("smoothRad", this->smoothRad = smoothRad, "km");
123
124 allowedEncoding.link("nbins", odim.area.width = 0l);
125 allowedEncoding.link("rscale", odim.rscale = 0.0);
126
127
128 allowedEncoding.link("undetect", odim.undetect = 0.0);
129 allowedEncoding.link("nodata", odim.nodata = 0.0);
130
131 dataSelector.setQuantities("^DBZH$");
132
133 odim.product = "CONVECTION";
134 odim.quantity = "PROB";
135 //odim.scaling.scale = 1.0/250.0;
136 //odim.scaling.offset = 0;
137 };
138
139
140
141
142 double maxEchoThreshold;
143 double echoTopDBZ;
144 double cellDiameter;
145 double echoTopThreshold;
146
147 double smoothAzm;
148 double smoothRad;
149
150 const bool top;
151
152protected:
153
155 // virtual
156 // void filter(const Hi5Tree & src, const std::map<double,std::string> & srcPaths, Hi5Tree &dst) const;
157
158
159};
160
161
162
163
164
165} // ::rack
166
167#endif /*POLARCbTOP_H_*/
168
169// Rack
map_t parameters
Parameters (name -> linked variable), typically linked to member variables of the derived class.
Definition BeanLike.h:313
Computes Cb s or bottoms in kilometers for a given dBZ threshold, typically 20, 40 or 45 dBZ.
Definition ConvOp.h:52
ConvOp(double maxEchoThreshold=25.0, double cellDiameter=3.0, double echoTopThreshold=2.0, double echoTopDBZ=20.0, double smoothRad=0.0, double smoothAzm=0.0)
Currently type and gain are not handled due to char<=> int mapping problem.
Definition ConvOp.h:113
void computeSingleProduct(const DataSetMap< PolarSrc > &srcSweeps, DataSet< PolarDst > &dstProduct) const
Definition ConvOp.cpp:66
void setQuantities(const std::string &s)
Sets basic quantities and quality quantities. These sets are separated by '/'.
Definition DataSelector.cpp:299
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1293
Base class for flat (2D) products computed in the polar coordinate system. Volume is used as input.
Definition PolarProductOp.h:59
drain::ReferenceMap allowedEncoding
Defines which encoding parameters can be changed by the user from command line.
Definition ProductBase.h:206
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 AltitudeOp.cpp:42