Loading...
Searching...
No Matches
RainRateOp.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 RAINRATEOP_H_
32#define RAINRATEOP_H_
33
34//#include <algorithm>
35
36#include "radar/Precipitation.h"
37
38#include "PolarProductOp.h"
39
40
41namespace rack
42{
43
44using namespace drain::image;
45
47
48public:
49
50 FreezingLevel() : BeanLike(__FUNCTION__, "Freezing level modelled simply as its height and thickness."){
51 parameters.link("height", height = NAN, "km");
52 parameters.link("thickness", thickness = 0.1, "km");
53 }
54
55 virtual
57
58 double height;
59 double thickness;
60
61};
62
64
70class RainRateOp : public PolarProductOp {
71
72public:
73
74 static PrecipZrain precipZrain;
75 static PrecipZsnow precipZsnow;
76 static PrecipKDP precipKDP;
77 static PrecipKDPZDR precipKDPZDR;
78 static PrecipZZDR precipZZDR;
79
80 static FreezingLevel freezingLevel;
81
83
101 // TODO: freezinglevel as a polar pre-prod.
102 RainRateOp(double freezingLevel = 10.0, double freezingLevelThickness = 0.2, double z_ra=200.0, double z_rb=1.6, double z_sa=2000.0, double z_sb=2.0) :
103 PolarProductOp(__FUNCTION__, "Estimates precipitation rate [mm/h] from reflectance [dBZ].") {
104
105 dataSelector.setQuantities("^DBZH$");
106 dataSelector.setMaxCount(1);
107
108 odim.product = "SURF";
109 odim.quantity = "RATE";
110
111 odim.type = "S";
112 }
113
114
115protected:
116
117 virtual
118 void processData(const Data<PolarSrc> & srcData, Data<PolarDst> & dstData) const;
119
120};
121
122
123
124
125
126} // ::rack
127
128#endif /*RainRate_H_*/
129
130// Rack
Something which has a name, a description and possibly some parameters of varying type.
Definition BeanLike.h:60
void setQuantities(const std::string &s)
Sets basic quantities and quality quantities. These sets are separated by '/'.
Definition DataSelector.cpp:282
Data structure consisting of plain data and an optional quality data.
Definition Data.h:1146
Definition RainRateOp.h:46
Base class for flat (2D) products computed in the polar coordinate system. Volume is used as input.
Definition PolarProductOp.h:59
Definition Precipitation.h:274
Definition Precipitation.h:207
Definition Precipitation.h:239
Definition Precipitation.h:187
Definition Precipitation.h:196
MD odim
The default data parameters for encoding output (the product).
Definition RadarProductOp.h:101
Computes rain rate from dBZ.
Definition RainRateOp.h:70
RainRateOp(double freezingLevel=10.0, double freezingLevelThickness=0.2, double z_ra=200.0, double z_rb=1.6, double z_sa=2000.0, double z_sb=2.0)
Currently type and gain are not handled due to char<=> int mapping problem.
Definition RainRateOp.h:102
virtual void processData(const Data< PolarSrc > &srcData, Data< PolarDst > &dstData) const
Definition RainRateOp.cpp:61
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition DataSelector.cpp:44