General Purpose Geodetic Library
SgVlbiBaselineInfo.h
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 #ifndef SG_VLBI_BASELINE_INFO_H
24 #define SG_VLBI_BASELINE_INFO_H
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 
32 #include <math.h>
33 
34 #include <QtCore/QString>
35 #include <QtCore/QList>
36 #include <QtCore/QMap>
37 
38 class QDataStream;
39 
40 #include <SgMJD.h>
41 #include <SgObjectInfo.h>
42 #include <SgParameter.h>
43 #include <SgTaskConfig.h>
44 
45 
46 
47 // temporary here:
49 {
50  public:
52  double totWrms_;
53  double minWrms_;
58 };
59 
60 
61 
62 
63 //class SgTaskConfig;
64 //class SgVlbiObservation;
65 class SgVlbiObservable;
66 class SgVlbiStationInfo;
67 /***===================================================================================================*/
73 // typedefs:
74 class SgVlbiBaselineInfo;
75 typedef QMap<QString, SgVlbiBaselineInfo*> BaselinesByName;
76 typedef QMap<QString, SgVlbiBaselineInfo*>::iterator BaselinesByName_it;
77 //
78 //
80 {
81 public:
83  {
84  Attr_NOT_VALID = 1<< 0,
89  Attr_SKIP_WC = 1<< 5,
90  };
91 
92  // Statics:
95  static const QString className();
96 
97  //
98  // constructors/destructors:
99  //
103  inline SgVlbiBaselineInfo(int idx=-1, const QString& key="Unknown", const QString& aka="Unknown too");
104 
108  inline ~SgVlbiBaselineInfo();
109 
110 
111 
112  //
113  // Interfaces:
114  //
118 
119  inline double getCbdTotalWrms() const;
120 
121  inline double getMeanGrDelResiduals() const;
122 
123  inline double getMeanGrDelResidualsSigma() const;
124 
125  inline double getAuxSign() const;
126 
127  inline const QString& strGrdAmbigsStat() const {return strGrdAmbigsStat_;};
128 
129  inline const QString& strPhdAmbigsStat() const {return strPhdAmbigsStat_;};
130 
131  inline int getTypicalNumOfChannels() const {return typicalNumOfCannels_;};
132  inline double getTypicalGrdAmbigSpacing() const {return typicalGrdAmbigSpacing_;};
133  inline double getTypicalPhdAmbigSpacing() const {return typicalPhdAmbigSpacing_;};
137  inline double getLength() const {return length_;};
138 
139  inline double dClock() const {return dClock_;};
140  inline double dClockSigma() const {return dClockSigma_;};
141 
143 
147  inline void setAuxSign(double s);
148 
149 // inline void setAuxSigmaDelay(double s) {auxSigmaDelay_ = s;};
150 
151 // inline void setAuxSigmaRate(double s) {auxSigmaRate_ = s;};
152 
153  inline void setLength(double l) {length_ = l;};
154 
157  inline SgParameter*& pAux();
158 
159  inline SgParameter* pClock();
160 
161  inline SgParameter* pBx();
162 
163  inline SgParameter* pBy();
164 
165  inline SgParameter* pBz();
166 
167  inline const QMap<int, int>& numOfChanByCount() const {return numOfChanByCount_;};
168 
169 
170  //
171  // Functions:
172  //
173  bool selfCheck();
174 
178 
181  void evaluateCBIndicator();
182 
185  void scan4Ambiguities();
186 
190 
193  void shiftAmbiguities(int deltaN);
194 
197  void createParameters();
198 
201  void releaseParameters();
202 
203  SgVlbiStationInfo* stn_1(QMap<QString, SgVlbiStationInfo*>) const;
204  SgVlbiStationInfo* stn_2(QMap<QString, SgVlbiStationInfo*>) const;
205 
206  inline void resetAllEditings();
207  void setGrdAmbiguities2min();
208 
209 
210  //
211  // Friends:
212  //
213 
214  //
215  // I/O:
216  //
218 
220  //
221 
222 private:
224  // for clock break detector needs:
225  double cbd_total_wrms_; // total wrms residuals for the clock breack detector
227 
228  // temporary place for the parameters:
230 
231  // for ambiguity resolutions:
234  double auxSign_;
235  //
236  // for checking numbers of channels:
237  QMap<int, int> numOfChanByCount_;
239 
240  // Private functions:
241  void scan4Ambiguities_m1();
242  void scan4Ambiguities_m2();
243  // temporary place for parameters:
248  double dClock_;
249  double dClockSigma_;
250  double length_;
251  //
252  //
253  // 4group delays:
254  QMap<double, int> grdAmbigsBySpacing_;
257  // 4phase delays:
258  QMap<double, int> phdAmbigsBySpacing_;
261 
262 };
263 /*=====================================================================================================*/
264 
265 
266 
267 
268 
269 /*=====================================================================================================*/
270 /* */
271 /* SgVlbiBaselineInfo inline members: */
272 /* */
273 /*=====================================================================================================*/
274 //
275 //
276 //
277 // CONSTRUCTORS:
278 //
279 // An empty constructor:
280 inline SgVlbiBaselineInfo::SgVlbiBaselineInfo(int idx, const QString& key, const QString& aka) :
281  SgObjectInfo(idx, key, aka),
282  observables_(),
283  numOfChanByCount_(),
284  grdAmbigsBySpacing_(),
285  strGrdAmbigsStat_(""),
286  phdAmbigsBySpacing_(),
287  strPhdAmbigsStat_("")
288 {
289  addAttr(Attr_USE_IONO4GRD); // use it by default if available
290  cbd_total_wrms_ = 0.0;
291  cbIndicator_ = NULL;
292  meanGrDelResiduals_ = 0.0;
294  auxSign_ = 1.0;
295  //
296  //auxNumProc_ = 0.0;
297  //auxSumRMS2_ = 0.0;
298  //auxSumW_ = 0.0;
299  //auxSumOne_ = 0.0;
300  //auxSumTwo_ = 0.0;
301  //
302  pAux_ = NULL;
303  pClock_ = NULL;
304  pBx_ = NULL;
305  pBy_ = NULL;
306  pBz_ = NULL;
307  dClock_ = 0.0;
308  dClockSigma_ = 0.0;
312  length_ = 0.0;
313 };
314 
315 
316 
317 // A destructor:
319 {
320  if (cbIndicator_)
321  delete cbIndicator_;
323  observables_.clear(); // not a owner of the pointers
324  numOfChanByCount_.clear();
325 };
326 
327 
328 
329 //
330 // INTERFACES:
331 //
332 //
334 {
335  return observables_;
336 };
337 
338 
339 
340 //
342 {
343  return cbd_total_wrms_;
344 };
345 
346 
347 
348 //
350 {
351  return meanGrDelResiduals_;
352 };
353 
354 
355 
356 //
358 {
360 };
361 
362 
363 
364 //
365 inline double SgVlbiBaselineInfo::getAuxSign() const
366 {
367  return auxSign_;
368 };
369 
370 
371 
372 //
374 {
375  return cbIndicator_;
376 };
377 
378 
379 
380 //
382 {
383  return pAux_;
384 };
385 
386 
387 
388 //
390 {
391  return pClock_;
392 };
393 
394 
395 
396 //
398 {
399  return pBx_;
400 };
401 
402 
403 
404 //
406 {
407  return pBy_;
408 };
409 
410 
411 
412 //
414 {
415  return pBz_;
416 };
417 
418 
419 
420 //
421 inline void SgVlbiBaselineInfo::setAuxSign(double s)
422 {
423  auxSign_ = s;
424 };
425 
426 
427 
428 //
429 // FUNCTIONS:
430 //
431 //
432 //
434 {
440 };
441 
442 
443 
444 
445 
446 
447 //
448 // FRIENDS:
449 //
450 //
451 //
452 
453 
454 /*=====================================================================================================*/
455 
456 
457 
458 
459 
460 /*=====================================================================================================*/
461 //
462 // aux functions:
463 //
464 
465 
466 /*=====================================================================================================*/
467 #endif //SG_VLBI_BASELINE_INFO_H
QMap< QString, SgVlbiBaselineInfo * >::iterator BaselinesByName_it
QMap< QString, SgVlbiBaselineInfo * > BaselinesByName
void delAttr(uint a)
Definition: SgAttribute.h:210
void addAttr(uint a)
Definition: SgAttribute.h:202
Definition: SgMJD.h:59
friend class SgVlbiBaselineInfo
Definition: SgObjectInfo.h:57
void resetAllEditings()
Definition: SgObjectInfo.h:595
void setLength(double l)
SgVlbiStationInfo * stn_2(QMap< QString, SgVlbiStationInfo * >) const
@ Attr_USE_IONO4GRD
use ionosphere corrections for group delays;
@ Attr_USE_IONO4PHD
use ionosphere corrections for phase delays;
@ Attr_ESTIMATE_CLOCKS
estimate baseline clocks;
@ Attr_NOT_VALID
omit the baseline;
@ Attr_SKIP_WC
do not make weight corrections for this baseline;
@ Attr_BIND_TROPOSPHERE
the troposphere parameters should be tied between the stations;
QList< SgVlbiObservable * > observables_
int getTypicalNumOfChannels() const
QMap< int, int > numOfChanByCount_
SgParameter *& pAux()
QMap< double, int > grdAmbigsBySpacing_
SgVlbiStationInfo * stn_1(QMap< QString, SgVlbiStationInfo * >) const
SgClockBreakIndicator * cbIndicator_
double dClockSigma() const
double getMeanGrDelResiduals() const
const QString & strPhdAmbigsStat() const
QList< SgVlbiObservable * > & observables()
bool loadIntermediateResults(QDataStream &)
SgParameter * pClock()
void calculateClockF1(SgTaskConfig *)
static const QString className()
bool saveIntermediateResults(QDataStream &) const
double getTypicalPhdAmbigSpacing() const
double getCbdTotalWrms() const
double getTypicalAmbigSpacing(SgTaskConfig::VlbiDelayType type) const
SgClockBreakIndicator * cbIndicator()
double getMeanGrDelResidualsSigma() const
const QMap< int, int > & numOfChanByCount() const
void setAuxSign(double s)
double getAuxSign() const
double getLength() const
QMap< double, int > phdAmbigsBySpacing_
const QString & strGrdAmbigsStat() const
void shiftAmbiguities(int deltaN)
double getTypicalGrdAmbigSpacing() const