General Purpose Geodetic Library
SgVlbiMeasurement.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 #include <iostream>
24 #include <stdlib.h>
25 
26 
27 #include <QtCore/QDataStream>
28 
29 
30 #include <SgLogger.h>
31 #include <SgTaskConfig.h>
32 #include <SgVlbiMeasurement.h>
33 
34 
35 
36 /*=======================================================================================================
37 *
38 * METHODS:
39 *
40 *======================================================================================================*/
41 //
42 // static first:
44 {
45  return "SgVlbiMeasurement";
46 };
47 
48 
49 
50 //
52 {
53  double d;
54  d = 1.0;
55  if (ionoSigma_ > 0.0) // ionosphere correction is on
56  d -= 2.0*q2_;
58 };
59 
60 
61 
62 //
64 {
66  numOfSubAmbigs_ = 0;
67  sigma2add_ = 0.0;
68  sigma2Apply_ = 0.0;
69  residual_ = 0.0;
70  residualNorm_ = 0.0;
71  ionoValue_ = 0.0;
72  ionoSigma_ = 0.0;
73 };
74 
75 
76 
77 //
78 void SgVlbiMeasurement::adjustAmbiguity(double closestResidual)
79 {
80  if (ambiguitySpacing_==0.0)
81  return;
82  int additionalNumAmbig;
83  additionalNumAmbig = round((residual_ - closestResidual)/ambiguitySpacing_);
84  residual_ -= additionalNumAmbig*ambiguitySpacing_;
85  numOfAmbiguities_ -= additionalNumAmbig;
86 };
87 
88 
89 
90 //
92 {
95  return s.status() == QDataStream::Ok;
96 };
97 
98 
99 
100 //
102 {
103  double sigma2add, sigma2Apply, residual, residualNorm;
104  double effFreq, effFreqEqWgt, q2, ionoValue, ionoSigma;
105  int numOfAmbiguities;
106  s >> sigma2add >> sigma2Apply >> residual >> residualNorm
107  >> effFreq >> effFreqEqWgt >> q2 >> ionoValue >> ionoSigma >> numOfAmbiguities;
108  if (s.status() == QDataStream::Ok)
109  {
110  sigma2add_ = sigma2add;
112  residual_ = residual;
113  residualNorm_ = residualNorm;
114  effFreq_ = effFreq;
115  effFreqEqWgt_ = effFreqEqWgt;
116  q2_ = q2;
117  ionoValue_ = ionoValue;
118  ionoSigma_ = ionoSigma;
119  numOfAmbiguities_ = numOfAmbiguities;
120  return true;
121  };
123  ": loadIntermediateResults(): error reading data for " + name_ + ": " +
124  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
125  return false;
126 };
127 /*=====================================================================================================*/
128 
129 
130 
131 
132 /*=====================================================================================================*/
133 //
134 // FRIENDS:
135 //
136 /*=====================================================================================================*/
137 //
138 
139 
140 
141 /*=====================================================================================================*/
142 //
143 // aux functions:
144 //
145 /*=====================================================================================================*/
146 
147 
148 /*=====================================================================================================*/
149 //
150 // statics:
151 //
152 /*=====================================================================================================*/
153 
154 
155 
156 
157 /*=====================================================================================================*/
SgLogger * logger
Definition: SgLogger.cpp:231
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_BIN
Definition: SgLogger.h:64
double sigma2Apply() const
bool saveIntermediateResults(QDataStream &) const
void adjustAmbiguity(double closestResidual=0.0)
static const QString className()
bool loadIntermediateResults(QDataStream &)
void setupSigma2Apply(const SgTaskConfig *)