General Purpose Geodetic Library
SgParametersDescriptor.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 <QtCore/QDataStream>
24 
25 
26 #include <SgConstants.h>
27 #include <SgLogger.h>
28 #include <SgMathSupport.h>
29 #include <SgParametersDescriptor.h>
30 
31 
32 
33 
35 /*=======================================================================================================
36 *
37 * METHODS:
38 *
39 *======================================================================================================*/
40 //
41 // static first:
43 {
44  return "SgParamatersDescriptor";
45 };
46 
47 
48 
49 //
51 {
52  return num_;
53 };
54 
55 
56 
57 //
59 {
60  //SgParameterCfg::SgParameterCfg(const QString& name,
61  // PMode pMode, SType sType,
62  // double convAPriori, double arcStep, double stocAPriori, double breakNoise, double tau,
63  // double whiteNoise, double pwlStep, double pwlAPriori, int pwlNumOfPolinomials,
64  // double scale, const QString& scaleName);
65  // Clock0()
66  parameters_[Idx_CLOCK_0] = SgParameterCfg("Clock offset",
68  1.0e24, 1.0/8, 1.0e8, 1.0e8, 1.0,
69  16.0, 1.0/24.0, 72.0*24.0, 3,
70  1.0e12, "ps");
71  // 5.0ps/hr as in SOLVE
72 
73  // Clock1()
74  parameters_[Idx_CLOCK_1] = SgParameterCfg("Clock trend",
76  1.0e24, 1.0, 1.0e8, 1.0e8, 1.0,
77  1.0, 1.0/24.0, 5.0*24.0, 1,
78  1.0e12, "ps/s");
79 
80  // Clock2()
81  parameters_[Idx_CLOCK_2] = SgParameterCfg("Clock 2-nd order",
83  1.0e24, 1.0, 1.0e8, 1.0e8, 1.0,
84  1.0, 1.0/24.0, 5.0*24.0, 1,
85  1.0e12, "ps/s/s");
86 
87  // Clock3()
88  parameters_[Idx_CLOCK_3] = SgParameterCfg("Clock 3-nd order",
90  1.0e24, 1.0, 1.0e8, 1.0e8, 1.0,
91  1.0, 1.0/24.0, 5.0*24.0, 1,
92  1.0e12, "ps/(s^3)");
93 
94  // Zenith
95  parameters_[Idx_ZENITH] = SgParameterCfg("Zenith delay",
97  1.0e6, 1.0/6, 1.0e4, 1.0e4, 1.0,
98  1.5, 1.0/24.0, 40.0e-12*24.0*vLight*100.0, 1,
99  1.0e2, "cm");
100  // 40ps/hr
101 
102  // AtmGrad
103  parameters_[Idx_ATMGRAD] = SgParameterCfg("Atmospheric gradients",
105  1.0e6, 1.0/4, 1.0e4, 1.0e4, 1.0,
106  0.06, 1.2, 1.0e-3*24.0*vLight*100, 1,
107  1.0e2, "cm");
108 // 0.06, 1.2, 0.5e-12*24.0*vLight*100, 1.0e2, "cm");
109  // .5ps/hr
110 
111  // Cable
112  parameters_[Idx_CABLE] = SgParameterCfg("Cable Calibration multiplier",
114  1.0e6, 1.0, 1.0e6, 1.0e6, 1.0,
115  1.0, 1.0/24.0, 1.0e6*24.0, 1,
116  1.0, "units");
117 
118  // AxisOffset
119  parameters_[Idx_AXISOFFSET] = SgParameterCfg("Axis offset",
121  1.0e6, 1.0, 1.0e6, 1.0e6, 1.0,
122  0.1, 1.0/24.0, 1.0e6*24.0, 1,
123  1.0e2, "cm");
124 
125  // StnCoo
126  parameters_[Idx_STNCOO] = SgParameterCfg("Stations coordinates",
128  1.0e8, 1.0, 1.0e6, 1.0e6, 1.0,
129  0.1, 1.0/24.0, 1.0e6*24.0, 1,
130  1.0e2, "cm");
131 
132  // StnVel
133  parameters_[Idx_STNVEL] = SgParameterCfg("Stations velocities",
135  1.0e7, 1.0, 1.0e7, 1.0e7, 1.0,
136  0.1, 1.0/24.0, 1.0e6*24.0, 1,
137  1.0e3, "mm/year");
138 
139  // SrcCoo
140  parameters_[Idx_SRCCOO] = SgParameterCfg("Sources coordinates",
142  1.0e8, 1.0, 1.0e8, 1.0e8, 1.0,
143  0.16, 1.0/24.0, 1.0e6*24.0, 1,
144  1.0e3*RAD2SEC, "mas");
145  // SrcSsm
146  parameters_[Idx_SRCSSM] = SgParameterCfg("Sources SSM",
148  1.0e8, 1.0, 1.0e8, 1.0e8, 1.0,
149  1.0, 1.0/24.0, 1.0e6*24.0, 1,
150  1.0, "unitless");
151 
152  // PolusXY
153  parameters_[Idx_POLUSXY] = SgParameterCfg("Polar motion, px and py",
155  1.0e8, 1.0/48.0, 1.0e4, 1.0e4, 1.0,
156  0.18, 1.0/24.0, 1.0e6*24.0, 1,
157  1.0e3*RAD2SEC, "mas");
158  // PolusXYRate
159  parameters_[Idx_POLUSXYR] = SgParameterCfg("Polar motion rates, pxr and pyr",
161  1.0e8, 1.0, 1.0e4, 1.0e4, 1.0,
162  0.18, 1.0/4.0, 1.0e6*24.0, 1,
163  1.0e3*RAD2SEC, "mas/day");
164 
165  // PolusUT1
166  parameters_[Idx_POLUSUT1] = SgParameterCfg("Earth rotation, d(UT1-UTC)",
168  1.0e8, 1.0, 1.0e4, 1.0e4, 1.0,
169  0.012, 1.0/24.0, 1.0e6*24.0, 1,
170  1.0e3*DAY2SEC, "ms");
171 
172  // PolusUT1Rate
173  parameters_[Idx_POLUSUT1R] = SgParameterCfg("Rate of Earth rotation, d(UT1-UTC) rate",
175  1.0e8, 1.0, 1.0e4, 1.0e4, 1.0,
176  0.012, 1.0/4.0, 1.0e6*24.0, 1,
177  1.0e3*DAY2SEC, "ms/d");
178 
179  // PolusNut
180  parameters_[Idx_POLUSNUT] = SgParameterCfg("Angles of nutation",
182  1.0e8, 1.0, 1.0e4, 1.0e4, 1.0,
183  0.18, 1.0/24.0, 1.0e6*24.0, 1,
184  1.0e3*RAD2SEC, "mas");
185 
186  // PolusNutRate
187  parameters_[Idx_POLUSNUTR] = SgParameterCfg("Rates of angles of nutation",
189  1.0e8, 1.0, 1.0e4, 1.0e4, 1.0,
190  0.18, 1.0/4.0, 1.0e6*24.0, 1,
191  1.0e3*RAD2SEC, "mas/day");
192 
193  parameters_[Idx_BL_CLK] = SgParameterCfg("Baseline clock offset",
195  1.0e8, 1.0, 1.0e8, 1.0e8, 1.0,
196  16.0, 1.0/24.0, 72.0*24.0, 1,
197  1.0e12, "ps");
198 
199  parameters_[Idx_BL_LENGTH] = SgParameterCfg("Baseline vector",
201  1.0e8, 1.0, 1.0e6, 1.0e6, 1.0,
202  0.1, 1.0/24.0, 1.0e6*24.0, 1,
203  1.0e2, "cm");
204 
205  // Test
206  parameters_[Idx_TEST] = SgParameterCfg("Test parameter",
208  1.0e10, 1.0, 1.0e10, 1.0e10, 1.0,
209  1.0, 1.0/24.0, 1.0e6*24.0, 1,
210  1.0, "units");
211 
212 //SgParameterCfg::SgParameterCfg(const QString& name, PMode pMode, SType sType,
213 // double convAPriori, double arcStep, double stocAPriori, double breakNoise, double tau,
214 // double whiteNoise, double pwlStep, double pwlAPriori, int pwlNumOfPolynomials,
215 // double scale, const QString& scaleName)
216 };
217 
218 
219 
220 //
222 {
223  for (int i=0; i<num(); i++)
225 };
226 
227 
228 
229 //
231 {
232  parameters_[idx].setPMode(mode);
233 };
234 
235 
236 
237 //
239 {
241 };
242 
243 
244 
245 //
247 {
248  for (int i=0; i<idxs.size(); i++)
249  parameters_[idxs.at(i)].setPMode(mode);
250 };
251 
252 
253 
254 //
256 {
257  for (int i=0; i<idxs.size(); i++)
259 };
260 
261 
262 
263 //
265 {
266  for (int i=0; i<num(); i++)
267  {
269  if (s.status() != QDataStream::Ok)
270  {
272  ": saveIntermediateResults(): error writting data #" + QString("").setNum(i));
273  return false;
274  };
275  };
276  if (s.status() != QDataStream::Ok)
277  {
279  ": saveIntermediateResults(): error writting data");
280  return false;
281  };
282  return s.status() == QDataStream::Ok;
283 };
284 
285 
286 
287 //
289 {
290  for (int i=0; i<num(); i++)
291  {
293  if (s.status() != QDataStream::Ok)
294  {
296  ": loadIntermediateResults(): error writting data #" + QString("").setNum(i) + ": " +
297  (s.status()==QDataStream::ReadPastEnd?"read past end of the file":"read corrupt data"));
298  return false;
299  };
300  };
301  //
302  return s.status()==QDataStream::Ok;
303 };
304 /*=======================================================================================================
305 *
306 * FRIENDS:
307 *
308 *======================================================================================================*/
309 //
310 
311 
312 
313 /*=====================================================================================================*/
314 //
315 // aux functions:
316 //
317 
318 
319 // i/o:
320 
321 
322 /*=====================================================================================================*/
323 //
324 // constants:
325 //
326 
327 
328 /*=====================================================================================================*/
const double vLight
Definition: SgConstants.cpp:33
SgLogger * logger
Definition: SgLogger.cpp:231
#define DAY2SEC
radians to mas:
Definition: SgMathSupport.h:56
#define RAD2SEC
seconds in one day:
Definition: SgMathSupport.h:52
#define NUMBER_OF_KNOWN_PARAMETER_SPECIES
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_BIN
Definition: SgLogger.h:64
bool saveIntermediateResults(QDataStream &) const
bool loadIntermediateResults(QDataStream &)
void setPMode(PMode mode)
void unsetParameters(const QList< ParIdx > &)
bool saveIntermediateResults(QDataStream &) const
static const QString className()
void setMode4Parameter(SgParameterCfg::PMode, ParIdx)
bool loadIntermediateResults(QDataStream &)
void setMode4Parameters(SgParameterCfg::PMode, const QList< ParIdx > &)
@ Idx_SRCCOO
index for source coordinates
@ Idx_POLUSXY
index for EOP: polar motion
@ Idx_POLUSXYR
index for EOP: polar motion
@ Idx_CLOCK_1
index for clocks (order #1)
@ Idx_CLOCK_3
index for clocks (order #3)
@ Idx_STNCOO
index for station coordinates
@ Idx_POLUSUT1R
index for EOP: d(UT1-UTC) Rate
@ Idx_ATMGRAD
index for atmospheric gradients
@ Idx_CLOCK_2
index for clocks (order #2)
@ Idx_POLUSNUT
index for EOP: nutation angles
@ Idx_POLUSUT1
index for EOP: d(UT1-UTC)
@ Idx_CABLE
index for cable corrections
@ Idx_POLUSNUTR
index for EOP: nutation angles
@ Idx_TEST
index for test purposes
@ Idx_BL_CLK
index for baseline clocks
@ Idx_STNVEL
index for station velocities
@ Idx_SRCSSM
index for source SSM
@ Idx_BL_LENGTH
index for baseline length
@ Idx_ZENITH
index for wet zenith delay
@ Idx_CLOCK_0
index for clocks (order #0)
@ Idx_AXISOFFSET
index for axis offset
SgParameterCfg parameters_[NUMBER_OF_KNOWN_PARAMETER_SPECIES]