General Purpose Geodetic Library
NsScrPrx4Observation.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of nuSolve. nuSolve is a part of CALC/SOLVE system
4  * and is designed to perform data analyis of a geodetic VLBI session.
5  * Copyright (C) 2017-2020 Sergei Bolotin.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 #include "nuSolve.h"
22 #include "NsScrPrx4Observation.h"
23 #include "NsScrPrx4Session.h"
24 
25 
26 /*=======================================================================================================
27 *
28 * METHODS:
29 *
30 *======================================================================================================*/
31 //
32 double NsScrPrx4VlbiObservation::delayValue(const QString& bandKey,
33  NsScrPrx4TaskConfig::VlbiDelayType t) const
34 {
35  double v(0.0);
36  if (!obs_->observableByKey().contains(bandKey))
37  return v;
38  switch (t)
39  {
40  default:
41  case NsScrPrx4TaskConfig::VD_NONE:
42  v = 0.0;
43  break;
44  case NsScrPrx4TaskConfig::VD_SB_DELAY:
45  v = obs_->observableByKey().value(bandKey)->sbDelay().getValue();
46  break;
47  case NsScrPrx4TaskConfig::VD_GRP_DELAY:
48  v = obs_->observableByKey().value(bandKey)->grDelay().getValue();
49  break;
50  case NsScrPrx4TaskConfig::VD_PHS_DELAY:
51  v = obs_->observableByKey().value(bandKey)->phDelay().getValue();
52  break;
53  };
54  return v;
55 };
56 
57 
58 
59 //
60 double NsScrPrx4VlbiObservation::delayValueGeoc(const QString& bandKey,
61  NsScrPrx4TaskConfig::VlbiDelayType t) const
62 {
63  double v(0.0);
64  if (!obs_->observableByKey().contains(bandKey))
65  return v;
66  switch (t)
67  {
68  default:
69  case NsScrPrx4TaskConfig::VD_NONE:
70  v = 0.0;
71  break;
72  case NsScrPrx4TaskConfig::VD_SB_DELAY:
73  v = obs_->observableByKey().value(bandKey)->sbDelay().getGeocenterValue();
74  break;
75  case NsScrPrx4TaskConfig::VD_GRP_DELAY:
76  v = obs_->observableByKey().value(bandKey)->grDelay().getGeocenterValue();
77  break;
78  case NsScrPrx4TaskConfig::VD_PHS_DELAY:
79  v = obs_->observableByKey().value(bandKey)->phDelay().getGeocenterValue();
80  break;
81  };
82  return v;
83 };
84 
85 
86 
87 
88 //
89 double NsScrPrx4VlbiObservation::delayStdDev(const QString& bandKey,
90  NsScrPrx4TaskConfig::VlbiDelayType t) const
91 {
92  double v(-1.0);
93  if (!obs_->observableByKey().contains(bandKey))
94  return v;
95  switch (t)
96  {
97  default:
98  case NsScrPrx4TaskConfig::VD_NONE:
99  v = 0.0;
100  break;
101  case NsScrPrx4TaskConfig::VD_SB_DELAY:
102  v = obs_->observableByKey().value(bandKey)->sbDelay().getSigma();
103  break;
104  case NsScrPrx4TaskConfig::VD_GRP_DELAY:
105  v = obs_->observableByKey().value(bandKey)->grDelay().getSigma();
106  break;
107  case NsScrPrx4TaskConfig::VD_PHS_DELAY:
108  v = obs_->observableByKey().value(bandKey)->phDelay().getSigma();
109  break;
110  };
111  return v;
112 };
113 
114 
115 
116 //
117 double NsScrPrx4VlbiObservation::delayResidual(const QString& bandKey,
118  NsScrPrx4TaskConfig::VlbiDelayType t) const
119 {
120  double r(0.0);
121  if (!obs_->observableByKey().contains(bandKey))
122  return r;
123  switch (t)
124  {
125  default:
126  case NsScrPrx4TaskConfig::VD_NONE:
127  r = 0.0;
128  break;
129  case NsScrPrx4TaskConfig::VD_SB_DELAY:
130  r = obs_->observableByKey().value(bandKey)->sbDelay().getResidual();
131  break;
132  case NsScrPrx4TaskConfig::VD_GRP_DELAY:
133  r = obs_->observableByKey().value(bandKey)->grDelay().getResidual();
134  break;
135  case NsScrPrx4TaskConfig::VD_PHS_DELAY:
136  r = obs_->observableByKey().value(bandKey)->phDelay().getResidual();
137  break;
138  };
139  return r;
140 };
141 
142 
143 
144 //
145 double NsScrPrx4VlbiObservation::delayResidualNorm(const QString& bandKey,
146  NsScrPrx4TaskConfig::VlbiDelayType t) const
147 {
148  double r(0.0);
149  if (!obs_->observableByKey().contains(bandKey))
150  return r;
151  switch (t)
152  {
153  default:
154  case NsScrPrx4TaskConfig::VD_NONE:
155  r = 0.0;
156  break;
157  case NsScrPrx4TaskConfig::VD_SB_DELAY:
158  r = obs_->observableByKey().value(bandKey)->sbDelay().getResidualNorm();
159  break;
160  case NsScrPrx4TaskConfig::VD_GRP_DELAY:
161  r = obs_->observableByKey().value(bandKey)->grDelay().getResidualNorm();
162  break;
163  case NsScrPrx4TaskConfig::VD_PHS_DELAY:
164  r = obs_->observableByKey().value(bandKey)->phDelay().getResidualNorm();
165  break;
166  };
167  return r;
168 };
169 
170 
171 
172 //
173 double NsScrPrx4VlbiObservation::delayAmbiguitySpacing(const QString& bandKey,
174  NsScrPrx4TaskConfig::VlbiDelayType t) const
175 {
176  double r(-1.0);
177  if (!obs_->observableByKey().contains(bandKey))
178  return r;
179  switch (t)
180  {
181  default:
182  case NsScrPrx4TaskConfig::VD_NONE:
183  r = -1.0;
184  break;
185  case NsScrPrx4TaskConfig::VD_SB_DELAY:
186  r = obs_->observableByKey().value(bandKey)->sbDelay().getAmbiguitySpacing();
187  break;
188  case NsScrPrx4TaskConfig::VD_GRP_DELAY:
189  r = obs_->observableByKey().value(bandKey)->grDelay().getAmbiguitySpacing();
190  break;
191  case NsScrPrx4TaskConfig::VD_PHS_DELAY:
192  r = obs_->observableByKey().value(bandKey)->phDelay().getAmbiguitySpacing();
193  break;
194  };
195  return r;
196 };
197 
198 
199 
200 //
202  NsScrPrx4TaskConfig::VlbiDelayType t) const
203 {
204  int n(0);
205  if (!obs_->observableByKey().contains(bandKey))
206  return n;
207  switch (t)
208  {
209  default:
210  case NsScrPrx4TaskConfig::VD_NONE:
211  n = -1.0;
212  break;
213  case NsScrPrx4TaskConfig::VD_SB_DELAY:
214  n = obs_->observableByKey().value(bandKey)->sbDelay().getNumOfAmbiguities();
215  break;
216  case NsScrPrx4TaskConfig::VD_GRP_DELAY:
217  n = obs_->observableByKey().value(bandKey)->grDelay().getNumOfAmbiguities();
218  break;
219  case NsScrPrx4TaskConfig::VD_PHS_DELAY:
220  n = obs_->observableByKey().value(bandKey)->phDelay().getNumOfAmbiguities();
221  break;
222  };
223  return n;
224 };
225 
226 
227 
228 //
230 {
231  return session_->lookUpStation(obs_->stn_1()->getKey());
232 };
233 
234 
235 
236 //
238 {
239  return session_->lookUpStation(obs_->stn_2()->getKey());
240 };
241 
242 
243 
244 //
246 {
247  return session_->lookUpBaseline(obs_->baseline()->getKey());
248 };
249 
250 
251 
252 //
254 {
255  return session_->lookUpSource(obs_->src()->getKey());
256 };
257 
258 
259 
260 /*=======================================================================================================
261 *
262 * FRIENDS:
263 *
264 *======================================================================================================*/
265 //
266 
267 
268 
269 
270 
271 
272 
273 
274 
275 
276 
277 
278 
279 
280 
281 
282 
283 
284 /*=====================================================================================================*/
285 //
286 // constants:
287 //
288 
289 
290 /*=====================================================================================================*/
291 
292 
293 
294 
295 
296 /*=====================================================================================================*/
NsScrPrx4Baseline * lookUpBaseline(const QString &key)
NsScrPrx4Station * lookUpStation(const QString &key)
NsScrPrx4Source * lookUpSource(const QString &key)
double delayValue(const QString &bandKey, NsScrPrx4TaskConfig::VlbiDelayType t) const
double delayAmbiguitySpacing(const QString &bandKey, NsScrPrx4TaskConfig::VlbiDelayType t) const
double delayStdDev(const QString &bandKey, NsScrPrx4TaskConfig::VlbiDelayType t) const
double delayResidualNorm(const QString &bandKey, NsScrPrx4TaskConfig::VlbiDelayType t) const
double delayResidual(const QString &bandKey, NsScrPrx4TaskConfig::VlbiDelayType t) const
NsScrPrx4Baseline * getBaseline()
NsScrPrx4Station * getStation_2()
double delayValueGeoc(const QString &bandKey, NsScrPrx4TaskConfig::VlbiDelayType t) const
int delayNumOfAmbiguities(const QString &bandKey, NsScrPrx4TaskConfig::VlbiDelayType t) const
NsScrPrx4Station * getStation_1()
const QString & getKey() const
Definition: SgObjectInfo.h:319
SgVlbiStationInfo * stn_1()
SgVlbiSourceInfo * src()
SgVlbiBaselineInfo * baseline()
SgVlbiStationInfo * stn_2()
QMap< QString, SgVlbiObservable * > & observableByKey()