MeasuredDBMieModel.h
Go to the documentation of this file.
1 
9 #ifndef _atm_MeasuredDBMieModel_h_
10 #define _atm_MeasuredDBMieModel_h_
11 
12 
13 #include <atm/VMieModel.h>
14 #include <utl/Point.h>
15 #include <utl/ShadowPtr.h>
16 #include <utl/TimeStamp.h>
17 
18 #include <string>
19 
20 namespace utl {
21  class TabulatedFunction;
22 }
23 
24 
25 namespace atm {
26 
28 
29  public:
30 
32 
33  virtual ~MeasuredDBMieModel() { }
34 
36 
53  const utl::Point& xB,
54  const double angle,
55  const double distance,
56  const std::vector<double>& wLength) const;
57 
59  const utl::Point& xB,
60  const double angle,
61  const double distance,
62  const atm::AttenuationResult& mieAttenuation) const;
63 
65  const utl::Point& xFinal,
66  const std::vector<double>& wLength) const;
67 
68  double EvaluateMieScattering(const utl::Point& xA,
69  const utl::Point& xB,
70  const double angle,
71  const double distance,
72  double wLength) const;
73 
74  double EvaluateMieScattering(const utl::Point& xA,
75  const utl::Point& xB,
76  const double angle,
77  const double distance,
78  double wLength,
79  const double mieAttenuation) const;
80 
81  double EvaluateMieAttenuation(const utl::Point& xInit,
82  const utl::Point& xFinal,
83  double wLength) const;
84 
85  double GetVerticalAerosolOpticalDepth(const unsigned int eyeId,
86  const double altitude) const;
87 
88  double GetAttenuationLength(const utl::Point& p,
89  const double wLength) const;
90 
91  //virtual utl::TabulatedFunctionErrors GetAttenuationLength(const utl::Point& p,
92  //const std::vector<double>& wLength) const = 0;
93 
94  double EvaluateScatteringAngle(const utl::Point& p,
95  const double angle,
96  const double wLength) const;
97 
99  bool HasData() const;
100 
102  bool HasZone(const std::string& zoneName) const;
103 
105  void Init();
106 
108  void SetUncertaintyBound(double nSigma) const;
109 
110  private:
111 
112  // returns true if some data got cached
113  bool CheckForUpdates() const;
114 
115  // zone name for zone closest to specified point
116  std::string GetZoneName(const utl::Point& pt) const;
117 
118  // zone name nearest to the specified eye
119  std::string GetZoneName(const unsigned int eyeId) const;
120 
121  // check whether two points are in the same zone or not
122  bool CrossesZone(const utl::Point& pt1, const utl::Point& p2) const;
123 
124  // set VAOD pointer according to user request fNSigma
125  void ToggleVAODPtr() const;
126 
128 
129  // containers for all zone names and positions
130  typedef std::map<std::string, utl::Point> ZonePosition;
131  typedef std::pair<std::string, utl::Point> ZonePoint;
132 
134 
135  // tables with attenuation length vs. height for different zones
136  typedef std::map<std::string, utl::TabulatedFunction> ZoneFunction;
137 
139 
141 
143 
147 
148  // phase function parameters for a particular zone. Note that currently we
149  // only support a single phase function slice. If phase function is
150  // recorded as a function of altitude in the future, this will have to
151  // be updated accordingly.
152  //
153  struct PFParameters {
154  double f;
155  double fErr;
156  double g;
157  double gErr;
158  double fLambda;
159  double fLambdaErr;
160  double gLambda;
161  double gLambdaErr;
162  };
163  typedef std::map<std::string, PFParameters> ZonePhaseFunction;
164 
166 
167  mutable bool fDbIsEmptyNow;
168 
169  mutable double fNSigma;
170 
172 
173  // Members and functors to enable zone forcing and zone swapping
176  std::vector<ZoneParam> fSwapZones;
177 
178  bool ZoneMatch(const ZonePoint& pt, const std::string& name) const;
179 
180  ZoneParam StringToZoneParam(const std::string& str) const;
181  std::string ZoneParamToString(const ZoneParam& zone) const;
182 
184  };
185 
186 } // atm
187 
188 
189 #endif // _atm_MeasuredDBMieModel_h_
190 
bool ZoneMatch(const ZonePoint &pt, const std::string &name) const
bool HasZone(const std::string &zoneName) const
Check for a zone in the DB (partial name match, case-insensitive)
Base class for a Mie Model.
Definition: VMieModel.h:38
Point object.
Definition: Point.h:32
double GetAttenuationLength(const utl::Point &p, const double wLength) const
bool CrossesZone(const utl::Point &pt1, const utl::Point &p2) const
std::map< std::string, PFParameters > ZonePhaseFunction
atm::ScatteringResult EvaluateMieScattering(const utl::Point &xA, const utl::Point &xB, const double angle, const double distance, const std::vector< double > &wLength) const
Compute scattering intensity at point at a particular angle and distance from track defined by two po...
utl::ShadowPtr< ZoneFunction > fMaxVAODVsHeightMap
std::vector< ZoneParam > fSwapZones
REGISTER_MODEL(atm::VMieModel,"MeasuredDB", MeasuredDBMieModel)
Class for computing aerosol scattering and attenuation using database measurements.
std::map< std::string, utl::Point > ZonePosition
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
Class holding the output of the ScatteringResult function.
bool HasData() const
Determine if the DB tables are full or if an update is needed.
double GetVerticalAerosolOpticalDepth(const unsigned int eyeId, const double altitude) const
utl::ShadowPtr< ZonePhaseFunction > fPhaseFuncMap
void SetUncertaintyBound(double nSigma) const
alter Model by nSigma standard deviations
void Init()
Initialize model using an XML card.
std::string ZoneParamToString(const ZoneParam &zone) const
std::map< std::string, utl::TabulatedFunction > ZoneFunction
atm::AttenuationResult EvaluateMieAttenuation(const utl::Point &xInit, const utl::Point &xFinal, const std::vector< double > &wLength) const
std::string GetZoneName(const utl::Point &pt) const
ZoneParam StringToZoneParam(const std::string &str) const
utl::ShadowPtr< ZoneFunction > fCentralVAODVsHeightMap
double EvaluateScatteringAngle(const utl::Point &p, const double angle, const double wLength) const
utl::ShadowPtr< ZoneFunction > fAttLambdaVsHeightMap
utl::ShadowPtr< ZoneFunction > fAttVsHeightMap
Class describing the Atmospheric attenuation.
std::pair< std::string, utl::Point > ZonePoint
utl::ShadowPtr< ZoneFunction > fMinVAODVsHeightMap

, generated on Tue Sep 26 2023.