General Purpose Geodetic Library
SgZenithDelay.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 #include <math.h>
25 
26 
27 #include <SgLogger.h>
28 #include <SgVlbiStationInfo.h>
29 #include <SgZenithDelay.h>
30 
31 
32 
33 /*=======================================================================================================
34 *
35 * METHODS:
36 *
37 *======================================================================================================*/
38 //
39 // static first:
40 const QString SgZenithDelay::className()
41 {
42  return "SgZenithDelay";
43 };
44 
45 
46 
47 //
48 double SgZenithDelay::calc(const SgMeteoData&, const SgVlbiStationInfo* stnInfo)
49 {
51  {
52  QString str;
53  str.sprintf("Zenith delay result(%s): zd=%20.16f(m)",
54  qPrintable(stnInfo->getKey()), 0.0);
56  };
57  return 0.0;
58 };
59 
60 
61 
62 //
64 {
71  double height(stnInfo->getHeight());
72 
73  double rh(meteo.relativeHumidity(height, stnInfo));
74 
75  double t(meteo.temperature(height, stnInfo));
76  double vp;
77  vp = 0.0;
78 /* CALC (calc11/catmm.f):
79  TEMP = TC+237.3D0
80  ESAT = 6.11D0 * EXP(17.269D0*TC/TEMP)
81 */
82 
83 
84  // 0<= rh <=1:
85  vp = 6.11*rh*exp(17.26938819745534263007*t/(237.3 + t));
86 
87 /*
88  // From A.Niell e-mail:
89  return 6.105*exp(25.22*((t + 0.15)/(t + 273.15)) - 5.31*log((t + 273.15)/273.0));
90 */
91 
93  {
94  QString str;
95  str.sprintf("Vapor pressure input (%s): rh=%12.6f",
96  qPrintable(stnInfo->getKey()), rh);
98  str.sprintf("Vapor pressure result(%s): vp=%20.16f(hPa)",
99  qPrintable(stnInfo->getKey()), vp);
101  };
102  return vp;
103 };
104 /*=====================================================================================================*/
105 
106 
107 
108 
109 
110 
111 /*=====================================================================================================*/
112 //
113 // static first:
115 {
116  return "SgDryZD_Saastamoinen";
117 };
118 
119 
120 
121 //
122 double SgDryZD_Saastamoinen::calc(const SgMeteoData& meteo, const SgVlbiStationInfo* stnInfo)
123 {
124  double latitude=stnInfo->getLatitude(), height=stnInfo->getHeight();
125  double zd;
126  double p(meteo.pressure(height, stnInfo));
127 
128  zd = 2.2768e-3*p/(1.0 - 2.66e-3*cos(2.0*latitude) - 2.8e-7*height);
129 
131  {
132  QString str;
133  str.sprintf("Zenith delay input (%s): P=%12.6f(Pa), latitude=%12.6f(d), height=%12.6f(m)",
134  qPrintable(stnInfo->getKey()), p, latitude*RAD2DEG, height);
136  str.sprintf("Zenith delay result(%s): zd=%20.16f(m)",
137  qPrintable(stnInfo->getKey()), zd);
139  };
140  return zd;
141 };
142 /*=====================================================================================================*/
143 
144 
145 
146 
147 
148 
149 /*=====================================================================================================*/
150 //
151 // static first:
153 {
154  return "SgWetZD_Saastamoinen";
155 };
156 
157 
158 
159 //
160 double SgWetZD_Saastamoinen::calc(const SgMeteoData& meteo, const SgVlbiStationInfo* stnInfo)
161 {
162  double height(stnInfo->getHeight());
163  double t(meteo.temperature(height, stnInfo));
164  double zd(0.0), vaporPressure(calcVapourPressure(meteo, stnInfo));
165 
166  zd = 2.277e-3*(0.05 + 1255.0/(t + 273.15))*vaporPressure;
167 
168 /* CALC:
169  ZW = 0.002277D0 * (1255.D0/(TC+273.16D0) + 0.05D0) * RH * ESAT
170 */
171 
173  {
174  QString str;
175  str.sprintf("Zenith delay input (%s): t=%12.6f(C), vaporPressure=%12.6f(Pa)",
176  qPrintable(stnInfo->getKey()), t, vaporPressure);
178  str.sprintf("Zenith delay result(%s): zd=%20.16f(m)",
179  qPrintable(stnInfo->getKey()), zd);
181  };
182  return zd;
183 };
184 /*=====================================================================================================*/
185 
186 
187 
188 
189 
190 
191 /*=======================================================================================================
192 *
193 * FRIENDS:
194 *
195 *======================================================================================================*/
196 //
197 
198 
199 
200 /*=====================================================================================================*/
201 //
202 // aux functions:
203 //
204 
205 
206 // i/o:
207 
208 
209 /*=====================================================================================================*/
210 //
211 // constants:
212 //
213 const double SgZenithDelay::k1_ = 77.604; // K/mbar
214 const double SgZenithDelay::k2_ = 64.79; // K/mbar
215 const double SgZenithDelay::k3_ = 3.776e+5; // K/mbar^2
216 /*=====================================================================================================*/
217 
218 
219 
220 
221 
222 
223 
224 
225 /*=====================================================================================================*/
SgLogger * logger
Definition: SgLogger.cpp:231
#define RAD2DEG
radians to degrees:
Definition: SgMathSupport.h:41
static const QString className()
virtual double calc(const SgMeteoData &meteo, const SgVlbiStationInfo *stnInfo)
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ REFRACTION
Definition: SgLogger.h:82
bool isEligible(LogLevel lvl, quint32 f) const
Definition: SgLogger.h:151
double temperature(double height, const SgVlbiStationInfo *stnInfo) const
Definition: SgMeteoData.cpp:53
double relativeHumidity(double height, const SgVlbiStationInfo *stnInfo) const
Definition: SgMeteoData.cpp:99
double pressure(double height, const SgVlbiStationInfo *stnInfo) const
Definition: SgMeteoData.cpp:75
const QString & getKey() const
Definition: SgObjectInfo.h:319
double getLatitude() const
double getHeight() const
virtual double calc(const SgMeteoData &meteo, const SgVlbiStationInfo *stnInfo)
static const QString className()
static const double k1_
refraction coeff. #1, K/mbar; Thayer, 1974
virtual double calc(const SgMeteoData &meteo, const SgVlbiStationInfo *stnInfo)
static const QString className()
static const double k3_
refraction coeff. #3, K/mbar^2; Thayer, 1974
static double calcVapourPressure(const SgMeteoData &meteo, const SgVlbiStationInfo *stnInfo)
static const double k2_
refraction coeff. #2, K/mbar; Thayer, 1974