TropModel.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
45 #ifndef TROP_MODEL_HPP
46 #define TROP_MODEL_HPP
47 
48 #include "Exception.hpp"
49 #include "ObsEpochMap.hpp"
50 #include "WxObsMap.hpp"
51 #include "Xvt.hpp"
52 #include "Position.hpp"
53 #include "Matrix.hpp"
54 #include "GNSSconstants.hpp"
55 #include "gnsstk_export.h"
56 
57 #define THROW_IF_INVALID() {if (!valid) {InvalidTropModel e("Invalid model");GNSSTK_THROW(e);}}
58 
59 // Model of the troposphere, used to compute non-dispersive delay of
60 // satellite signal as function of satellite elevation as seen at the
61 // receiver. Both wet and hydrostatic (dry) components are computed.
62 //
63 // The default model (implemented here) is a simple Black model.
64 //
65 // In this model (and many others), the wet and hydrostatic (dry) components are
66 // independent, the zenith delays depend only on the weather
67 // (temperature, pressure and humidity), and the mapping functions
68 // depend only on the elevation of the satellite as seen at the
69 // receiver. In general, this is not true; other models depend on,
70 // for example, latitude or day of year.
71 //
72 // Other models may be implemented by inheriting this class and
73 // redefining the virtual functions, and (perhaps) adding other
74 // 'set...()' routines as needed.
75 
76 namespace gnsstk
77 {
80 
81 
86  NEW_EXCEPTION_CLASS(InvalidTropModel, gnsstk::Exception);
87 
105  class TropModel
106  {
107  public:
108  GNSSTK_EXPORT static const double CELSIUS_TO_KELVIN;
109 
111  virtual ~TropModel() {}
112 
114  bool isValid()
115  { return valid; }
116 
118  virtual std::string name()
119  { return std::string("Undefined"); }
120 
127  virtual double correction(double elevation) const;
128 
142  virtual double correction(const Position& RX,
143  const Position& SV,
144  const CommonTime& tt);
145 
164  virtual double correction(const Xvt& RX,
165  const Xvt& SV,
166  const CommonTime& tt)
167  { Position R(RX),S(SV); return TropModel::correction(R,S,tt); }
168 
173  virtual double dry_zenith_delay() const = 0;
174 
179  virtual double wet_zenith_delay() const = 0;
180 
187  virtual double dry_mapping_function(double elevation)
188  const = 0;
189 
196  virtual double wet_mapping_function(double elevation)
197  const = 0;
198 
206  virtual void setWeather(const double& T,
207  const double& P,
208  const double& H);
209 
215  virtual void setWeather(const WxObservation& wx);
216 
222  virtual void setReceiverHeight(const double& ht) {}
223 
229  virtual void setReceiverLatitude(const double& lat) {}
230 
235  virtual void setReceiverLongitude(const double& lon) {}
236 
242  virtual void setDayOfYear(const int& d) {}
243 
262  double SaasDryDelay(const double pr, const double lat, const double ht)
263  const
264  {
265  return (0.0022768*pr/(1-0.00266*::cos(2*lat*DEG_TO_RAD)-0.00028*ht/1000.));
266  }
267 
276  const double& ht, double& T, double& P, double& H);
277 
278  protected:
279  bool valid;
280  double temp;
281  double press;
282  double humid;
283 
284  }; // end class TropModel
285 
286 
287  //---------------------------------------------------------------------------------
289  class ZeroTropModel : public TropModel
290  {
291  public:
293  virtual std::string name()
294  { return std::string("Zero"); }
295 
297  virtual double correction(double elevation) const
298  { return 0.0; }
299 
301  virtual double correction(const Position& RX,
302  const Position& SV,
303  const CommonTime& tt)
304  { return 0.0; }
305 
307  virtual double correction(const Xvt& RX,
308  const Xvt& SV,
309  const CommonTime& tt)
310  { return 0.0; }
311 
313  virtual double dry_zenith_delay() const
314  { return 0.0; }
315 
317  virtual double wet_zenith_delay() const
318  { return 0.0; }
319 
321  virtual double dry_mapping_function(double elevation) const
322  { return 0.0; }
323 
325  virtual double wet_mapping_function(double elevation) const
326  { return 0.0; }
327 
328  }; // end class ZeroTropModel
329 
331 }
332 #endif
gnsstk::TropModel::correction
virtual double correction(double elevation) const
Definition: TropModel.cpp:53
gnsstk::ZeroTropModel::wet_mapping_function
virtual double wet_mapping_function(double elevation) const
Definition: TropModel.hpp:325
Xvt.hpp
gnsstk::TropModel::dry_zenith_delay
virtual double dry_zenith_delay() const =0
gnsstk::ZeroTropModel::name
virtual std::string name()
Return the name of the model.
Definition: TropModel.hpp:293
gnsstk::TropModel::weatherByStandardAtmosphereModel
static void weatherByStandardAtmosphereModel(const double &ht, double &T, double &P, double &H)
Definition: TropModel.cpp:144
gnsstk::TropModel::~TropModel
virtual ~TropModel()
Destructor.
Definition: TropModel.hpp:111
ObsEpochMap.hpp
gnsstk::TropModel::name
virtual std::string name()
Return the name of the model.
Definition: TropModel.hpp:118
gnsstk::TropModel::correction
virtual double correction(const Xvt &RX, const Xvt &SV, const CommonTime &tt)
Definition: TropModel.hpp:164
gnsstk::TropModel
Definition: TropModel.hpp:105
gnsstk::TropModel::SaasDryDelay
double SaasDryDelay(const double pr, const double lat, const double ht) const
Definition: TropModel.hpp:262
Position.hpp
gnsstk::WxObservation
A Single Weather Observation.
Definition: WxObsMap.hpp:55
GNSSconstants.hpp
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::TropModel::CELSIUS_TO_KELVIN
static const GNSSTK_EXPORT double CELSIUS_TO_KELVIN
Definition: TropModel.hpp:108
gnsstk::Exception
Definition: Exception.hpp:151
gnsstk::ZeroTropModel::correction
virtual double correction(const Position &RX, const Position &SV, const CommonTime &tt)
Definition: TropModel.hpp:301
gnsstk::NEW_EXCEPTION_CLASS
NEW_EXCEPTION_CLASS(FileSpecException, gnsstk::Exception)
gnsstk::TropModel::setReceiverHeight
virtual void setReceiverHeight(const double &ht)
Definition: TropModel.hpp:222
gnsstk::TropModel::humid
double humid
latest value of relative humidity (percent)
Definition: TropModel.hpp:282
WxObsMap.hpp
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::Xvt
Definition: Xvt.hpp:60
gnsstk::TropModel::wet_zenith_delay
virtual double wet_zenith_delay() const =0
gnsstk::TropModel::valid
bool valid
true only if current model parameters are valid
Definition: TropModel.hpp:279
std::cos
double cos(gnsstk::Angle x)
Definition: Angle.hpp:146
gnsstk::TropModel::press
double press
latest value of pressure (millibars)
Definition: TropModel.hpp:281
gnsstk::TropModel::dry_mapping_function
virtual double dry_mapping_function(double elevation) const =0
Exception.hpp
gnsstk::TropModel::setWeather
virtual void setWeather(const double &T, const double &P, const double &H)
Definition: TropModel.cpp:85
gnsstk::TropModel::setReceiverLongitude
virtual void setReceiverLongitude(const double &lon)
Definition: TropModel.hpp:235
gnsstk::ZeroTropModel::correction
virtual double correction(double elevation) const
Definition: TropModel.hpp:297
gnsstk::TropModel::wet_mapping_function
virtual double wet_mapping_function(double elevation) const =0
gnsstk::Position
Definition: Position.hpp:136
gnsstk::TropModel::setReceiverLatitude
virtual void setReceiverLatitude(const double &lat)
Definition: TropModel.hpp:229
Matrix.hpp
gnsstk::ZeroTropModel::dry_mapping_function
virtual double dry_mapping_function(double elevation) const
Definition: TropModel.hpp:321
gnsstk::ZeroTropModel::wet_zenith_delay
virtual double wet_zenith_delay() const
Definition: TropModel.hpp:317
gnsstk::TropModel::temp
double temp
latest value of temperature (kelvin or celsius)
Definition: TropModel.hpp:280
gnsstk::ZeroTropModel::dry_zenith_delay
virtual double dry_zenith_delay() const
Definition: TropModel.hpp:313
gnsstk::TropModel::isValid
bool isValid()
Return validity of model.
Definition: TropModel.hpp:114
gnsstk::TropModel::setDayOfYear
virtual void setDayOfYear(const int &d)
Definition: TropModel.hpp:242
gnsstk::ZeroTropModel::correction
virtual double correction(const Xvt &RX, const Xvt &SV, const CommonTime &tt)
Definition: TropModel.hpp:307
gnsstk::ZeroTropModel
The 'zero' trop model, meaning it always returns zero.
Definition: TropModel.hpp:289
gnsstk::DEG_TO_RAD
static const double DEG_TO_RAD
Conversion Factor from degrees to radians (units: degrees^-1)
Definition: GNSSconstants.hpp:76


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:42