Loading...
Searching...
No Matches
PseudoRhiOp.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 PseudoRhiOP_OP_H_
33#define PseudoRhiOP_OP_H_
34
35#include <string>
36
37#include "data/Data.h"
38#include "data/DataSelector.h"
39#include "data/PolarODIM.h"
40#include "data/VerticalODIM.h"
41#include "product/VolumeOp.h"
42
43namespace rack {
44
45using namespace drain::image;
46
48
51class PseudoRhiOp : public VolumeOp<RhiODIM> { // Consider class lift
52public:
53
54 //PseudoRhiOp(const std::string & name = "PolarProductOp", const std::string & description = "");
55 PseudoRhiOp(double az_angle=0.0, long int xsize=500, long int ysize=250, double minRange=1.0, double range=250.0,
56 double minHeight=0, double maxHeight=10000, double beamWidth = 0.25, double beamPowerThreshold = 0.01) : //, std::string type="C", double gain=0.5, double offset=-32.0) :
57 VolumeOp<RhiODIM>("PseudoRhiOp","Computes vertical intersection in a volume in the beam direction.") {
58
59 odim.object = "XSEC";
60 odim.product = "PRHI";
61
62 parameters.link("az_angle", odim.az_angle = az_angle, "deg");
63 parameters.link("xsize", odim.area.width = xsize, "pix");
64 parameters.link("ysize", odim.area.height = ysize, "pix");
65
66 odim.range.set(minRange, range);
67 parameters.link("range", odim.range.tuple(), "km");
68
69 odim.altitudeRange.set(minHeight, maxHeight);
70 parameters.link("height", odim.altitudeRange.tuple(), "m" );
71
72 /*
73 parameters.link("minRange", odim.minRange = minRange, "km");
74 parameters.link("range", odim.range = range, "km");
75 parameters.link("minHeight", odim.minheight = minHeight, "m");
76 parameters.link("maxHeight", odim.maxheight = maxHeight, "m");
77 */
78 //link("levels", odim.levels, levels);
79
80 parameters.link("beamWidth", this->beamWidth = beamWidth, "deg");
81 parameters.link("beamPowerThreshold", this->weightThreshold = beamPowerThreshold, "0..1");
82
83 // link("undetectValue", undetectValue, -30.0); AUTOMATIC, see --quantity DBZH:undetectValue
84 //link("type", odim.type, "C"); // TODO
85 //link("gain", odim.scaling.scale, 0.5);
86 //link("offset", odim.scaling.offset, -32.0);
87
88 allowedEncoding.link("type", odim.type = "C"); // TODO: automatic?
89 allowedEncoding.link("gain", odim.scaling.scale);
90 allowedEncoding.link("offset", odim.scaling.offset);
91
92 dataSelector.setQuantities("^DBZH$");
93
94 }
95
96 virtual
97 inline
98 ~PseudoRhiOp(){};
99
100
101 double beamWidth;
102 double weightThreshold; // = 0.1;
103 // double undetectValue;
104
106 virtual
107 void computeSingleProduct(const DataSetMap<PolarSrc> & src, DataSet<RhiDst> & dstProduct) const;
108
109protected:
110
111 inline
112 void setGeometry(const PolarODIM & srcODIM, PlainData<RhiDst> & dstData) const;
114
118 inline
119 static
120 double relativeBeamPower(double angle, double beamWidth2){
121 return beamWidth2 / (beamWidth2 + angle*angle);
122 }
123
124
125};
126
127
128} // namespace rack
129
130#endif /* RACKOP_H_ */
131
132// Rack
void setQuantities(const std::string &s)
Sets basic quantities and quality quantities. These sets are separated by '/'.
Definition DataSelector.cpp:282
Definition Data.h:1370
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1215
Essential class for storing radar data.
Definition Data.h:300
Metadata structure for single-radar data (polar scans, volumes and products).
Definition PolarODIM.h:45
drain::ReferenceMap allowedEncoding
Defines which encoding parameters can be changed by the user from command line.
Definition ProductBase.h:205
Pseudo Range-Height indicator.
Definition PseudoRhiOp.h:51
virtual void computeSingleProduct(const DataSetMap< PolarSrc > &src, DataSet< RhiDst > &dstProduct) const
Implements VolumeOp::filter.
Definition PseudoRhiOp.cpp:77
static double relativeBeamPower(double angle, double beamWidth2)
Definition PseudoRhiOp.h:120
MD odim
The default data parameters for encoding output (the product).
Definition RadarProductOp.h:101
Base class for radar data processors.
Definition VolumeOp.h:88
Namespace for images and image processing tools.
Definition AccumulationArray.cpp:45
Definition DataSelector.cpp:44