General Purpose Geodetic Library
SgRefraction.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 #include <SgConstants.h>
27 #include <SgLogger.h>
28 #include <SgRefraction.h>
29 #include <SgTaskConfig.h>
30 #include <SgVlbiStationInfo.h>
31 #include <SgVlbiSourceInfo.h>
32 #include <SgZenithDelay.h>
33 
34 
35 
36 /*=======================================================================================================
37 *
38 * METHODS:
39 *
40 *======================================================================================================*/
41 //
42 // static first:
43 const QString SgRefraction::className()
44 {
45  return "SgRefraction";
46 };
47 
48 
49 
50 //
52 {
53  cfg_ = cfg;
54 
55 // dryZenithDelay_ = new SgZenithDelay;
57 // wetZenithDelay_ = new SgZenithDelay;
59 
62  {
65  }
67  {
70  };
71 
73  dDryZD_ = 0.0;
74  dWetZD_ = 0.0;
75  dDryMF_ = 0.0;
76  dWetMF_ = 0.0;
77  dGrdMF_ = 0.0;
78  dGradientDelay_ = 0.0;
79  dTotalZD_ = 0.0;
80  dTotalDelay_ = 0.0;
81 };
82 
83 
84 
85 // A destructor:
87 {
88  if (dryZenithDelay_)
89  {
90  delete dryZenithDelay_;
91  dryZenithDelay_ = NULL;
92  };
93  if (wetZenithDelay_)
94  {
95  delete wetZenithDelay_;
96  wetZenithDelay_ = NULL;
97  };
99  {
100  delete dryMappingFunction_;
101  dryMappingFunction_ = NULL;
102  };
104  {
105  delete wetMappingFunction_;
106  wetMappingFunction_ = NULL;
107  };
109  {
112  };
113 };
114 
115 
116 
117 //
118 double SgRefraction::calcTroposphericDelay(const SgMJD& epoch, const SgMeteoData& meteo,
119  double e, double a,
120  SgVlbiStationInfo* stnInfo, const SgVlbiSourceInfo* /*srcInfo*/)
121 {
122  // double gradN = stnInfo->pAtmGradN()->getSolution();
123  // double gradE = stnInfo->pAtmGradE() ? stnInfo->pAtmGradE()->getSolution() : 0.0;
124  dGradientDelay_ = 0.0;
125 
126  dDryZD_ = dryZenithDelay_->calc(meteo, stnInfo);
127  dWetZD_ = wetZenithDelay_->calc(meteo, stnInfo) /*+ stnInfo->getPZenithDelay()->getSolution()*/;
128 // dWetZD_ = wetZenithDelay_->calc(meteo, stnInfo) - 2.098547206;
129 
130  dDryMF_ = dryMappingFunction_->calc(meteo, e, stnInfo, epoch);
131  dWetMF_ = wetMappingFunction_->calc(meteo, e, stnInfo, epoch);
132 
133  dGrdMF_ = gradientMappingFunction_->calc(meteo, e, stnInfo, epoch);
134  //
135  // evaluate a contribution to the delay caused by a priori mean gradients,
136  // that could be used if there is no proper LCode:
138  dGradientDelay_ = (stnInfo->getGradNorth()*cos(a) + stnInfo->getGradEast()*sin(a))*dGrdMF_;
139 
141 
143 
145 
147  {
148  QString str;
149  str.sprintf("LOS delay (%s): %20.14f(m) or %24.14f(ps)",
150  qPrintable(stnInfo->getKey()), dTotalDelay_, dTotalDelay_/vLight*1.0e12);
152  };
153  return dTotalDelay_;
154 };
155 /*=====================================================================================================*/
156 
157 
158 
159 
160 /*=======================================================================================================
161 *
162 * FRIENDS:
163 *
164 *======================================================================================================*/
165 //
166 
167 
168 
169 /*=====================================================================================================*/
170 //
171 // aux functions:
172 //
173 
174 
175 // i/o:
176 
177 
178 /*=====================================================================================================*/
179 //
180 // constants:
181 //
182 /*=====================================================================================================*/
183 
184 
185 
186 
187 
188 
189 
190 
191 /*=====================================================================================================*/
const double vLight
Definition: SgConstants.cpp:33
SgLogger * logger
Definition: SgLogger.cpp:231
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
Definition: SgMJD.h:59
virtual double calc(const SgMeteoData &meteo, double e, const SgVlbiStationInfo *stnInfo, const SgMJD &epoch)
const QString & getKey() const
Definition: SgObjectInfo.h:319
double dDryZD_
Definition: SgRefraction.h:133
double dWetZD_
Definition: SgRefraction.h:134
double dWetMF_
Definition: SgRefraction.h:136
SgZenithDelay * dryZenithDelay_
Definition: SgRefraction.h:128
SgZenithDelay * wetZenithDelay_
Definition: SgRefraction.h:129
SgMappingFunction * wetMappingFunction_
Definition: SgRefraction.h:131
const SgTaskConfig * cfg_
Definition: SgRefraction.h:127
SgRefraction(const SgTaskConfig *)
double dTotalZD_
Definition: SgRefraction.h:139
double dGradientDelay_
Definition: SgRefraction.h:138
static const QString className()
double calcTroposphericDelay(const SgMJD &epoch, const SgMeteoData &meteo, double e, double a, SgVlbiStationInfo *stnInfo, const SgVlbiSourceInfo *srcInfo)
double dDryMF_
Definition: SgRefraction.h:135
SgMappingFunction * dryMappingFunction_
Definition: SgRefraction.h:130
double dGrdMF_
Definition: SgRefraction.h:137
SgMappingFunction * gradientMappingFunction_
Definition: SgRefraction.h:132
double dTotalDelay_
Definition: SgRefraction.h:140
bool getUseExtAPrioriMeanGradients() const
TropZenithMap getFlybyTropZenithMap() const
Definition: SgTaskConfig.h:388
void setGradientDelay(double d)
double getGradNorth() const
double getGradEast() const
virtual double calc(const SgMeteoData &meteo, const SgVlbiStationInfo *stnInfo)