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
82 inline
83 VerticalCrossSectionODIM(group_t initialize =ODIMPathElem::ALL_LEVELS) : ODIM(initialize) {
84 init(initialize);
85 };
86
87 VerticalCrossSectionODIM(const ODIM & odim){
88 initFromMap(odim);
89 };
90
91 inline
92 void setGeometry(size_t cols, size_t rows){
93 xsize = cols;
94 ysize = rows;
95 }
96
97protected:
98
99 virtual
100 void init(group_t initialize =ODIMPathElem::ALL_LEVELS);
101
102};
103
104
105class VerticalProfileODIM : public VerticalCrossSectionODIM { // TODO VerticalODIM as a base, without xsize,ysize etc.
106public:
107
108 // where (radar site)
109 double lon;
110 double lat;
111 //double height;
112
113 // where (profile)
114 long int levels;
115 double interval;
116 //double minRange;
117 //double range; // was 'maxRange', should be 'range'
118 drain::Range<double> distanceRange;
119
120 // where
121 drain::Range<double> azmRange;
122 //double startaz; // non-stardard for profile
123 //double stopaz; // non-stardard for profile
124 long int azSlots = 0; // non-stardard
125
126
127 inline
129 init(initialize);
130 }
131
132 inline
134 initFromMap(odim);
135 }
136
137 template <class T>
138 VerticalProfileODIM(const std::map<std::string,T> & m){
139 initFromMap(m);
140 }
141
142 VerticalProfileODIM(const drain::image::Image & img, const std::string & quantity=""){
143 initFromImage(img, quantity);
144 }
145
146protected:
147
148 virtual
149 void init(group_t initialize =ODIMPathElem::ALL_LEVELS);
150
151};
152
153
155public:
156
157 // where (radar site)
158 double lon = std::numeric_limits<double>::signaling_NaN();
159 double lat = std::numeric_limits<double>::signaling_NaN();
160
161 //double height;
162
163 // where
164 double az_angle = 0.0; // non-stardard for profile
165 // double angles; // non-stardard for profile
166
167
168 //long int azSlots; // non-stardard
170 //double minRange; // nonstandard
171 //double range;
172
173 inline
174 RhiODIM(group_t initialize =ODIMPathElem::ALL_LEVELS) : VerticalCrossSectionODIM(initialize) {
175 init(initialize);
176 };
177
178 RhiODIM(const RhiODIM & odim){
179 initFromMap(odim);
180 };
181
182 template <class T>
183 RhiODIM(const std::map<std::string,T> & m){
184 initFromMap(m);
185 }
186
187 RhiODIM(const drain::image::Image & img, const std::string & quantity=""){
188 initFromImage(img, quantity);
189 };
190
191protected:
192
193 virtual
194 void init(group_t initialize =ODIMPathElem::ALL_LEVELS);
195};
196
197
198
199} // namespace rack
200
201
202#endif
203
204// Rack
Definition Range.h:52
Class for multi-channel digital images. Supports dynamic typing with base types (char,...
Definition Image.h:183
static const group_t ALL_LEVELS
Abbreviation for linking (referencing) attributes at different levels (tree depths).
Definition ODIMPath.h:120
ODIM metadata (quantity, gain, offset, undetect, nodata, date, time)
Definition ODIM.h:79
std::string quantity
dataX/what (obligatory)
Definition ODIM.h:181
Definition VerticalODIM.h:154
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:92
long ysize
Number of pixels in vert dimension.
Definition VerticalODIM.h:62
double NI
Minimum height in meters above mean sea level.
Definition VerticalODIM.h:80
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:105
Definition DataSelector.cpp:44