Loading...
Searching...
No Matches
Geometry.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 GEOMETRY_RADAR_H_
32#define GEOMETRY_RADAR_H_
33
34
35#include <vector>
36//#include <drain/util/Proj4.h>
37#include <drain/image/GeoFrame.h>
38
39// // using namespace std;
40
41namespace rack
42{
43
44
45// See also RadarProj @ Coordinates?
46
47
85{
86public:
87 Geometry();
88 virtual ~Geometry();
89
91 static
92 double heightFromEtaBeam(double eta, double b);
93
95 static
96 double heightFromEtaBeta(double eta, double beta);
97
99 static
100 double heightFromEtaGround(double eta, double g);
101
102 static inline
103 double betaFromGround(double g){ return g / EARTH_RADIUS_43; }; // SHOULD BE EARTH_RADIUS
104
105 static
106 double beamFromBetaH(double beta,double h);
107
108 static
109 double beamFromEtaH(double eta,double h);
110
111 static
112 double beamFromEtaBeta(double eta,double beta);
113
114 static
115 double beamFromEtaGround(float eta,float g);
116
117 //inline unsigned int binFromEtaBeta(double eta,double beta){
118 // return static_cast<unsigned int>(binDepth/2 + binDepth*beamFromEtaBeta(beta,eta));};
119
120 static double groundFromEtaBeam(double eta, double beam);
121 static double gammaFromEtaH(double eta, double height);
122
123 static inline
124 double groundFromEtaH(double eta,double h){ return EARTH_RADIUS_43*gammaFromEtaH(eta,h); }; //EARTH_RADIUS
125
126 static
127 double etaFromBetaH(double beta,double h);
128
129 double bFromGH(double g,double h);
130
131 static
132 double etaFromGH(double g,double h);
133
134
135 double normalizedBeamPower(double angle);
136
137 void findClosestElevations(const float &elevationAngle,
138 int &elevationIndexLower,float &elevationAngleLower,int &elevationIndexUpper, float &elevationAngleUpper);
139
140 float beamWidth;
141
142 // new
143 //static int EARTH_RADIUSi;
144 //static double EARTH_RADIUS;
145 static double EARTH_RADIUS_43;
146
147
149 std::vector<float> elevationAngles;
150 std::vector<unsigned int> bins;
151};
152
153} // rack::
154
155
156#endif /*GEOMETRY_H_*/
157
158// Rack
Definition Geometry.h:143
static double heightFromEtaBeta(double eta, double beta)
Altitude, given elevation [rad] and ground angle [rad].
Definition Geometry.cpp:143
static double beamFromEtaH(double eta, double h)
The on-beam distance at (elevation) and (altitude).
Definition Geometry.cpp:185
static double beamFromBetaH(double beta, double h)
Definition Geometry.cpp:170
static double etaFromBetaH(double beta, double h)
Given ground angle beta and altitude h, returns the elevation angle.
Definition Geometry.cpp:285
static double beamFromEtaBeta(double eta, double beta)
The on-beam distance at (elevation) and ground angle (beta).
Definition Geometry.cpp:203
static double beamFromEtaGround(float eta, float g)
The on-beam distance at (elevation) and ground distance (groundDist).
Definition Geometry.cpp:218
static double gammaFromEtaH(double eta, double height)
Given elevation angle eta and altitude h, returns the ground angle.
Definition Geometry.cpp:256
static double etaFromGH(double g, double h)
Given ground distance g and altitude h, returns elevation angle.
Definition Geometry.cpp:308
std::vector< float > elevationAngles
Note: radians!
Definition Geometry.h:149
static double groundFromEtaBeam(double eta, double beam)
Given elevation in radians and on-beam distance, returns the distance from radar to the ground point ...
Definition Geometry.cpp:236
static double heightFromEtaGround(double eta, double g)
Altitude, given elevation [rad] and ground distance [m].
Definition Geometry.cpp:154
static double heightFromEtaBeam(double eta, double b)
Altitude, given elevation [rad] and bin distance [m].
Definition Geometry.cpp:111
Definition DataSelector.cpp:44