Loading...
Searching...
No Matches
Beam.h
Go to the documentation of this file.
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 RACK_RADAR_BEAM
32#define RACK_RADAR_BEAM
33
34//
35#include <math.h>
36
37#include <drain/util/Fuzzy.h>
38#include <drain/util/Math.h>
39#include <drain/util/Geo.h>
40
41
45// 6,370
46namespace rack {
47
48
49class Beam {
50
51public:
52
54 double width;
55
57 inline
58 void setBeamWidthDeg(double width){
59 this->width = width;
60 fuzzyBell.set(0, 0.5 * width); // half-width
61 fuzzyBell2.set(0, 0.5 * width); // half-width
62 }
63
65 inline
66 void setBeamWidthRad(double width){
67 setBeamWidthDeg(width * drain::RAD2DEG);
68 }
69
70
72
76 double getBeamPowerDeg(double d) const;
77
79
83 inline
84 double getBeamPowerRad(double d) const {
85 return getBeamPowerDeg(drain::RAD2DEG * d);
86 }
87
88
93 // A fuzzy beam power model, with +/- 0.1 degree beam "width".
95
96 // A fuzzy beam power model, with +/- 0.1 degree beam "width".
98 //drain::FuzzyBell<double> beamPower:
99
100
101};
102
103
104} // ::rack
105
106
107#endif
108
109// Rack
A smooth symmetric peak function that resembles the Gaussian bell curve. Diminishes quicker than Fuzz...
Definition Fuzzy.h:432
A smooth symmetric peak function that resembles the Gaussian bell curve.
Definition Fuzzy.h:363
Definition Beam.h:49
void setBeamWidthDeg(double width)
Set beam width in degrees.
Definition Beam.h:58
double getBeamPowerRad(double d) const
Gaussian beam power.
Definition Beam.h:84
void setBeamWidthRad(double width)
Set beam width in radians.
Definition Beam.h:66
double width
Beam width in degrees.
Definition Beam.h:54
double getBeamPowerDeg(double d) const
Gaussian beam power.
Definition Beam.cpp:44
drain::FuzzyBell< double > fuzzyBell
Definition Beam.h:94
Definition DataSelector.cpp:44