Beam.h
Go to the documentation of this file.
1 /*
2 
3 MIT License
4 
5 Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 
25  */
26 /*
27 Part of Rack development has been done in the BALTRAD projects part-financed
28 by the European Union (European Regional Development Fund and European
29 Neighbourhood 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
46 namespace rack {
47 
48 
49 class Beam {
50 
51 public:
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".
97  drain::FuzzyBell2<double> fuzzyBell2;
98  //drain::FuzzyBell<double> beamPower:
99 
100 
101 };
102 
103 
104 } // ::rack
105 
106 
107 #endif
108 
109 // Rack
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