SimpleTropModel.cpp
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 
39 #include "SimpleTropModel.hpp"
40 #include "GPSEllipsoid.hpp"
41 
42 namespace gnsstk
43 {
45  {
46  //setWeather(20.0, 980.0, 50.0);
47  Cwetdelay = 0.122382715318184;
48  Cdrydelay = 2.235486646978727;
49  Cwetmap = 1.000282213715744;
50  Cdrymap = 1.001012704615527;
51  valid = true;
52  }
53 
54 
56  {
57  setWeather(wx);
58  valid = true;
59  }
60 
61 
63  const double& P,
64  const double& H)
65  {
66  setWeather(T,P,H);
67  valid = true;
68  }
69 
70 
71  void SimpleTropModel::setWeather(const double& T,
72  const double& P,
73  const double& H)
74  {
76  GPSEllipsoid ell;
77  Cdrydelay = 2.343*(press/1013.25)*(temp-3.96)/temp;
78  double tks = temp * temp;
79  Cwetdelay = 8.952/tks*humid*std::exp(-37.2465+0.213166*temp-(0.256908e-3)*tks);
80  Cdrymap =1.0+(0.15)*148.98*(temp-3.96)/ell.a();
81  Cwetmap =1.0+(0.15)*12000.0/ell.a();
82  valid = true;
83  }
84 
85 
87  {
89  }
90 
91 
93  {
95  return Cdrydelay;
96  }
97 
98 
100  {
102  return Cwetdelay;
103  }
104 
105 
106  double SimpleTropModel::dry_mapping_function(double elevation) const
107  {
109 
110  if(elevation < 0.0) return 0.0;
111 
112  double d = std::cos(elevation*DEG_TO_RAD);
113  d /= Cdrymap;
114  return (1.0/SQRT(1.0-d*d));
115  }
116 
117 
118  double SimpleTropModel::wet_mapping_function(double elevation) const
119  {
121 
122  if(elevation < 0.0) return 0.0;
123 
124  double d = std::cos(elevation*DEG_TO_RAD);
125  d /= Cwetmap;
126  return (1.0/SQRT(1.0-d*d));
127  }
128 
129 }
gnsstk::SimpleTropModel::Cdrymap
double Cdrymap
computed dry map function
Definition: SimpleTropModel.hpp:97
SQRT
#define SQRT(x)
Definition: MathBase.hpp:74
gnsstk::SimpleTropModel::Cdrydelay
double Cdrydelay
computed dry delay
Definition: SimpleTropModel.hpp:95
gnsstk::SimpleTropModel::SimpleTropModel
SimpleTropModel()
Empty constructor.
Definition: SimpleTropModel.cpp:44
gnsstk::SimpleTropModel::setWeather
virtual void setWeather(const double &T, const double &P, const double &H)
Definition: SimpleTropModel.cpp:71
gnsstk::SimpleTropModel::Cwetdelay
double Cwetdelay
computed wet delay
Definition: SimpleTropModel.hpp:96
gnsstk::WxObservation
A Single Weather Observation.
Definition: WxObsMap.hpp:55
gnsstk::GPSEllipsoid
Definition: GPSEllipsoid.hpp:67
THROW_IF_INVALID
#define THROW_IF_INVALID()
Definition: TropModel.hpp:57
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::TropModel::humid
double humid
latest value of relative humidity (percent)
Definition: TropModel.hpp:282
gnsstk::SimpleTropModel::wet_mapping_function
virtual double wet_mapping_function(double elevation) const
Definition: SimpleTropModel.cpp:118
gnsstk::SimpleTropModel::dry_zenith_delay
virtual double dry_zenith_delay() const
Definition: SimpleTropModel.cpp:92
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
SimpleTropModel.hpp
gnsstk::SimpleTropModel::dry_mapping_function
virtual double dry_mapping_function(double elevation) const
Definition: SimpleTropModel.cpp:106
gnsstk::TrackingCode::P
@ P
Legacy GPS precise code.
GPSEllipsoid.hpp
gnsstk::TropModel::setWeather
virtual void setWeather(const double &T, const double &P, const double &H)
Definition: TropModel.cpp:85
gnsstk::SimpleTropModel::Cwetmap
double Cwetmap
computed wet map function
Definition: SimpleTropModel.hpp:98
gnsstk::TropModel::temp
double temp
latest value of temperature (kelvin or celsius)
Definition: TropModel.hpp:280
gnsstk::SimpleTropModel::wet_zenith_delay
virtual double wet_zenith_delay() const
Definition: SimpleTropModel.cpp:99
gnsstk::WGS84Ellipsoid::a
virtual double a() const noexcept
Definition: WGS84Ellipsoid.hpp:62
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:41