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 
61  {
64  }
66  {
69  }
71  {
74  };
75 
77  dDryZD_ = 0.0;
78  dWetZD_ = 0.0;
79  dDryMF_ = 0.0;
80  dWetMF_ = 0.0;
81  dGrdMF_ = 0.0;
82  dGradientDelay_ = 0.0;
83  dTotalZD_ = 0.0;
84  dTotalDelay_ = 0.0;
85 };
86 
87 
88 
89 // A destructor:
91 {
92  if (dryZenithDelay_)
93  {
94  delete dryZenithDelay_;
95  dryZenithDelay_ = NULL;
96  };
97  if (wetZenithDelay_)
98  {
99  delete wetZenithDelay_;
100  wetZenithDelay_ = NULL;
101  };
103  {
104  delete dryMappingFunction_;
105  dryMappingFunction_ = NULL;
106  };
108  {
109  delete wetMappingFunction_;
110  wetMappingFunction_ = NULL;
111  };
113  {
116  };
117 };
118 
119 
120 
121 //
122 double SgRefraction::calcTroposphericDelay(const SgMJD& epoch, const SgMeteoData& meteo,
123  double e, double a,
124  SgVlbiStationInfo* stnInfo, const SgVlbiSourceInfo* /*srcInfo*/)
125 {
126  // double gradN = stnInfo->pAtmGradN()->getSolution();
127  // double gradE = stnInfo->pAtmGradE() ? stnInfo->pAtmGradE()->getSolution() : 0.0;
128  dGradientDelay_ = 0.0;
129 
130  dDryZD_ = dryZenithDelay_->calc(meteo, stnInfo);
131  dWetZD_ = wetZenithDelay_->calc(meteo, stnInfo) /*+ stnInfo->getPZenithDelay()->getSolution()*/;
132 
133  dDryMF_ = dryMappingFunction_->calc(meteo, e, stnInfo, epoch);
134  dWetMF_ = wetMappingFunction_->calc(meteo, e, stnInfo, epoch);
135 
136  dGrdMF_ = gradientMappingFunction_->calc(meteo, e, stnInfo, epoch);
137  //
138  // evaluate a contribution to the delay caused by a priori mean gradients,
139  // that could be used if there is no proper LCode:
141  dGradientDelay_ = (stnInfo->getGradNorth()*cos(a) + stnInfo->getGradEast()*sin(a))*dGrdMF_;
142 
144 
146 
148 
150  {
151  QString str;
152  str.sprintf("LOS delay (%s): %20.14f(m) or %24.14f(ps)",
153  qPrintable(stnInfo->getKey()), dTotalDelay_, dTotalDelay_/vLight*1.0e12);
155  };
156  return dTotalDelay_;
157 };
158 /*=====================================================================================================*/
159 
160 
161 
162 
163 /*=======================================================================================================
164 *
165 * FRIENDS:
166 *
167 *======================================================================================================*/
168 //
169 
170 
171 
172 /*=====================================================================================================*/
173 //
174 // aux functions:
175 //
176 
177 
178 // i/o:
179 
180 
181 /*=====================================================================================================*/
182 //
183 // constants:
184 //
185 /*=====================================================================================================*/
186 
187 
188 
189 
190 
191 
192 
193 
194 /*=====================================================================================================*/
const double vLight
Definition: SgConstants.cpp:35
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:400
void setGradientDelay(double d)
double getGradNorth() const
double getGradEast() const
virtual double calc(const SgMeteoData &meteo, const SgVlbiStationInfo *stnInfo)