Loading...
Searching...
No Matches
VerticalODIM.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 Vertical_ODIM
32#define Vertical_ODIM
33
34#include <cmath>
35//#include <drain/util/Options.h>
36#include <drain/util/ReferenceMap.h>
37
38
39#include "hi5/Hi5.h"
40
41#include "ODIM.h"
42
43namespace rack {
44
45
46
53public:
54
55 // Notice: these are also in CartesianODIM
56
58 //long xsize;
59 int64_t xsize; // Recommended by ODIM. Here a compiler test...
60
62 long ysize;
63
64
66 double xscale;
67
69 double yscale;
70
74 //double minheight;
75
77 //double maxheight;
78
80 double NI;
81
83 inline
84 VerticalCrossSectionODIM(group_t initialize =ODIMPathElem::ALL_LEVELS) : ODIM(initialize) {
85 init(initialize);
86 };
87
90 initFromMap(odim);
91 };
92
93 inline
94 void setGeometry(size_t cols, size_t rows){
95 xsize = cols;
96 ysize = rows;
97 }
98
99protected:
100
101 virtual
102 void init(group_t initialize =ODIMPathElem::ALL_LEVELS);
103
104};
105
106
107class VerticalProfileODIM : public VerticalCrossSectionODIM { // TODO VerticalODIM as a base, without xsize,ysize etc.
108public:
109
110 // where (radar site)
111 double lon;
112 double lat;
113 //double height;
114
115 // where (profile)
116 long int levels;
117 double interval;
118 //double minRange;
119 //double range; // was 'maxRange', should be 'range'
120 drain::Range<double> distanceRange;
121
122 // where
123 drain::Range<double> azmRange;
124 //double startaz; // non-stardard for profile
125 //double stopaz; // non-stardard for profile
126 long int azSlots = 0; // non-stardard
127
128
130 inline
132 init(initialize);
133 }
134
136 inline
138 initFromMap(odim);
139 }
140
142 template <class T>
143 VerticalProfileODIM(const std::map<std::string,T> & m){
144 initFromMap(m);
145 }
146
148 VerticalProfileODIM(const drain::image::Image & img, const std::string & quantity=""){
149 initFromImage(img, quantity);
150 }
151
152protected:
153
154 virtual
155 void init(group_t initialize =ODIMPathElem::ALL_LEVELS);
156
157};
158
159
161public:
162
163 // where (radar site)
164 double lon = std::numeric_limits<double>::signaling_NaN();
165 double lat = std::numeric_limits<double>::signaling_NaN();
166
167 //double height;
168
169 // where
170 double az_angle = 0.0; // non-stardard for profile
171 // double angles; // non-stardard for profile
172
173
174 //long int azSlots; // non-stardard
176 //double minRange; // nonstandard
177 //double range;
178
180 inline
181 RhiODIM(group_t initialize =ODIMPathElem::ALL_LEVELS) : VerticalCrossSectionODIM(initialize) {
182 init(initialize);
183 };
184
187 initFromMap(odim);
188 };
189
191 template <class T>
192 RhiODIM(const std::map<std::string,T> & m){
193 initFromMap(m);
194 }
195
197 RhiODIM(const drain::image::Image & img, const std::string & quantity=""){
198 initFromImage(img, quantity);
199 };
200
201protected:
202
203 virtual
204 void init(group_t initialize =ODIMPathElem::ALL_LEVELS);
205};
206
207
208
209} // namespace rack
210
211
212#endif
213
214// Rack
Definition Range.h:52
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition Image.h:183
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 ALL_LEVELS
Abbreviation for linking (referencing) attributes at different levels (tree depths).
Definition ODIMPath.h:121
ODIM metadata (quantity, gain, offset, undetect, nodata, date, time)
Definition ODIM.h:79
std::string quantity
dataX/what (obligatory)
Definition ODIM.h:192
Definition VerticalODIM.h:160
RhiODIM(const RhiODIM &odim)
Copy constructor.
Definition VerticalODIM.h:186
RhiODIM(const drain::image::Image &img, const std::string &quantity="")
Constructor.
Definition VerticalODIM.h:197
RhiODIM(group_t initialize=ODIMPathElem::ALL_LEVELS)
Default constructor.
Definition VerticalODIM.h:181
RhiODIM(const std::map< std::string, T > &m)
Constructor.
Definition VerticalODIM.h:192
Definition VerticalODIM.h:52
double yscale
Vertical resolution in m.
Definition VerticalODIM.h:69
void setGeometry(size_t cols, size_t rows)
Sets number of columns (nbins) and number of rows (nrays). Does not change resolution.
Definition VerticalODIM.h:94
long ysize
Number of pixels in vert dimension.
Definition VerticalODIM.h:62
VerticalCrossSectionODIM(group_t initialize=ODIMPathElem::ALL_LEVELS)
Default constructor.
Definition VerticalODIM.h:84
double NI
Minimum height in meters above mean sea level.
Definition VerticalODIM.h:80
VerticalCrossSectionODIM(const ODIM &odim)
Constructor from ODIM.
Definition VerticalODIM.h:89
drain::Range< double > altitudeRange
Corresponding to what:height, yet less risky for confusions with tower height or site height (altitud...
Definition VerticalODIM.h:72
double xscale
Horizontal resolution in m.
Definition VerticalODIM.h:66
int64_t xsize
Number of pixels in horizontal dimension.
Definition VerticalODIM.h:59
Definition VerticalODIM.h:107
VerticalProfileODIM(const drain::image::Image &img, const std::string &quantity="")
Constructor.
Definition VerticalODIM.h:148
VerticalProfileODIM(const std::map< std::string, T > &m)
Constructor.
Definition VerticalODIM.h:143
VerticalProfileODIM(const VerticalProfileODIM &odim)
Copy constructor.
Definition VerticalODIM.h:137
VerticalProfileODIM(group_t initialize=ODIMPathElem::ALL_LEVELS)
Default constructor.
Definition VerticalODIM.h:131
Definition AltitudeOp.cpp:42