General Purpose Geodetic Library
SgVlbiMeasurement.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) 2013-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_MEASUREMENT_H
24 #define SG_VLBI_MEASUREMENT_H
25 
26 
27 #ifdef HAVE_CONFIG_H
28 # include <config.h>
29 #endif
30 
31 #include <QtCore/QString>
32 
33 #include <math.h>
34 
35 
36 #include <SgTaskConfig.h>
37 
38 
39 // #define SAS 310.0e-12
40 
41 const double dSas = 310.0e-12;
42 
43 
44 class QDataStream;
45 
46 class SgTaskConfig;
47 
48 /***===================================================================================================*/
55 {
56 public:
57  //
58  // constructors/destructors:
59  //
63  inline SgVlbiMeasurement(const QString& name, SgTaskConfig::VlbiDelayType delayType,
65 
69  inline SgVlbiMeasurement(const SgVlbiMeasurement&);
70 
74  inline ~SgVlbiMeasurement();
75 
76 
77 
78  //
79  // Interfaces:
80  //
81  // gets:
84  inline const QString& getName() const;
85 
88 
91  inline double getValue() const;
92  inline double getAlternateValue() const;
93 
96  inline double getGeocenterValue() const;
97 
100  inline double getAmbiguitySpacing() const;
101  inline double getSubAmbigSpacing() const {return subAmbigSpacing_;};
102 
105  inline int getNumOfAmbiguities() const;
106  inline int getNumOfSubAmbigs() const {return numOfSubAmbigs_;};
107 
110  inline double getSigma() const;
111 
114  inline double getSigma2add() const;
115 
118  inline double sigma2Apply() const;
119 
122  inline double getResidual() const;
123 
124  inline double getResidualFringeFitting() const {return residualFringeFitting_;};
127  inline double getResidualNorm() const;
128 
131  inline short int getUnweightFlag() const;
132 
135  inline double getEffFreq() const;
136  inline double getEffFreqEqWgt() const;
137 
140  inline double getQ2() const;
141 
144  inline double getIonoValue() const;
145 
148  inline double getIonoSigma() const;
149 
150 
151  // sets:
154  inline void setValue(double);
155  inline void setAlternateValue(double);
156 
159  inline void setGeocenterValue(double);
160 
163  inline void setAmbiguitySpacing(double);
164  inline void setSubAmbigSpacing(double s) {subAmbigSpacing_ = s;};
165 
168  inline void setNumOfAmbiguities(int);
169  inline void setNumOfSubAmbigs(int n) {numOfSubAmbigs_ = n;};
170 
173  inline void setSigma(double);
174 
177  inline void setSigma2add(double);
178 
181  inline void setResidual(double);
182 
183  inline void setResidualFringeFitting(double r) {residualFringeFitting_ = r;};
184 
187  inline void setResidualNorm(double);
188 
191  inline void setUnweightFlag(short int);
192 
195  inline void setEffFreq(double);
196  inline void setEffFreqEqWgt(double);
197 
200  inline void setQ2(double);
201 
204  inline void setIonoValue(double);
205 
208  inline void setIonoSigma(double);
209 
210 
211  //
212  // Functions:
213  //
214  //
217  static const QString className();
218 
219  //
220  inline void zerofy();
221 
222  //
223  inline void zerofyIono();
224 
227  inline double ambiguity() const;
228  inline double subAmbig() const;
229 
230  void adjustAmbiguity(double closestResidual=0.0);
231 
232 
235  void setupSigma2Apply(const SgTaskConfig*);
236 
237  void resetAllEditings();
238 
239 
240  // I/O:
241  //
243 
245 
246 
247 private:
248  // name:
249  const QString name_;
252  // measurement:
253  double value_;
255  double sigma_;
261  // aux sigmas:
262  double sigma2add_;
263  double sigma2Apply_;
264  // residuals:
265  double residual_;
268  //
269  short int unweightFlag_;
270  // ionospheric stuff:
271  double effFreq_;
273  double q2_;
274  double ionoValue_;
275  double ionoSigma_;
276  //
277 };
278 /*=====================================================================================================*/
279 
280 
281 
282 
283 /*=====================================================================================================*/
284 /* */
285 /* SgVlbiMbandObservation inline members: */
286 /* */
287 /*=====================================================================================================*/
288 //
289 //
290 // CONSTRUCTORS:
291 //
292 // An empty constructor:
294  SgTaskConfig::VlbiRateType rateType) :
295  name_(name)
296 {
297  delayType_ = delayType;
298  rateType_ = rateType;
299  value_ = 0.0;
300  alternateValue_ = 0.0;
301  geocenterValue_ = 0.0;
302  ambiguitySpacing_ = 0.0;
303  numOfAmbiguities_ = 0;
304 // subAmbigSpacing_ = 310.0e-12; //0.0;
305 // subAmbigSpacing_ = 160.0e-12; //0.0;
306  subAmbigSpacing_ = dSas; //0.0;
307  numOfSubAmbigs_ = 0;
308 
309  sigma_ = 0.0;
310  sigma2add_ = 0.0;
311  sigma2Apply_ = 0.0;
312  residual_ = 0.0;
314  residualNorm_ = 0.0;
315  unweightFlag_ = 0;
316  effFreq_ = effFreqEqWgt_ = 0.0;
317  q2_ = 0.0;
318  ionoValue_ = 0.0;
319  ionoSigma_ = 0.0;
320 };
321 
322 
323 
324 //
326  name_(m.getName()),
327  delayType_(m.delayType_),
328  rateType_(m.rateType_)
329 {
330  setValue(m.getValue());
335 
338 
339  setSigma(m.getSigma());
346  setEffFreq(m.getEffFreq());
348  setQ2(m.getQ2());
351 };
352 
353 
354 
355 // A destructor:
357 {
358 };
359 
360 
361 
362 //
363 // INTERFACES:
364 //
365 //
366 // Gets:
367 //
368 inline const QString& SgVlbiMeasurement::getName() const
369 {
370  return name_;
371 };
372 
373 
374 
375 //
376 inline double SgVlbiMeasurement::getValue() const
377 {
378  return value_;
379 };
380 
381 
382 
383 //
385 {
386  return alternateValue_;
387 };
388 
389 
390 
391 //
393 {
394  return geocenterValue_;
395 };
396 
397 
398 
399 //
401 {
402  return ambiguitySpacing_;
403 };
404 
405 
406 
407 //
409 {
410  return numOfAmbiguities_;
411 };
412 
413 
414 
415 //
416 inline double SgVlbiMeasurement::getSigma() const
417 {
418  return sigma_;
419 };
420 
421 
422 
423 //
424 inline double SgVlbiMeasurement::getSigma2add() const
425 {
426  return sigma2add_;
427 };
428 
429 
430 
431 //
432 inline double SgVlbiMeasurement::sigma2Apply() const
433 {
434  return sigma2Apply_;
435 };
436 
437 
438 
439 //
440 inline double SgVlbiMeasurement::getResidual() const
441 {
442  return residual_;
443 };
444 
445 
446 
447 //
449 {
450  return residualNorm_;
451 };
452 
453 
454 
455 //
456 inline short int SgVlbiMeasurement::getUnweightFlag() const
457 {
458  return unweightFlag_;
459 };
460 
461 
462 
463 //
464 inline double SgVlbiMeasurement::getEffFreq() const
465 {
466  return effFreq_;
467 };
468 
469 
470 
471 //
473 {
474  return effFreqEqWgt_;
475 };
476 
477 
478 
479 //
480 inline double SgVlbiMeasurement::getQ2() const
481 {
482  return q2_;
483 };
484 
485 
486 
487 //
488 inline double SgVlbiMeasurement::getIonoValue() const
489 {
490  return ionoValue_;
491 };
492 
493 
494 
495 //
496 inline double SgVlbiMeasurement::getIonoSigma() const
497 {
498  return ionoSigma_;
499 };
500 
501 
502 
503 
504 // Sets:
505 //
506 inline void SgVlbiMeasurement::setValue(double v)
507 {
508  value_ = v;
509 };
510 
511 
512 
513 //
515 {
516  alternateValue_ = v;
517 };
518 
519 
520 
521 //
523 {
524  geocenterValue_ = v;
525 };
526 
527 
528 
529 //
531 {
532  ambiguitySpacing_ = a;
533 };
534 
535 
536 
537 //
539 {
540  numOfAmbiguities_ = n;
541 };
542 
543 
544 
545 //
546 inline void SgVlbiMeasurement::setSigma(double s)
547 {
548  sigma_ = s;
549 };
550 
551 
552 
553 //
554 inline void SgVlbiMeasurement::setSigma2add(double s)
555 {
556  sigma2add_ = s;
557 };
558 
559 
560 
561 //
562 //inline void SgVlbiMeasurement::setSigmaApplied(double s)
563 //{
564 // sigmaApplied_ = s;
565 //};
566 
567 
568 
569 //
570 inline void SgVlbiMeasurement::setResidual(double r)
571 {
572  residual_ = r;
573 };
574 
575 
576 
577 //
579 {
580  residualNorm_ = r;
581 };
582 
583 
584 
585 //
586 inline void SgVlbiMeasurement::setUnweightFlag(short int f)
587 {
588  unweightFlag_ = f;
589 };
590 
591 
592 
593 //
594 inline void SgVlbiMeasurement::setEffFreq(double f)
595 {
596  effFreq_ = f;
597 };
598 
599 
600 
601 //
603 {
604  effFreqEqWgt_ = f;
605 };
606 
607 
608 
609 //
610 inline void SgVlbiMeasurement::setQ2(double q)
611 {
612  q2_ = q;
613 };
614 
615 
616 
617 //
618 inline void SgVlbiMeasurement::setIonoValue(double v)
619 {
620  ionoValue_ = v;
621 };
622 
623 
624 
625 //
626 inline void SgVlbiMeasurement::setIonoSigma(double s)
627 {
628  ionoSigma_ = s;
629 };
630 
631 
632 
633 
634 //
635 // FUNCTIONS:
636 //
637 //
639 {
640  value_ = 0.0;
641  alternateValue_ = 0.0;
642  geocenterValue_ = 0.0;
643  ambiguitySpacing_ = 0.0;
644  numOfAmbiguities_ = 0;
645 // subAmbigSpacing_ = 310.0e-12;
646 // subAmbigSpacing_ = 160.0e-12;
648  numOfSubAmbigs_ = 0;
649  sigma_ = 0.0;
650  sigma2add_ = 0.0;
651  sigma2Apply_ = 0.0;
652  residual_ = 0.0;
653  residualNorm_ = 0.0;
654  unweightFlag_ = 0;
655  effFreq_ = effFreqEqWgt_ = 0.0;
656  q2_ = 0.0;
657  ionoValue_ = 0.0;
658  ionoSigma_ = 0.0;
659 };
660 
661 
662 
663 //
665 {
666  ionoValue_ = 0.0;
667  ionoSigma_ = 0.0;
668 };
669 
670 
671 
672 //
673 inline double SgVlbiMeasurement::ambiguity() const
674 {
676 };
677 
678 
679 
680 //
681 inline double SgVlbiMeasurement::subAmbig() const
682 {
684 };
685 /*=====================================================================================================*/
686 
687 
688 
689 
690 /*=====================================================================================================*/
691 #endif // SG_VLBI_MEASUREMENT_H
const double dSas
void setAmbiguitySpacing(double)
double sigma2Apply() const
double getEffFreq() const
double getGeocenterValue() const
void setEffFreqEqWgt(double)
bool saveIntermediateResults(QDataStream &) const
short int getUnweightFlag() const
void setIonoSigma(double)
double getAmbiguitySpacing() const
void setNumOfSubAmbigs(int n)
void setEffFreq(double)
void setResidual(double)
double ambiguity() const
double subAmbig() const
void adjustAmbiguity(double closestResidual=0.0)
void setNumOfAmbiguities(int)
double getValue() const
void setIonoValue(double)
SgTaskConfig::VlbiRateType getRateType() const
double getQ2() const
static const QString className()
void setSigma2add(double)
int getNumOfAmbiguities() const
bool loadIntermediateResults(QDataStream &)
double getSigma() const
void setResidualNorm(double)
double getIonoValue() const
double getSubAmbigSpacing() const
SgTaskConfig::VlbiDelayType getDelayType() const
void setResidualFringeFitting(double r)
double getEffFreqEqWgt() const
void setGeocenterValue(double)
double getSigma2add() const
double getResidual() const
double getResidualFringeFitting() const
int getNumOfSubAmbigs() const
const QString & getName() const
SgTaskConfig::VlbiDelayType delayType_
double getAlternateValue() const
void setupSigma2Apply(const SgTaskConfig *)
double getResidualNorm() const
void setUnweightFlag(short int)
void setAlternateValue(double)
double getIonoSigma() const
void setSubAmbigSpacing(double s)
SgTaskConfig::VlbiRateType rateType_
SgVlbiMeasurement(const QString &name, SgTaskConfig::VlbiDelayType delayType, SgTaskConfig::VlbiRateType rateType)