General Purpose Geodetic Library
SgVlbiSessionIoVdbInput.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 <SgVlbiSession.h>
28 
29 #include <SgConstants.h>
30 #include <SgEccRec.h>
31 #include <SgLogger.h>
32 #include <SgVgosDb.h>
33 #include <SgVlbiBand.h>
34 #include <SgVlbiObservation.h>
35 
36 
37 
38 // to do: add ACM
39 
40 
41 
42 
43 
44 /*=======================================================================================================
45 *
46 * Auxiliary data structures
47 *
48 *======================================================================================================*/
49 
50 
51 /*=======================================================================================================
52 *
53 * I/O utilities:
54 *
55 *======================================================================================================*/
56 //
57 bool SgVlbiSession::getDataFromVgosDb(SgVgosDb* vgosDb, bool have2LoadImmatureSession, bool guiExpected)
58 {
59  SgMJD startEpoch(SgMJD::currentMJD());
60  bool isOk(false);
61  QString kind("");
62  //
63  const QString sMntTypes[]={"AZEL", "EQUA", "X_YN", "X_YE", "RICHMOND", "UNKN"};
64  int numOfObs;
65  int numOfUserCorrections;
66  // 4 cleaning:
67  QList<SgVector*> vectors2del;
68  QList<SgMatrix*> matrices2del;
69  //
70  QList<SgMJD> epochs4Scans;
71  QList<SgMJD> epochs4Obs;
72  QList<QString> stations_1, stations_2, sources;
73  SgVector *calcDelays=NULL, *calcRates=NULL, *fractC=NULL;
74 
75  SgVector *dTec, *dTecStdDev;
76 
77  QMap<QString, SgMatrix*> singleBandDelaysByBand, groupDelaysByBand, ratesByBand, phasesByBand,
78  uvByBand, calFeedCorrByBand, effFreqsByBand,
79  ionCalsByBand, ionSigmasByBand,
80  phaseCals_1ByBand, phaseCals_2ByBand;
81  QMap<QString, SgMatrix*> phaseCalFreqs_1ByBand, phaseCalAmps_1ByBand,
82  phaseCalPhases_1ByBand, phaseCalOffsets_1ByBand,
83  phaseCalFreqs_2ByBand, phaseCalAmps_2ByBand,
84  phaseCalPhases_2ByBand, phaseCalOffsets_2ByBand;
85 
86  QMap<QString, SgVector*> ambigsByBand, refFreqsByBand, correlationByBand, snrByBand,
87  phaseCalRates_1ByBand, phaseCalRates_2ByBand;
88  QMap<QString, QVector<QString> >
89  qCodesByBand;
90  QMap<QString, QVector<int> > numAmbigsByBand, numSubAmbigsByBand, numPhsAmbigsByBand,
91  ionDataFlagByBand, dataFlagByBand;
92  //
93  // correlator info stuff:
94  QMap<QString, QVector<QString> >
95  fourfitOutputFNameByBand, fourfitErrorCodesByBand,
96  baselineCodesByBand,
97  tapeQualityCodesByBand, vlb1FileNamesByBand, tapeIds_1ByBand,
98  tapeIds_2ByBand;
99  QMap<QString, QVector<int> > startOffsetsByBand, stopOffsetsByBand,
100  hopsRevisionNumbersByBand;
101  QMap<QString, QVector< QVector<int> > >
102  fourfitVersionsByBand, epochsOfCorrelationsByBand,
103  epochsOfCentralsByBand, epochsOfFourfitingsByBand,
104  epochsOfNominalScanTimeByBand;
105  QMap<QString, SgVector*> deltaEpochsByBand, smplRateByBand, sbdResidsByBand, rateResidsByBand,
106  effDurationsByBand, startSecondsByBand, stopSecondsByBand,
107  percentOfDiscardsByBand, uniformityFactorsByBand,
108  geocenterPhaseResidsByBand, geocenterPhaseTotalsByBand,
109  geocenterSbDelaysByBand, geocenterGrDelaysByBand,
110  geocenterDelayRatesByBand, probOfFalsesByBand, corrAprioriDelaysByBand,
111  corrAprioriRatesByBand, corrAprioriAccsByBand, incohAmpsByBand,
112  incohAmps2ByBand, delayResidsByBand;
113  QMap<QString, SgMatrix*> urvrsByBand, instrDelaysByBand, searchParamsByBand, corrClocksByBand,
114  mDlysByBand, mAuxByBand, starElevByBand, zenithDelaysByBand;
115  // eocis
116  //
117  QMap<QString, QVector<QString> >
118  fourfitControlFileByBand, fourfitCommandByBand;
119  QMap<QString, QVector<int> > numLagsByBand;
120  QMap<QString, QVector<double> >
121  apLengthByBand;
122 
123  // channel infos:
124  QMap<QString, QVector<QString> >
125  channelIdsByBand, polarizationsByBand;
126  QMap<QString, QVector<int> > numOfChannelsByBand, bitsPerSamplesByBand;
127 
128  QMap<QString, QVector< QVector<int> > >
129  errorRates_1ByBand, errorRates_2ByBand, bbcIdxs_1ByBand, bbcIdxs_2ByBand,
130  corelIdxNumbersUsbByBand, corelIdxNumbersLsbByBand;
131  QMap<QString, SgVector* > sampleRateByBand;
132  QMap<QString, SgMatrix* > residFringeAmplByChanByBand, residFringePhseByChanByBand,
133  refFreqByChanByBand,
134  numOfSamplesByChan_USBByBand, numOfSamplesByChan_LSBByBand,
135  numOfAccPeriodsByChan_USBByBand, numOfAccPeriodsByChan_LSBByBand,
136  loFreqs_1ByBand, loFreqs_2ByBand;
137  // eoci
138 
139  QList<QString> listOfBands;
140 
142 
143  dTec = dTecStdDev = NULL;
144 
145  setName(vgosDb->getSessionName());
146  setSessionCode(vgosDb->getSessionCode());
147  setInputDriver(vgosDb);
148 
149  //
150  networkSuffix_ = name_.mid(8, 1); // need to make proper name handling..
151 
152  listOfBands = vgosDb->getListOfBands();
153 
154  // fix it later:
155  if (vgosDb->hasBand("X"))
157  "::getDataFromVgosDb(): found data for X-band");
158  else
160  "::getDataFromVgosDb(): no data for X-band have been found: " + name_);
161  if (vgosDb->hasBand("S"))
163  "::getDataFromVgosDb(): found data for S-band");
164  else
166  "::getDataFromVgosDb(): no data for S-band have been found: " + name_);
167  //
168  for (int i=0; i<listOfBands.size(); i++)
169  {
170  const QString &bandKey=listOfBands.at(i);
171  singleBandDelaysByBand .insert(bandKey, NULL);
172  groupDelaysByBand .insert(bandKey, NULL);
173  ratesByBand .insert(bandKey, NULL);
174  phasesByBand .insert(bandKey, NULL);
175  ionCalsByBand .insert(bandKey, NULL);
176  ionSigmasByBand .insert(bandKey, NULL);
177  phaseCals_1ByBand .insert(bandKey, NULL);
178  phaseCals_2ByBand .insert(bandKey, NULL);
179  phaseCalFreqs_1ByBand .insert(bandKey, NULL);
180  phaseCalFreqs_2ByBand .insert(bandKey, NULL);
181  phaseCalAmps_1ByBand .insert(bandKey, NULL);
182  phaseCalAmps_2ByBand .insert(bandKey, NULL);
183  phaseCalPhases_1ByBand .insert(bandKey, NULL);
184  phaseCalPhases_2ByBand .insert(bandKey, NULL);
185  phaseCalOffsets_1ByBand .insert(bandKey, NULL);
186  phaseCalOffsets_2ByBand .insert(bandKey, NULL);
187  phaseCalRates_1ByBand .insert(bandKey, NULL);
188  phaseCalRates_2ByBand .insert(bandKey, NULL);
189 
190  effFreqsByBand .insert(bandKey, NULL);
191  refFreqsByBand .insert(bandKey, NULL);
192  correlationByBand .insert(bandKey, NULL);
193  uvByBand .insert(bandKey, NULL);
194  calFeedCorrByBand .insert(bandKey, NULL);
195  snrByBand .insert(bandKey, NULL);
196  ambigsByBand .insert(bandKey, NULL);
197 
198  qCodesByBand .insert(bandKey, QVector<QString>());
199  // correlator info stuff:
200  fourfitOutputFNameByBand .insert(bandKey, QVector<QString>());
201  fourfitErrorCodesByBand .insert(bandKey, QVector<QString>());
202  baselineCodesByBand .insert(bandKey, QVector<QString>());
203  tapeQualityCodesByBand .insert(bandKey, QVector<QString>());
204  vlb1FileNamesByBand .insert(bandKey, QVector<QString>());
205  tapeIds_1ByBand .insert(bandKey, QVector<QString>());
206  tapeIds_2ByBand .insert(bandKey, QVector<QString>());
207 // corelVersionsByBand .insert(bandKey, QVector<int>());
208  startOffsetsByBand .insert(bandKey, QVector<int>());
209  stopOffsetsByBand .insert(bandKey, QVector<int>());
210  hopsRevisionNumbersByBand .insert(bandKey, QVector<int>());
211  fourfitVersionsByBand .insert(bandKey, QVector< QVector<int> >());
212 // dbeditVersionByBand .insert(bandKey, QVector< QVector<int> >());
213  epochsOfCorrelationsByBand .insert(bandKey, QVector< QVector<int> >());
214  epochsOfCentralsByBand .insert(bandKey, QVector< QVector<int> >());
215  epochsOfFourfitingsByBand .insert(bandKey, QVector< QVector<int> >());
216  epochsOfNominalScanTimeByBand .insert(bandKey, QVector< QVector<int> >());
217  deltaEpochsByBand .insert(bandKey, NULL);
218  smplRateByBand .insert(bandKey, NULL);
219  sbdResidsByBand .insert(bandKey, NULL);
220  rateResidsByBand .insert(bandKey, NULL);
221  effDurationsByBand .insert(bandKey, NULL);
222  startSecondsByBand .insert(bandKey, NULL);
223  stopSecondsByBand .insert(bandKey, NULL);
224  percentOfDiscardsByBand .insert(bandKey, NULL);
225  uniformityFactorsByBand .insert(bandKey, NULL);
226  geocenterPhaseResidsByBand .insert(bandKey, NULL);
227  geocenterPhaseTotalsByBand .insert(bandKey, NULL);
228  geocenterSbDelaysByBand .insert(bandKey, NULL);
229  geocenterGrDelaysByBand .insert(bandKey, NULL);
230  geocenterDelayRatesByBand .insert(bandKey, NULL);
231  probOfFalsesByBand .insert(bandKey, NULL);
232  corrAprioriDelaysByBand .insert(bandKey, NULL);
233  corrAprioriRatesByBand .insert(bandKey, NULL);
234  corrAprioriAccsByBand .insert(bandKey, NULL);
235  incohAmpsByBand .insert(bandKey, NULL);
236  incohAmps2ByBand .insert(bandKey, NULL);
237  delayResidsByBand .insert(bandKey, NULL);
238  urvrsByBand .insert(bandKey, NULL);
239  instrDelaysByBand .insert(bandKey, NULL);
240  starElevByBand .insert(bandKey, NULL);
241  zenithDelaysByBand .insert(bandKey, NULL);
242  searchParamsByBand .insert(bandKey, NULL);
243  corrClocksByBand .insert(bandKey, NULL);
244  mDlysByBand .insert(bandKey, NULL);
245  mAuxByBand .insert(bandKey, NULL);
246  // EoCIS
247 
248  fourfitControlFileByBand .insert(bandKey, QVector<QString>());
249  fourfitCommandByBand .insert(bandKey, QVector<QString>());
250  numLagsByBand .insert(bandKey, QVector<int>());
251  apLengthByBand .insert(bandKey, QVector<double>());
252 
253  numAmbigsByBand .insert(bandKey, QVector<int>());
254  numSubAmbigsByBand .insert(bandKey, QVector<int>());
255  numPhsAmbigsByBand .insert(bandKey, QVector<int>());
256  dataFlagByBand .insert(bandKey, QVector<int>());
257  ionDataFlagByBand .insert(bandKey, QVector<int>());
258 
259  // channel infos:
260  channelIdsByBand .insert(bandKey, QVector<QString>());
261  polarizationsByBand .insert(bandKey, QVector<QString>());
262  numOfChannelsByBand .insert(bandKey, QVector<int>());
263  bitsPerSamplesByBand .insert(bandKey, QVector<int>());
264 
265  errorRates_1ByBand .insert(bandKey, QVector< QVector<int> >());
266  errorRates_2ByBand .insert(bandKey, QVector< QVector<int> >());
267  bbcIdxs_1ByBand .insert(bandKey, QVector< QVector<int> >());
268  bbcIdxs_2ByBand .insert(bandKey, QVector< QVector<int> >());
269  corelIdxNumbersUsbByBand .insert(bandKey, QVector< QVector<int> >());
270  corelIdxNumbersLsbByBand .insert(bandKey, QVector< QVector<int> >());
271 
272  sampleRateByBand .insert(bandKey, NULL);
273  residFringeAmplByChanByBand .insert(bandKey, NULL);
274  residFringePhseByChanByBand .insert(bandKey, NULL);
275  refFreqByChanByBand .insert(bandKey, NULL);
276  numOfSamplesByChan_USBByBand .insert(bandKey, NULL);
277  numOfSamplesByChan_LSBByBand .insert(bandKey, NULL);
278  numOfAccPeriodsByChan_USBByBand .insert(bandKey, NULL);
279  numOfAccPeriodsByChan_LSBByBand .insert(bandKey, NULL);
280  loFreqs_1ByBand .insert(bandKey, NULL);
281  loFreqs_2ByBand .insert(bandKey, NULL);
282 
283  };
284 
285  if (!vgosDb->loadEpochs4Scans(epochs4Scans))
286  return false;
287  if (!vgosDb->loadEpochs4Obs(epochs4Obs))
288  return false;
289 
290  numOfObs = epochs4Obs.size();
291 
292  // get general info:
293  if (!vgosDb->loadObsObjectNames(stations_1, stations_2, sources))
294  return false;
295  if (!vgosDb->loadObsTheoreticals(calcDelays, calcRates))
296  {
298  "::getDataFromVgosDb(): cannot find precalculated delays and rates");
300  }
301  else
303 
304  //
305  if (!vgosDb->loadObsFractC(fractC))
306  {
308  "::getDataFromVgosDb(): cannot find fractC");
309  };
310  //
311 
312  vectors2del << calcDelays << calcRates << fractC;
313 
314  isOk = true;
315 
316  //
317  //
318  //
319  // deal with Header:
320  QString correlatorType(""), correlatorName(""), piName(""), experimentName(""),
321  experimentDescription(""), recordingMode("");
322  QList<QString> declStations, declSources;
323  SgMJD tStart, tFinis;
324  int sftIdx(-1), experimentSerialNumber(-1);
325  if (!vgosDb->loadSessionHead(correlatorType, correlatorName, piName, experimentName,
326  experimentSerialNumber, experimentDescription, recordingMode, declStations, declSources,
327  tStart, tFinis, sftIdx))
328  {
330  "::getDataFromVgosDb(): cannot use the data because of missed info: Head");
331  isOk = false;
332  };
333  setCorrelatorType(correlatorType);
334  setCorrelatorName(correlatorName);
335  setPiAgencyName(piName);
336  setDescription(experimentDescription);
337  if (0 < experimentSerialNumber)
338  setExperimentSerialNumber(experimentSerialNumber);
339  setRecordingMode(recordingMode);
340  declStations.clear();
341  declSources.clear();
342  if (0 <= sftIdx)
344  // end of Header
345 
346 
347  // "Obs" dir:
348  for (int i=0; i<listOfBands.size(); i++)
349  {
350  const QString &bandKey=listOfBands.at(i);
351  if (!vgosDb->loadObsSingleBandDelays(bandKey, singleBandDelaysByBand[bandKey]))
352  {
354  "::getDataFromVgosDb(): the data are hardly usable because of missed info: SB Delays for " +
355  bandKey + "-band");
356  /*
357  if (vgosDb->getCorrelatorType() != SgVgosDb::CT_Unknown)
358  isOk = false;
359  */
360  };
361  if (!vgosDb->loadObsGroupDelays(bandKey, groupDelaysByBand[bandKey]))
362  {
364  "::getDataFromVgosDb(): cannot use data because of missed info: Group Delays for " +
365  bandKey + "-band");
366  isOk = false;
367  };
368  if (!vgosDb->loadObsRates(bandKey, ratesByBand[bandKey]))
369  {
371  "::getDataFromVgosDb(): cannot use data because of missed info: Rates for " +
372  bandKey + "-band");
373  // isOk = false;
374  };
375  vgosDb->loadObsPhase(bandKey, phasesByBand[bandKey]);
376  if (!vgosDb->loadObsRefFreqs(bandKey, refFreqsByBand[bandKey]))
377  {
379  "::getDataFromVgosDb(): cannot use data because of missed info: Ref Freqs for " +
380  bandKey + "-band");
381  isOk = false;
382  };
383  vgosDb->loadObsEffFreqs(bandKey, effFreqsByBand[bandKey]);
384 
385  if (!vgosDb->loadObsAmbigSpacing(bandKey, ambigsByBand[bandKey]))
386  {
388  "::getDataFromVgosDb(): cannot use data because of missed info: Ambig Spacing for " +
389  bandKey + "-band");
390  // isOk = false;
391  };
392  if (!vgosDb->loadObsQualityCodes(bandKey, qCodesByBand[bandKey]))
393  {
395  "::getDataFromVgosDb(): cannot use data because of missed info: Quality Codes for " +
396  bandKey + "-band");
397  // isOk = false;
398  };
399  if (!vgosDb->loadObsCorrelation(bandKey, correlationByBand[bandKey]) && !have2LoadImmatureSession)
400  {
402  "::getDataFromVgosDb(): cannot use data because of missed info: Correlation Coeffs for " +
403  bandKey + "-band");
404  };
405  if (!vgosDb->loadObsUVFperAsec(bandKey, uvByBand[bandKey]))
406  {
408  "::getDataFromVgosDb(): cannot use data because of missed info: UV for " +
409  bandKey + "-band");
410  };
411  if (!vgosDb->loadObsCalFeedCorr(bandKey, calFeedCorrByBand[bandKey]))
412  {
414  "::getDataFromVgosDb(): cannot use data because of missed info: FeedCorr for " +
415  bandKey + "-band");
416  }
417  else
418  hasFeedCorrContrib_= true;
419  if (!vgosDb->loadObsSNR(bandKey, snrByBand[bandKey]) && !have2LoadImmatureSession)
420  {
422  "::getDataFromVgosDb(): cannot use data because of missed info: SNR for " +
423  bandKey + "-band");
424  // isOk = false;
425  };
426 
427  if (!vgosDb->loadObsCorrelatorInfo(bandKey,
428  fourfitOutputFNameByBand[bandKey],
429  fourfitErrorCodesByBand[bandKey],
430 // corelVersionsByBand[bandKey],
431  startOffsetsByBand[bandKey],
432  fourfitVersionsByBand[bandKey],
433 // dbeditVersionByBand[bandKey],
434  deltaEpochsByBand[bandKey],
435  urvrsByBand[bandKey],
436  instrDelaysByBand[bandKey],
437  starElevByBand[bandKey],
438  zenithDelaysByBand[bandKey],
439  searchParamsByBand[bandKey],
440  baselineCodesByBand[bandKey],
441  tapeQualityCodesByBand[bandKey],
442  stopOffsetsByBand[bandKey],
443  hopsRevisionNumbersByBand[bandKey],
444  smplRateByBand[bandKey],
445  sbdResidsByBand[bandKey],
446  rateResidsByBand[bandKey],
447  effDurationsByBand[bandKey],
448  startSecondsByBand[bandKey],
449  stopSecondsByBand[bandKey],
450  percentOfDiscardsByBand[bandKey],
451  uniformityFactorsByBand[bandKey],
452  geocenterPhaseResidsByBand[bandKey],
453  geocenterPhaseTotalsByBand[bandKey],
454  geocenterSbDelaysByBand[bandKey],
455  geocenterGrDelaysByBand[bandKey],
456  geocenterDelayRatesByBand[bandKey],
457  probOfFalsesByBand[bandKey],
458  corrAprioriDelaysByBand[bandKey],
459  corrAprioriRatesByBand[bandKey],
460  corrAprioriAccsByBand[bandKey],
461  incohAmpsByBand[bandKey],
462  incohAmps2ByBand[bandKey],
463  delayResidsByBand[bandKey],
464  vlb1FileNamesByBand[bandKey],
465  tapeIds_1ByBand[bandKey],
466  tapeIds_2ByBand[bandKey],
467  epochsOfCorrelationsByBand[bandKey],
468  epochsOfCentralsByBand[bandKey],
469  epochsOfFourfitingsByBand[bandKey],
470  epochsOfNominalScanTimeByBand[bandKey],
471  corrClocksByBand[bandKey],
472  mDlysByBand[bandKey],
473  mAuxByBand[bandKey]))
475  "::getDataFromVgosDb(): reading Correlator Info for the " + bandKey + "-band has failed");
476 
477 
478  if (!vgosDb->loadMiscFourFit(bandKey,
479  fourfitControlFileByBand[bandKey], fourfitCommandByBand[bandKey],
480  numLagsByBand[bandKey], apLengthByBand[bandKey]))
482  "::getDataFromVgosDb(): reading Fourfit Info for the " + bandKey + "-band has failed");
483 
484  vgosDb->loadObsNumGroupAmbigs(bandKey, numAmbigsByBand[bandKey], numSubAmbigsByBand[bandKey]);
485  vgosDb->loadObsNumPhaseAmbigs(bandKey, numPhsAmbigsByBand[bandKey]);
486  vgosDb->loadObsDataFlag(bandKey, dataFlagByBand[bandKey]);
487  vgosDb->loadObsCalIonGroup(bandKey, ionCalsByBand[bandKey], ionSigmasByBand[bandKey],
488  ionDataFlagByBand[bandKey]);
489 
490  //
491  vgosDb->loadObsCalUnphase(bandKey, phaseCals_1ByBand[bandKey], phaseCals_2ByBand[bandKey]);
492  //
493  // channels setup:
494  if (!vgosDb->loadObsChannelInfo(bandKey,
495  channelIdsByBand[bandKey],
496  polarizationsByBand[bandKey],
497  numOfChannelsByBand[bandKey],
498  bitsPerSamplesByBand[bandKey],
499  errorRates_1ByBand[bandKey],
500  errorRates_2ByBand[bandKey],
501  bbcIdxs_1ByBand[bandKey],
502  bbcIdxs_2ByBand[bandKey],
503  corelIdxNumbersUsbByBand[bandKey],
504  corelIdxNumbersLsbByBand[bandKey],
505  sampleRateByBand[bandKey],
506  residFringeAmplByChanByBand[bandKey],
507  residFringePhseByChanByBand[bandKey],
508  refFreqByChanByBand[bandKey],
509  numOfSamplesByChan_USBByBand[bandKey],
510  numOfSamplesByChan_LSBByBand[bandKey],
511  numOfAccPeriodsByChan_USBByBand[bandKey],
512  numOfAccPeriodsByChan_LSBByBand[bandKey],
513  loFreqs_1ByBand[bandKey],
514  loFreqs_2ByBand[bandKey]))
515  {
517  "::getDataFromVgosDb(): missed info: channel info for " + bandKey + "-band");
518  };
519  //
520  // phase cal data:
521  if (!vgosDb->loadObsPhaseCalInfo(bandKey,
522  phaseCalFreqs_1ByBand[bandKey], phaseCalAmps_1ByBand[bandKey],
523  phaseCalPhases_1ByBand[bandKey], phaseCalOffsets_1ByBand[bandKey],
524  phaseCalRates_1ByBand[bandKey],
525  phaseCalFreqs_2ByBand[bandKey], phaseCalAmps_2ByBand[bandKey],
526  phaseCalPhases_2ByBand[bandKey], phaseCalOffsets_2ByBand[bandKey],
527  phaseCalRates_2ByBand[bandKey]))
529  "::getDataFromVgosDb(): missed info: phase calibration data for " + bandKey + "-band");
530  };
531 
532  // VGOS:
533  if (!vgosDb->loadObsDtec(dTec, dTecStdDev))
534  {
536  "::getDataFromVgosDb(): no dTec data found"); // it is ok
537  };
538 
539  // "Cals" dir:
540  SgMatrix *calEarthTide, *calEopHiFiUt;
541  SgMatrix *calPlxRev;
542  SgMatrix *calBend, *calBendSun, *calBendSunHigher;
543  SgMatrix *calEopHiFiXY, *calOcean, *calOceanOld;
544  SgMatrix *calOceanPoleTideLd;
545  SgMatrix *calPoleTide, *calPoleTideOldRestore, *calTiltRmvr;
546  SgMatrix *calWobbleX, *calWobbleY;
547  SgMatrix *calWobNut, *calHiFreqLibrationPm, *calHiFreqLibrationUt;
548  SgMatrix *valNutNro, *valNutNro_rates;
549  SgMatrix *valNutEqx, *valNutEqx_rates;
550  SgMatrix *valNutEqxWahr, *valNutEqxWahr_rates;
551  SgMatrix *rSun, *rMoon, *rEarth, *vSun, *vMoon, *vEarth, *aEarth;
552  SgMatrix *t2c_val, *t2c_rat, *t2c_acc, *pmXy;
553  SgVector *ut1_tai;
554 
555  calEarthTide = calEopHiFiUt = calEopHiFiXY = calOcean = calOceanOld = calPlxRev = calBend
556  = calBendSun = calBendSunHigher = calPoleTide = calPoleTideOldRestore = calTiltRmvr
557  = calWobNut = calWobbleX = calWobbleY = calOceanPoleTideLd
558  = calHiFreqLibrationPm = calHiFreqLibrationUt = valNutNro = valNutNro_rates
559  = valNutEqxWahr = valNutEqxWahr_rates = valNutEqx = valNutEqx_rates
560  = rSun = rMoon = rEarth = vSun = vMoon = vEarth = aEarth
561  = t2c_val = t2c_rat = t2c_acc = pmXy
562  = NULL;
563  ut1_tai = NULL;
564 
565  if (!vgosDb->loadObsCalEarthTide(calEarthTide, kind))
566  {
568  "::getDataFromVgosDb(): limited use data, missed info: Earth Tides");
569  }
570  else if (!kind.isEmpty() && kind.toUpper() != "IERS2003")
572  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of Earth tide calibration");
573  //
574  if (!vgosDb->loadObsCalHiFyErp(calEopHiFiUt, calEopHiFiXY, kind))
575  {
577  "::getDataFromVgosDb(): limited use data, missed info: HiFq EOP");
578  }
579  else if (!kind.isEmpty() && kind.toUpper() != "IERS2003")
581  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of high frequency ERP calibration");
582  //
583  if (!vgosDb->loadObsCalOcean(calOcean))
584  {
586  "::getDataFromVgosDb(): limited use data, missed info: Ocean Load");
587  };
588  vgosDb->loadObsCalOceanOld(calOceanOld);
589  //
590  vgosDb->loadObsCalOceanPoleTideLoad(calOceanPoleTideLd);
591 
592  if (!vgosDb->loadObsCalPoleTide(calPoleTide, kind))
593  {
595  "::getDataFromVgosDb(): limited use data, missed info: Pole Tide");
596  }
597  else if (!kind.isEmpty() && kind.toUpper() != "IERS2003")
599  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of pole tide calibration");
600  vgosDb->loadObsCalPoleTideOldRestore(calPoleTideOldRestore);
601 
602  if (!vgosDb->loadObsCalTiltRmvr(calTiltRmvr))
603  {
605  "::getDataFromVgosDb(): limited use data, missed info: TiltRemover");
606  };
607  //
608  if (!vgosDb->loadObsCalHiFyLibration(calHiFreqLibrationPm, calHiFreqLibrationUt, kind))
609  {
610  if (!vgosDb->loadObsCalHiFyLibration(calWobNut, kind))
611  {
613  "::getDataFromVgosDb(): limited use data, missed info: Libration");
614  };
615  }
616  else if (!kind.isEmpty() && kind.toUpper() != "IERS2010")
618  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of high frequency libration "
619  "calibration");
620  //
621  if (!vgosDb->loadObsCalWobble(calWobbleX, calWobbleY))
622  {
624  "::getDataFromVgosDb(): limited use data, missed info: Pole Wobble");
625  };
626  if (!vgosDb->loadObsCalParallax(calPlxRev))
627  {
629  "::getDataFromVgosDb(): limited use data, missed info: Parallax");
630  };
631  if (!vgosDb->loadObsCalBend(calBend))
632  {
634  "::getDataFromVgosDb(): limited use data, missed info: Bending");
635  };
636  if (!vgosDb->loadObsCalBendSun(calBendSun))
637  {
639  "::getDataFromVgosDb(): limited use data, missed info: Bending II");
640  };
641  if (!vgosDb->loadObsCalBendSunHigher(calBendSunHigher))
642  {
644  "::getDataFromVgosDb(): limited use data, missed info: Bending III");
645  };
646 
647  QVector<int> delUFlags, phsUFlags, ratUFlags, uAcSups,
648  ionsBits, obs2Scan;
649  QVector<QString> scanNames, scanFullNames;
650  QVector<QString> corrRootFnames;
651  SgMatrix *dV_dPx, *dV_dPy, *dV_dUT1, *dV_dCipX, *dV_dCipY, *dV_dRA, *dV_dDN;
652  SgMatrix *dTau_dR_1,*dRat_dR_1;
653  SgMatrix *dV_dBend, *dV_dGamma, *dV_dParallax, *dV_dPtdX, *dV_dPtdY;
654  SgMatrix *userCorrections;
655 
656  dV_dRA = dV_dDN = dV_dCipX = dV_dCipY = dV_dPx = dV_dPy = dV_dUT1 = dTau_dR_1
657  = dRat_dR_1 = dV_dBend = dV_dGamma = dV_dParallax = dV_dPtdX = dV_dPtdY = NULL;
658  userCorrections = NULL;
659  numOfUserCorrections = vgosDb->getNumOfUserCorrections();
660  if (numOfUserCorrections)
661  {
662  QString str("");
663  userCorrections = new SgMatrix(numOfObs, numOfUserCorrections);
664  userCorrectionsUse_.resize(numOfUserCorrections);
665  userCorrectionsName_.resize(numOfUserCorrections);
666  for (int i=0; i<vgosDb->getNumOfUserCorrections(); i++)
667  {
668  vgosDb->loadObsUserCorrections(i, userCorrections, str);
669  userCorrectionsUse_[i] = false; // true;
670  userCorrectionsName_[i] = str;
671  };
672  };
673  //
674  //
675  // edit's dir:
676  vgosDb->loadObsEditData(delUFlags, phsUFlags, ratUFlags, uAcSups);
677 
678  // partial's dir:
679  if (!vgosDb->loadObsPartEOP(dV_dPx, dV_dPy, dV_dUT1))
681  "::getDataFromVgosDb(): limited use data, missed info: Partials: EOP");
682 
683  if (!vgosDb->loadObsPartBend(dV_dBend))
685  "::getDataFromVgosDb(): limited use data, missed info: Partials: bend");
686 
687  if (!vgosDb->loadObsPartGamma(dV_dGamma))
689  "::getDataFromVgosDb(): limited use data, missed info: Partials: gamma");
690 
691  if (!vgosDb->loadObsPartParallax(dV_dParallax))
693  "::getDataFromVgosDb(): limited use data, missed info: Partials: parallax");
694 
695  if (!vgosDb->loadObsPartPoleTides(dV_dPtdX, dV_dPtdY, kind))
697  "::getDataFromVgosDb(): limited use data, missed info: Partials: pole tide");
698  else if (!kind.isEmpty() && kind.toUpper() != "IERS2006")
700  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of pole tide partials");
701 
702  //
703  if (!vgosDb->loadObsPartNut2KXY(dV_dCipX, dV_dCipY, kind))
704  {
706  "::getDataFromVgosDb(): limited use data, missed info: Partials: CIP/Nutation");
707 // isOk = false;
708  }
709  else if (!kind.isEmpty() && kind.toUpper() != "IAU2006")
711  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of Nutation partials");
712  //
713  if (!vgosDb->loadObsPartRaDec(dV_dRA, dV_dDN))
714  {
716  "::getDataFromVgosDb(): limited use data, missed info: Partials: source position");
717 // isOk = false;
718  };
719  if (!vgosDb->loadObsPartXYZ(dTau_dR_1, dRat_dR_1)) //, here dTau_dR_2 = -dTau_dR_1
720  {
722  "::getDataFromVgosDb(): limited use data, missed info: Partials: station coordinates");
723 // isOk = false;
724  };
725  //
726  // observation-to-scan mapping:
727  if (!vgosDb->loadObsCrossRefs(obs2Scan))
728  {
730  "::getDataFromVgosDb(): cannot use data because of missed info: CrossRefers");
731  isOk = false;
732  };
733  //
734  // scans:
735  if (!vgosDb->loadScanName(scanNames, scanFullNames))
737  "::getDataFromVgosDb(): missed info: Scan Names");
738 
739  if (!vgosDb->loadScanCrootFname(corrRootFnames))
740  logger->write(
743  "::getDataFromVgosDb(): missed info: correlator root file names");
744  //
745  vgosDb->loadScanNutationEqxWahr(valNutEqxWahr, valNutEqxWahr_rates);
746  vgosDb->loadScanNutationEqx(valNutEqx, valNutEqx_rates, kind);
747  if (!kind.isEmpty() && kind.toUpper() != "IAU2006")
749  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of Nutation contribution, "
750  "Equinox mode");
751  vgosDb->loadScanNutationNro(valNutNro, valNutNro_rates, kind);
752  if (!kind.isEmpty() && kind.toUpper() != "IAU2006")
754  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of Nutation contribution, "
755  "NRO mode");
756 
757  vgosDb->loadScanEphemeris(rSun, rMoon, rEarth, vSun, vMoon, vEarth, aEarth);
758  vgosDb->loadScanTrf2crf(t2c_val, t2c_rat, t2c_acc);
759  vgosDb->loadErpApriori(ut1_tai, pmXy);
760 
761  // collect pointers on vectors:
762  vectors2del << dTec << dTecStdDev << ut1_tai
763  ;
764 
765  // collect pointers on matrices:
766  matrices2del << calEarthTide << calEopHiFiUt << calEopHiFiXY << calOcean << calOceanOld
767  << calPlxRev << calBend
768  << calBendSun << calBendSunHigher << calPoleTide << calPoleTideOldRestore
769  << calTiltRmvr << calWobNut
770  << valNutEqxWahr << valNutEqxWahr_rates
771  << valNutNro << valNutNro_rates
772  << valNutEqx << valNutEqx_rates
773  << rSun << rMoon << rEarth << vSun << vMoon << vEarth << aEarth
774  << t2c_val << t2c_rat << t2c_acc << pmXy
775  << calWobbleX << calWobbleY
776  << calOceanPoleTideLd << calHiFreqLibrationPm << calHiFreqLibrationUt
777  << dTau_dR_1 << dRat_dR_1
778  << dV_dPx << dV_dPy << dV_dUT1 << dV_dCipX << dV_dCipY << dV_dRA << dV_dDN
779  << dV_dBend << dV_dGamma << dV_dParallax << dV_dPtdX << dV_dPtdY
780  ;
781  if (userCorrections)
782  matrices2del << userCorrections;
783 
784  // phase 1:
785  //
786  // parse load info:
787  QString station1Name, station2Name, sourceName, baselineName;
788  QString obsKey, scanName, scanId;
789  SgVlbiStationInfo *station1Info, *station2Info;
790  SgVlbiSourceInfo *sourceInfo;
791  SgVlbiBaselineInfo *baselineInfo;
792  SgVlbiObservation *obs=NULL;
793  SgMJD epoch;
794  QMap<QString, SgVlbiAuxObservation*> *auxObsByScan=NULL;
795  int obs2ScanIdx;
796  //
797  // first, read observation, set up identities
799  "::getDataFromVgosDb(): processing observations of the session " + vgosDb->getSessionName());
800  for (int obsIdx=0; obsIdx<numOfObs; obsIdx++)
801  {
802  obs = NULL;
803  // stations and source names:
804  station1Name = stations_1.at(obsIdx);
805  station2Name = stations_2.at(obsIdx);
806  sourceName = sources.at(obsIdx);
807  baselineName = station1Name + ":" + station2Name;
808  epoch = epochs4Obs.at(obsIdx);
809  obsKey.sprintf("%s",
810  qPrintable(epoch.toString(SgMJD::F_INTERNAL) + "-" + baselineName + "@" + sourceName));
811  // scanId and scanName:
812  scanId = epoch.toString(SgMJD::F_INTERNAL) + "@" + sourceName;
813  obs2ScanIdx = obs2Scan.at(obsIdx) - 1;
814  if (scanNames.size())
815  scanName = scanNames.at(obs2ScanIdx);
816  else if (scanFullNames.size())
817  scanName = scanFullNames.at(obs2ScanIdx);
818  else
819  scanName.sprintf("%03d-%02d:%02d:%04.1f@%s",
820  epoch.calcDayOfYear(), epoch.calcHour(), epoch.calcMin(), epoch.calcSec(),
821  qPrintable(sourceName));
822  //
823  if (observationByKey_.contains(obsKey))
824  {
826  "::getDataFromVgosDb(): the observation #" + QString("").setNum(obsIdx) + " at " +
827  epoch.toString() + " with a key \'" + obsKey + "\' already exists in the container");
828  obs = observationByKey_.value(obsKey); // just to prevent the segfault
829  }
830  else
831  {
832  obs = new SgVlbiObservation(this);
833  obs->setMJD(epoch);
834  obs->setScanName(scanName);
835  obs->setScanId(scanId);
836  obs->setKey(obsKey);
837  obs->setMediaIdx(obsIdx);
838  if (scanFullNames.size() && scanFullNames.at(obs2ScanIdx).size())
839  obs->setScanFullName(scanFullNames.at(obs2ScanIdx));
840  if (corrRootFnames.size() && corrRootFnames.at(obs2ScanIdx).size())
841  obs->setCorrRootFileName(corrRootFnames.at(obs2ScanIdx));
842  observations_.append(obs);
843  observationByKey_.insert(obsKey, obs);
844  };
845  //
846  // station #1:
847  if (stationsByName_.contains(station1Name))
848  station1Info = stationsByName_.value(station1Name);
849  else // new station, add it to the container and register its index:
850  {
851  station1Info = new SgVlbiStationInfo(stationsByName_.size(), station1Name);
852  stationsByName_.insert(station1Info->getKey(), station1Info);
853  stationsByIdx_.insert(station1Info->getIdx(), station1Info);
854  };
855  // station #2:
856  if (stationsByName_.contains(station2Name))
857  station2Info = stationsByName_.value(station2Name);
858  else // new station, add it to the container and register its index:
859  {
860  station2Info = new SgVlbiStationInfo(stationsByName_.size(), station2Name);
861  stationsByName_.insert(station2Info->getKey(), station2Info);
862  stationsByIdx_.insert(station2Info->getIdx(), station2Info);
863  };
864  // source:
865  if (sourcesByName_.contains(sourceName))
866  sourceInfo = sourcesByName_.value(sourceName);
867  else // new source, add it to the container and register its index:
868  {
869  sourceInfo = new SgVlbiSourceInfo(sourcesByName_.size(), sourceName);
870  sourcesByName_.insert(sourceInfo->getKey(), sourceInfo);
871  sourcesByIdx_.insert(sourceInfo->getIdx(), sourceInfo);
872  };
873  // baseline:
874  if (baselinesByName_.contains(baselineName))
875  baselineInfo = baselinesByName_.value(baselineName);
876  else // new baseline, add it to the container and register its index:
877  {
878  baselineInfo = new SgVlbiBaselineInfo(baselinesByName_.size(), baselineName);
879  baselinesByName_.insert(baselineInfo->getKey(), baselineInfo);
880  baselinesByIdx_.insert(baselineInfo->getIdx(), baselineInfo);
881  };
882  obs->setStation1Idx(station1Info->getIdx());
883  obs->setStation2Idx(station2Info->getIdx());
884  obs->setSourceIdx (sourceInfo ->getIdx());
885  obs->setBaselineIdx(baselineInfo->getIdx());
886  //
887  // collect data:
888  // VGOS:
889  if (dTec && dTecStdDev)
890  {
891  obs->setDTec (dTec ->getElement(obsIdx));
892  obs->setDTecStdDev(dTecStdDev ->getElement(obsIdx));
893  };
894  // theo consensus delay:
895  if (calcDelays)
896  obs->setCalcConsensusDelay (calcDelays->getElement(obsIdx));
897  if (calcRates)
898  obs->setCalcConsensusRate (calcRates->getElement(obsIdx));
899  if (fractC)
900  obs->setFractC(fractC->getElement(obsIdx));
901 
902  if (calPlxRev)
903  {
904  obs->setDdel_dParallaxRev(calPlxRev->getElement(obsIdx, 0));
905  obs->setDrat_dParallaxRev(calPlxRev->getElement(obsIdx, 1));
906  };
907  if (calBend)
908  {
909  obs->setCalcConsBendingDelay(calBend->getElement(obsIdx, 0));
910  obs->setCalcConsBendingRate (calBend->getElement(obsIdx, 1));
911  };
912  if (calBendSun)
913  {
914  obs->setCalcConsBendingSunDelay(calBendSun->getElement(obsIdx, 0));
915  obs->setCalcConsBendingSunRate (calBendSun->getElement(obsIdx, 1));
916  };
917  if (calBendSunHigher)
918  {
919  obs->setCalcConsBendingSunHigherDelay(calBendSunHigher->getElement(obsIdx, 0));
920  obs->setCalcConsBendingSunHigherRate (calBendSunHigher->getElement(obsIdx, 1));
921  };
922  //
923  // contributions:
924  if (calOcean)
925  {
926  obs->setCalcOceanTideDelay(calOcean->getElement(obsIdx, 0));
927  obs->setCalcOceanTideRate (calOcean->getElement(obsIdx, 1));
928  };
929  if (calEopHiFiUt)
930  {
931  obs->setCalcHiFyUt1Delay(calEopHiFiUt->getElement(obsIdx, 0));
932  obs->setCalcHiFyUt1Rate (calEopHiFiUt->getElement(obsIdx, 1));
933  };
934  if (calEopHiFiXY)
935  {
936  obs->setCalcHiFyPxyDelay(calEopHiFiXY->getElement(obsIdx, 0));
937  obs->setCalcHiFyPxyRate (calEopHiFiXY->getElement(obsIdx, 1));
938  };
939  if (calPoleTide)
940  {
941  obs->setCalcPoleTideDelay(calPoleTide->getElement(obsIdx, 0));
942  obs->setCalcPoleTideRate (calPoleTide->getElement(obsIdx, 1));
943  };
944  if (calEarthTide)
945  {
946  obs->setCalcEarthTideDelay(calEarthTide->getElement(obsIdx, 0));
947  obs->setCalcEarthTideRate (calEarthTide->getElement(obsIdx, 1));
948  };
949  if (calOceanPoleTideLd)
950  {
951  obs->setCalcOceanPoleTideLdDelay(calOceanPoleTideLd->getElement(obsIdx, 0));
952  obs->setCalcOceanPoleTideLdRate (calOceanPoleTideLd->getElement(obsIdx, 1));
953  };
954  if (calWobbleX)
955  {
956  obs->setCalcPxDelay(calWobbleX->getElement(obsIdx, 0));
957  obs->setCalcPxRate (calWobbleX->getElement(obsIdx, 1));
958  };
959  if (calWobbleY)
960  {
961  obs->setCalcPyDelay(calWobbleY->getElement(obsIdx, 0));
962  obs->setCalcPyRate (calWobbleY->getElement(obsIdx, 1));
963  };
964  if (calWobNut)
965  {
966  obs->setCalcWobNutatContrib(calWobNut->getElement(obsIdx, 0));
967  //obs->setCalcWobNutatContrib(calWobNut->getElement(obsIdx, 1));
968  };
969  if (calHiFreqLibrationPm)
970  {
971  obs->setCalcHiFyPxyLibrationDelay(calHiFreqLibrationPm->getElement(obsIdx, 0));
972  obs->setCalcHiFyPxyLibrationRate (calHiFreqLibrationPm->getElement(obsIdx, 1));
973  };
974  if (calHiFreqLibrationUt)
975  {
976  obs->setCalcHiFyUt1LibrationDelay(calHiFreqLibrationUt->getElement(obsIdx, 0));
977  obs->setCalcHiFyUt1LibrationRate (calHiFreqLibrationUt->getElement(obsIdx, 1));
978  };
979 
980  if (rSun)
981  obs->setRsun(Sg3dVector(rSun->getElement(obs2ScanIdx, 0),
982  rSun->getElement(obs2ScanIdx, 1),
983  rSun->getElement(obs2ScanIdx, 2)));
984  if (vSun)
985  obs->setVsun(Sg3dVector(vSun->getElement(obs2ScanIdx, 0),
986  vSun->getElement(obs2ScanIdx, 1),
987  vSun->getElement(obs2ScanIdx, 2)));
988  if (rMoon)
989  obs->setRmoon(Sg3dVector(rMoon->getElement(obs2ScanIdx, 0),
990  rMoon->getElement(obs2ScanIdx, 1),
991  rMoon->getElement(obs2ScanIdx, 2)));
992  if (vMoon)
993  obs->setVmoon(Sg3dVector(vMoon->getElement(obs2ScanIdx, 0),
994  vMoon->getElement(obs2ScanIdx, 1),
995  vMoon->getElement(obs2ScanIdx, 2)));
996 
997  if (rEarth)
998  obs->setRearth(Sg3dVector(rEarth->getElement(obs2ScanIdx, 0),
999  rEarth->getElement(obs2ScanIdx, 1),
1000  rEarth->getElement(obs2ScanIdx, 2)));
1001  if (vEarth)
1002  obs->setVearth(Sg3dVector(vEarth->getElement(obs2ScanIdx, 0),
1003  vEarth->getElement(obs2ScanIdx, 1),
1004  vEarth->getElement(obs2ScanIdx, 2)));
1005  if (aEarth)
1006  obs->setAearth(Sg3dVector(aEarth->getElement(obs2ScanIdx, 0),
1007  aEarth->getElement(obs2ScanIdx, 1),
1008  aEarth->getElement(obs2ScanIdx, 2)));
1009  if (t2c_val)
1010  for (int k=0; k<3; k++)
1011  for (int l=0; l<3; l++)
1012  obs->trf2crfVal()((DIRECTION)k, (DIRECTION)l) = t2c_val->getElement(obs2ScanIdx, 3*k+l);
1013  if (t2c_rat)
1014  for (int k=0; k<3; k++)
1015  for (int l=0; l<3; l++)
1016  obs->trf2crfRat()((DIRECTION)k, (DIRECTION)l) = t2c_rat->getElement(obs2ScanIdx, 3*k+l);
1017  if (t2c_acc)
1018  for (int k=0; k<3; k++)
1019  for (int l=0; l<3; l++)
1020  obs->trf2crfAcc()((DIRECTION)k, (DIRECTION)l) = t2c_acc->getElement(obs2ScanIdx, 3*k+l);
1021 
1022  if (ut1_tai)
1023  obs->setCalcUt1_Tai(ut1_tai->getElement(obs2ScanIdx));
1024 
1025  if (pmXy)
1026  {
1027  obs->setCalcPmX(pmXy->getElement(obs2ScanIdx, 0));
1028  obs->setCalcPmY(pmXy->getElement(obs2ScanIdx, 1));
1029  };
1030 
1031  if (valNutNro)
1032  {
1033  obs->setCalcCipXv(valNutNro->getElement(obs2ScanIdx, 0));
1034  obs->setCalcCipYv(valNutNro->getElement(obs2ScanIdx, 1));
1035  obs->setCalcCipSv(valNutNro->getElement(obs2ScanIdx, 2));
1036  };
1037  if (valNutNro_rates)
1038  {
1039  obs->setCalcCipXr(valNutNro_rates->getElement(obs2ScanIdx, 0));
1040  obs->setCalcCipYr(valNutNro_rates->getElement(obs2ScanIdx, 1));
1041  obs->setCalcCipSr(valNutNro_rates->getElement(obs2ScanIdx, 2));
1042  };
1043  if (valNutEqxWahr)
1044  {
1045  obs->setCalcNutWahr_dPsiV(valNutEqxWahr->getElement(obs2ScanIdx, 0));
1046  obs->setCalcNutWahr_dEpsV(valNutEqxWahr->getElement(obs2ScanIdx, 1));
1047  };
1048  if (valNutEqxWahr_rates)
1049  {
1050  obs->setCalcNutWahr_dPsiR(valNutEqxWahr_rates->getElement(obs2ScanIdx, 0));
1051  obs->setCalcNutWahr_dEpsR(valNutEqxWahr_rates->getElement(obs2ScanIdx, 1));
1052  };
1053  if (valNutEqx)
1054  {
1055  obs->setCalcNut2006_dPsiV(valNutEqx->getElement(obs2ScanIdx, 0));
1056  obs->setCalcNut2006_dEpsV(valNutEqx->getElement(obs2ScanIdx, 1));
1057  };
1058  if (valNutEqx_rates)
1059  {
1060  obs->setCalcNut2006_dPsiR(valNutEqx_rates->getElement(obs2ScanIdx, 0));
1061  obs->setCalcNut2006_dEpsR(valNutEqx_rates->getElement(obs2ScanIdx, 1));
1062  };
1063  if (calOceanOld)
1064  {
1065  obs->setCalcOceanTideOldDelay(calOceanOld->getElement(obsIdx, 0));
1066  obs->setCalcOceanTideOldRate (calOceanOld->getElement(obsIdx, 1));
1067  };
1068  if (calPoleTideOldRestore)
1069  {
1070  obs->setCalcPoleTideOldDelay(calPoleTideOldRestore->getElement(obsIdx, 0));
1071  obs->setCalcPoleTideOldRate (calPoleTideOldRestore->getElement(obsIdx, 1));
1072  };
1073  if (calTiltRmvr)
1074  {
1075  obs->setCalcTiltRemvrDelay(calTiltRmvr->getElement(obsIdx, 0));
1076  obs->setCalcTiltRemvrRate (calTiltRmvr->getElement(obsIdx, 1));
1077  };
1078  //
1079  // partials:
1080  // stations:
1081  if (dTau_dR_1)
1082  {
1083  Sg3dVector r(dTau_dR_1->getElement(obsIdx, 0),
1084  dTau_dR_1->getElement(obsIdx, 1),
1085  dTau_dR_1->getElement(obsIdx, 2));
1086  obs->setDdel_dR_1( r);
1087  obs->setDdel_dR_2(-r);
1088  };
1089  if (dRat_dR_1)
1090  {
1091  Sg3dVector r(dRat_dR_1->getElement(obsIdx, 0),
1092  dRat_dR_1->getElement(obsIdx, 1),
1093  dRat_dR_1->getElement(obsIdx, 2));
1094  obs->setDrat_dR_1( r);
1095  obs->setDrat_dR_2(-r);
1096  };
1097  // sources:
1098  if (dV_dRA && dV_dDN)
1099  {
1100  obs->setDdel_dRA( dV_dRA->getElement(obsIdx, 0) );
1101  obs->setDdel_dDN( dV_dDN->getElement(obsIdx, 0) );
1102  obs->setDrat_dRA( dV_dRA->getElement(obsIdx, 1) );
1103  obs->setDrat_dDN( dV_dDN->getElement(obsIdx, 1) );
1104  };
1105  // dUT1:
1106  if (dV_dUT1)
1107  {
1108  obs->setDdel_dUT1( dV_dUT1->getElement(obsIdx, 0)*86400.0 ); // the sign has been already inverted
1109  obs->setDrat_dUT1( dV_dUT1->getElement(obsIdx, 1)*86400.0 ); // the sign has been already inverted
1110  obs->setD2del_dUT12(dV_dUT1->getElement(obsIdx, 2));
1111  obs->setD2rat_dUT12(dV_dUT1->getElement(obsIdx, 3));
1112  };
1113  // Polar motion:
1114  if (dV_dPx && dV_dPy)
1115  {
1116  obs->setDdel_dPx(dV_dPx->getElement(obsIdx, 0));
1117  obs->setDdel_dPy(dV_dPy->getElement(obsIdx, 0));
1118  obs->setDrat_dPx(dV_dPx->getElement(obsIdx, 1));
1119  obs->setDrat_dPy(dV_dPy->getElement(obsIdx, 1));
1120  };
1121  // Angles of nutation:
1122  if (dV_dCipX && dV_dCipY)
1123  {
1124  obs->setDdel_dCipX( dV_dCipX->getElement(obsIdx, 0) );
1125  obs->setDdel_dCipY( dV_dCipY->getElement(obsIdx, 0) );
1126  obs->setDrat_dCipX( dV_dCipX->getElement(obsIdx, 1) );
1127  obs->setDrat_dCipY( dV_dCipY->getElement(obsIdx, 1) );
1128  };
1129  if (dV_dBend)
1130  {
1131  obs->setDdel_dBend(dV_dBend->getElement(obsIdx, 0));
1132  obs->setDrat_dBend(dV_dBend->getElement(obsIdx, 1));
1133  };
1134  if (dV_dGamma)
1135  {
1136  obs->setDdel_dGamma(dV_dGamma->getElement(obsIdx, 0));
1137  obs->setDrat_dGamma(dV_dGamma->getElement(obsIdx, 1));
1138  };
1139  if (dV_dParallax)
1140  {
1141  obs->setDdel_dParallax(dV_dParallax->getElement(obsIdx, 0));
1142  obs->setDrat_dParallax(dV_dParallax->getElement(obsIdx, 1));
1143  };
1144  if (dV_dPtdX && dV_dPtdY)
1145  {
1146  obs->setDdel_dPolTideX(dV_dPtdX->getElement(obsIdx, 0));
1147  obs->setDrat_dPolTideX(dV_dPtdX->getElement(obsIdx, 1));
1148  obs->setDdel_dPolTideY(dV_dPtdY->getElement(obsIdx, 0));
1149  obs->setDrat_dPolTideY(dV_dPtdY->getElement(obsIdx, 1));
1150  };
1151  //
1152  //
1153  //
1154  // auxObs: just create entries:
1155  // the first station:
1156  auxObsByScan = station1Info->auxObservationByScanId();
1157  if (!auxObsByScan->contains(scanId)) // new scan, insert data:
1158  {
1160  auxObs->setMJD(*obs);
1161  auxObsByScan->insert(scanId, auxObs);
1162  obs->setAuxObs_1(auxObs);
1163 // if (calUnphaseCal_1)
1164 // auxObs->setCalcUnPhaseCal(calUnphaseCal_1->getElement(obsIdx, 0));
1165  }
1166  else
1167  obs->setAuxObs_1(auxObsByScan->value(scanId));
1168  // the second station:
1169  auxObsByScan = station2Info->auxObservationByScanId();
1170  if (!auxObsByScan->contains(scanId)) // new scan, insert data:
1171  {
1173  auxObs->setMJD(*obs);
1174  auxObsByScan->insert(scanId, auxObs);
1175  obs->setAuxObs_2(auxObs);
1176 // if (calUnphaseCal_2)
1177 // auxObs->setCalcUnPhaseCal(calUnphaseCal_2->getElement(obsIdx, 0));
1178  }
1179  else
1180  obs->setAuxObs_2(auxObsByScan->value(scanId));
1181  // cumulative statistics (do we need it?):
1182  station1Info->incNumTotal(DT_DELAY);
1183  station2Info->incNumTotal(DT_DELAY);
1184  sourceInfo ->incNumTotal(DT_DELAY);
1185  baselineInfo->incNumTotal(DT_DELAY);
1186 
1187  station1Info->incNumTotal(DT_RATE);
1188  station2Info->incNumTotal(DT_RATE);
1189  sourceInfo ->incNumTotal(DT_RATE);
1190  baselineInfo->incNumTotal(DT_RATE);
1191  //
1192  // user corrections:
1193  if (numOfUserCorrections)
1194  {
1195  obs->userCorrections().resize(numOfUserCorrections);
1196  for (int i=0; i<numOfUserCorrections; i++)
1197  obs->userCorrections()[i] = userCorrections->getElement(obsIdx, i);
1198  };
1199  };
1200  //
1201  //
1202  // collect observables:
1203  SgVlbiStationInfo *bandStation1Info, *bandStation2Info;
1204  SgVlbiSourceInfo *bandSourceInfo;
1205  SgVlbiBaselineInfo *bandBaselineInfo;
1206  SgVlbiObservable *o=NULL;
1207  // for calculation of effective frequencies:
1208  double effFreq4GR=0.0, effFreq4PH=0.0, effFreq4RT=0.0;
1209  //
1210  skyFreqByIfId_.clear();
1211  //
1212  for (int bandIdx=0; bandIdx<listOfBands.size(); bandIdx++)
1213  {
1214  const QString &bandKey=listOfBands.at(bandIdx);
1215  SgVlbiBand *band=new SgVlbiBand;
1216  band->setKey(bandKey);
1217  bands_.append(band);
1218  bandByKey_.insert(bandKey, band);
1219  //
1220  SgMatrix *singleBandDelays = singleBandDelaysByBand[bandKey];
1221  SgMatrix *groupDelays = groupDelaysByBand[bandKey];
1222  SgMatrix *rates = ratesByBand[bandKey];
1223  SgMatrix *phases = phasesByBand[bandKey];
1224  SgMatrix *ionCals = ionCalsByBand[bandKey];
1225  SgMatrix *ionSigmas = ionSigmasByBand[bandKey];
1226  SgMatrix *phaseCals_1 = phaseCals_1ByBand[bandKey];
1227  SgMatrix *phaseCals_2 = phaseCals_2ByBand[bandKey];
1228  SgMatrix *phaseCalFreqs_1 = phaseCalFreqs_1ByBand[bandKey];
1229  SgMatrix *phaseCalFreqs_2 = phaseCalFreqs_2ByBand[bandKey];
1230  SgMatrix *phaseCalAmps_1 = phaseCalAmps_1ByBand[bandKey];
1231  SgMatrix *phaseCalAmps_2 = phaseCalAmps_2ByBand[bandKey];
1232  SgMatrix *phaseCalPhases_1 = phaseCalPhases_1ByBand[bandKey];
1233  SgMatrix *phaseCalPhases_2 = phaseCalPhases_2ByBand[bandKey];
1234  SgMatrix *phaseCalOffsets_1 = phaseCalOffsets_1ByBand[bandKey];
1235  SgMatrix *phaseCalOffsets_2 = phaseCalOffsets_2ByBand[bandKey];
1236  SgMatrix *effFreqs = effFreqsByBand[bandKey];
1237  SgMatrix *uv = uvByBand[bandKey];
1238  SgMatrix *calFeedCorr = calFeedCorrByBand[bandKey];
1239 
1240  SgVector *refFreqs = refFreqsByBand[bandKey];
1241  SgVector *correlation = correlationByBand[bandKey];
1242  SgVector *snr = snrByBand[bandKey];
1243  SgVector *ambigs = ambigsByBand[bandKey];
1244 
1245  const QVector<QString> &qCodes=qCodesByBand[bandKey];
1246  const QVector<int> &numAmbigs=numAmbigsByBand[bandKey];
1247  const QVector<int> &numSubAmbigs=numSubAmbigsByBand[bandKey];
1248  const QVector<int> &numPhsAmbigs=numPhsAmbigsByBand[bandKey];
1249  const QVector<int> &dataFlag=dataFlagByBand[bandKey];
1250 
1251  // correlator info stuff:
1252  const QVector<QString> &fourfitOutputFName=fourfitOutputFNameByBand[bandKey];
1253  const QVector<QString> &fourfitErrorCodes=fourfitErrorCodesByBand[bandKey];
1254  const QVector<QString> &baselineCodes=baselineCodesByBand[bandKey];
1255  const QVector<QString> &tapeQualityCodes=tapeQualityCodesByBand[bandKey];
1256  const QVector<QString> &vlb1FileNames=vlb1FileNamesByBand[bandKey];
1257  const QVector<QString> &tapeIds_1=tapeIds_1ByBand[bandKey];
1258  const QVector<QString> &tapeIds_2=tapeIds_2ByBand[bandKey];
1259 // const QVector<int> &corelVersions=corelVersionsByBand[bandKey];
1260  const QVector<int> &startOffsets=startOffsetsByBand[bandKey];
1261  const QVector<int> &stopOffsets=stopOffsetsByBand[bandKey];
1262  const QVector<int> &hopsRevisionNumbers=hopsRevisionNumbersByBand[bandKey];
1263  const QVector< QVector<int> >
1264  &fourfitVersions=fourfitVersionsByBand[bandKey];
1265 // const QVector< QVector<int> >
1266 // &dbeditVersion=dbeditVersionByBand[bandKey];
1267  const QVector< QVector<int> >
1268  &epochsOfCorrelations=epochsOfCorrelationsByBand[bandKey];
1269  const QVector< QVector<int> >
1270  &epochsOfCentrals=epochsOfCentralsByBand[bandKey];
1271  const QVector< QVector<int> >
1272  &epochsOfFourfitings=epochsOfFourfitingsByBand[bandKey];
1273  const QVector< QVector<int> >
1274  &epochsOfNominalScanTime=epochsOfNominalScanTimeByBand[bandKey];
1275  SgVector *deltaEpochs=deltaEpochsByBand[bandKey];
1276  SgVector *smplRate=smplRateByBand[bandKey];
1277  SgVector *sbdResids=sbdResidsByBand[bandKey];
1278  SgVector *rateResids=rateResidsByBand[bandKey];
1279  SgVector *effDurations=effDurationsByBand[bandKey];
1280  SgVector *startSeconds=startSecondsByBand[bandKey];
1281  SgVector *stopSeconds=stopSecondsByBand[bandKey];
1282  SgVector *percentOfDiscards=percentOfDiscardsByBand[bandKey];
1283  SgVector *uniformityFactors=uniformityFactorsByBand[bandKey];
1284  SgVector *geocenterPhaseResids=geocenterPhaseResidsByBand[bandKey];
1285  SgVector *geocenterPhaseTotals=geocenterPhaseTotalsByBand[bandKey];
1286  SgVector *geocenterSbDelays=geocenterSbDelaysByBand[bandKey];
1287  SgVector *geocenterGrDelays=geocenterGrDelaysByBand[bandKey];
1288  SgVector *geocenterDelayRates=geocenterDelayRatesByBand[bandKey];
1289  SgVector *probOfFalses=probOfFalsesByBand[bandKey];
1290  SgVector *corrAprioriDelays=corrAprioriDelaysByBand[bandKey];
1291  SgVector *corrAprioriRates=corrAprioriRatesByBand[bandKey];
1292  SgVector *corrAprioriAccs=corrAprioriAccsByBand[bandKey];
1293  SgVector *incohAmps=incohAmpsByBand[bandKey];
1294  SgVector *incohAmps2=incohAmps2ByBand[bandKey];
1295  SgVector *delayResids=delayResidsByBand[bandKey];
1296  SgMatrix *urvrs=urvrsByBand[bandKey];
1297  SgMatrix *instrDelays=instrDelaysByBand[bandKey];
1298  SgMatrix *starElev=starElevByBand[bandKey];
1299  SgMatrix *zenithDelays=zenithDelaysByBand[bandKey];
1300  SgMatrix *searchParams=searchParamsByBand[bandKey];
1301  SgMatrix *corrClocks=corrClocksByBand[bandKey];
1302  SgMatrix *mDlys=mDlysByBand[bandKey];
1303  SgMatrix *mAux=mAuxByBand[bandKey];
1304  // EoCIS
1305  const QVector<QString> &fourfitControlFile=fourfitControlFileByBand[bandKey];
1306  const QVector<QString> &fourfitCommand =fourfitCommandByBand[bandKey];
1307  const QVector<int> &numLags =numLagsByBand[bandKey];
1308  const QVector<double> &apLength =apLengthByBand[bandKey];
1309  // channel info stuff:
1310  const QVector<QString> &channelIds=channelIdsByBand[bandKey];
1311  const QVector<QString> &polarizations=polarizationsByBand[bandKey];
1312 
1313  const QVector<int> &numOfChannels=numOfChannelsByBand[bandKey];
1314  const QVector<int> &bitsPerSamples=bitsPerSamplesByBand[bandKey];
1315 
1316  const QVector< QVector<int> >
1317  &errorRates_1=errorRates_1ByBand[bandKey],
1318  &errorRates_2=errorRates_2ByBand[bandKey],
1319  &bbcIdxs_1=bbcIdxs_1ByBand[bandKey],
1320  &bbcIdxs_2=bbcIdxs_2ByBand[bandKey],
1321  &corelIdxNumbersUsb=corelIdxNumbersUsbByBand[bandKey],
1322  &corelIdxNumbersLsb=corelIdxNumbersLsbByBand[bandKey];
1323  const SgVector *sampleRate=sampleRateByBand[bandKey];
1324  const SgMatrix *residFringeAmplByChan=residFringeAmplByChanByBand[bandKey],
1325  *residFringePhseByChan=residFringePhseByChanByBand[bandKey],
1326  *refFreqByChan=refFreqByChanByBand[bandKey],
1327  *numOfSamplesByChan_USB=numOfSamplesByChan_USBByBand[bandKey],
1328  *numOfSamplesByChan_LSB=numOfSamplesByChan_LSBByBand[bandKey],
1329  *numOfAccPeriodsByChan_USB=numOfAccPeriodsByChan_USBByBand[bandKey],
1330  *numOfAccPeriodsByChan_LSB=numOfAccPeriodsByChan_LSBByBand[bandKey],
1331  *loFreqs_1=loFreqs_1ByBand[bandKey],
1332  *loFreqs_2=loFreqs_2ByBand[bandKey];
1333 
1334  //
1335  // complain:
1336  //
1337  if (numOfAccPeriodsByChan_USB == NULL || numOfAccPeriodsByChan_LSB == NULL)
1339  "::getDataFromVgosDb(): numsOfAccPeriodsByChan_* == NULL");
1340  if (refFreqByChan == NULL)
1342  "::getDataFromVgosDb(): refFreqsByChan == NULL");
1343  if (residFringeAmplByChan == NULL)
1345  "::getDataFromVgosDb(): residFringeAmplByChan == NULL");
1346  //
1347  if (numOfChannels.size())
1348  {
1351  "::getDataFromVgosDb(): channel info is missing");
1352  };
1353  //
1354 
1355 
1356 // QVector<int> &ionDataFlags = ionDataFlagByBand[bandKey];
1357  // import observations:
1359  "::getDataFromVgosDb(): processing " + bandKey +
1360  "-band of the session " + vgosDb->getSessionName());
1361  int nYr, nMo, nDy, nHr, nMi;
1362  double dSec;
1363  SgMJD tStart(tZero), tStop(tZero);
1364 
1365  for (int obsIdx=0; obsIdx<numOfObs; obsIdx++)
1366  {
1367  bool hasPhaseCal;
1368  o = NULL;
1369  if ((dataFlag.size()>0 && dataFlag.at(obsIdx) != -1) ||
1370  ( ambigs && 0.0<ambigs->getElement(obsIdx) &&
1371  //snr && 0.0<snr->getElement(obsIdx) && // SNR is missing in early databases
1372  groupDelays)
1373  )
1374  {
1375  station1Name = stations_1.at(obsIdx);
1376  station2Name = stations_2.at(obsIdx);
1377  sourceName = sources.at(obsIdx);
1378  epoch = epochs4Obs.at(obsIdx);
1379  baselineName = station1Name + ":" + station2Name;
1380  obsKey.sprintf("%s",
1381  qPrintable(epoch.toString(SgMJD::F_INTERNAL) + "-" + baselineName + "@" + sourceName));
1382  // it have to be inserted already:
1383  if (observationByKey_.contains(obsKey))
1384  obs = observationByKey_.value(obsKey);
1385  else
1386  {
1388  "::getDataFromVgosDb(): the observation #" + QString("").setNum(obsIdx) + ", " +
1389  obsKey + ", does not exist in the container");
1390  return false;
1391  };
1392  //
1393  // need more robust checking for missed observables here
1394  o = new SgVlbiObservable(obs, band);
1395  o->setMediaIdx(obsIdx);
1396  obs->addObservable(bandKey, o);
1397  //
1398  // band's station #1:
1399  if (band->stationsByName().contains(station1Name))
1400  bandStation1Info = band->stationsByName().value(station1Name);
1401  else // new station, add it to the container:
1402  {
1403  bandStation1Info = new SgVlbiStationInfo(obs->getStation1Idx(), station1Name);
1404  band->stationsByName().insert(bandStation1Info->getKey(), bandStation1Info);
1405  band->stationsByIdx().insert(bandStation1Info->getIdx(), bandStation1Info);
1406  };
1407  // band's station #2:
1408  if (band->stationsByName().contains(station2Name))
1409  bandStation2Info = band->stationsByName().value(station2Name);
1410  else // new station, add it to the container:
1411  {
1412  bandStation2Info = new SgVlbiStationInfo(obs->getStation2Idx(), station2Name);
1413  band->stationsByName().insert(bandStation2Info->getKey(), bandStation2Info);
1414  band->stationsByIdx().insert(bandStation2Info->getIdx(), bandStation2Info);
1415  };
1416  // band's source:
1417  if (band->sourcesByName().contains(sourceName))
1418  bandSourceInfo = band->sourcesByName().value(sourceName);
1419  else // new source, add it to the container:
1420  {
1421  bandSourceInfo = new SgVlbiSourceInfo(obs->getSourceIdx(), sourceName);
1422  band->sourcesByName().insert(bandSourceInfo->getKey(), bandSourceInfo);
1423  band->sourcesByIdx().insert(bandSourceInfo->getIdx(), bandSourceInfo);
1424  };
1425  // band's baselines:
1426  if (band->baselinesByName().contains(baselineName))
1427  bandBaselineInfo = band->baselinesByName().value(baselineName);
1428  else // new baseline, add it to the container and register its index:
1429  {
1430  bandBaselineInfo = new SgVlbiBaselineInfo(obs->getBaselineIdx(), baselineName);
1431  band->baselinesByName().insert(bandBaselineInfo->getKey(), bandBaselineInfo);
1432  band->baselinesByIdx().insert(bandBaselineInfo->getIdx(), bandBaselineInfo);
1433  };
1434  // collect data:
1435  // single band delay:
1436  if (singleBandDelays)
1437  {
1438  o->sbDelay().setValue(singleBandDelays->getElement(obsIdx, 0));
1439  o->sbDelay().setSigma(singleBandDelays->getElement(obsIdx, 1));
1440  if (o->sbDelay().getSigma() < 5.0e-12)
1442  };
1443  // group delay:
1444  if (groupDelays)
1445  {
1446  o->grDelay().setValue(groupDelays->getElement(obsIdx, 0));
1447  o->grDelay().setSigma(groupDelays->getElement(obsIdx, 1));
1448  if (o->grDelay().getSigma() < 1.0e-15)
1450  };
1451  // delay rate:
1452  if (rates)
1453  {
1454  o->phDRate().setValue(rates->getElement(obsIdx, 0));
1455  o->phDRate().setSigma(rates->getElement(obsIdx, 1));
1456  };
1457  // ambiguity spacing:
1458  if (ambigs)
1459  o->grDelay().setAmbiguitySpacing(ambigs->getElement(obsIdx));
1460  // number of ambiguities:
1461  if (numAmbigs.size())
1462  o->grDelay().setNumOfAmbiguities(numAmbigs.at(obsIdx));
1463  // number of ambiguities:
1464  if (numSubAmbigs.size())
1465  o->grDelay().setNumOfSubAmbigs(numSubAmbigs.at(obsIdx));
1466  // number of ambiguities, phase delays:
1467  if (numPhsAmbigs.size())
1468  o->phDelay().setNumOfAmbiguities(numPhsAmbigs.at(obsIdx));
1469  // quality code:
1470  if (qCodes.size())
1471  {
1472  int d;
1473  bool isTmp;
1474  d = qCodes.at(obsIdx).toInt(&isTmp);
1475  if (!isTmp)
1476  d = -1;
1477  o->setQualityFactor(d);
1478  }
1479  else // old data, no quality code:
1480  o->setQualityFactor(9);
1481  // frequencies:
1482  if (refFreqs)
1483  o->setReferenceFrequency(refFreqs->getElement(obsIdx));
1484  if (effFreqs)
1485  {
1486  o->grDelay().setEffFreq(effFreqs->getElement(obsIdx, 0));
1487  o->phDelay().setEffFreq(effFreqs->getElement(obsIdx, 1));
1488  o->phDRate().setEffFreq(effFreqs->getElement(obsIdx, 2));
1489  };
1490  // correlation and SNR:
1491  if (correlation)
1492  o->setCorrCoeff(correlation->getElement(obsIdx));
1493  if (uv)
1494  {
1495  o->setUvFrPerAsec(0, uv->getElement(obsIdx, 0));
1496  o->setUvFrPerAsec(1, uv->getElement(obsIdx, 1));
1497  };
1498  if (calFeedCorr)
1499  {
1500  o->setCalcFeedCorrDelay(calFeedCorr->getElement(obsIdx, 0));
1501  o->setCalcFeedCorrRate (calFeedCorr->getElement(obsIdx, 1));
1502  };
1503  if (snr)
1504  o->setSnr(snr->getElement(obsIdx));
1505  // total phase:
1506  if (phases)
1507  o->setTotalPhase(phases->getElement(obsIdx, 0));
1508  //
1509  // Edits:
1510  // check for ionospheric correction, if it is already calculated, get it:
1511  if (ionCals && ionSigmas)
1512  {
1513  o->grDelay().setIonoValue(ionCals -> getElement(obsIdx, 0));
1514  o->phDRate().setIonoValue(ionCals -> getElement(obsIdx, 1));
1515  o->grDelay().setIonoSigma(ionSigmas->getElement(obsIdx, 0));
1516  o->phDRate().setIonoSigma(ionSigmas->getElement(obsIdx, 1));
1517  };
1518  if (phaseCals_1 && phaseCals_2)
1519  {
1520  o->setPhaseCalGrDelays(0, phaseCals_1->getElement(obsIdx, 0));
1521  o->setPhaseCalGrDelays(1, phaseCals_2->getElement(obsIdx, 0));
1522  o->setPhaseCalRates (0, phaseCals_1->getElement(obsIdx, 1));
1523  o->setPhaseCalRates (1, phaseCals_2->getElement(obsIdx, 1));
1524  };
1525  //
1526  // channel set up:
1527  if (bitsPerSamples.size())
1528  o->setBitsPerSample(bitsPerSamples.at(obsIdx));
1529  //
1530  // channel dependent stuff:
1531  //
1532  int nOfC=numOfChannels.size()?numOfChannels.at(obsIdx):0;
1533  if (nOfC>0)
1534  {
1536  int numOfActualChannels=0;
1537  // set up data:
1538  for (int j=0; j<nOfC; j++)
1539  {
1540  // channel setup:
1542  numOfAccPeriodsByChan_USB?numOfAccPeriodsByChan_USB->getElement(obsIdx, j):0.0);
1544  numOfAccPeriodsByChan_LSB?numOfAccPeriodsByChan_LSB->getElement(obsIdx, j):0.0);
1546  numOfSamplesByChan_USB?numOfSamplesByChan_USB->getElement(obsIdx, j):0.0);
1548  numOfSamplesByChan_LSB?numOfSamplesByChan_LSB->getElement(obsIdx, j):0.0);
1549  o->refFreqByChan()->setElement (j,
1550  refFreqByChan?refFreqByChan->getElement(obsIdx, j):0.0);
1551  if (0.0001 < o->refFreqByChan()->getElement(j))
1552  numOfActualChannels++;
1554  residFringeAmplByChan?residFringeAmplByChan->getElement(obsIdx, j):0.0);
1555  o->fringePhaseByChan()->setElement (j,
1556  residFringePhseByChan?residFringePhseByChan->getElement(obsIdx, j)/RAD2DEG:0.0);
1557  if (loFreqs_1 && loFreqs_1->nRow()>0 && loFreqs_1->nCol()>0)
1558  o->loFreqByChan_1()->setElement(j, loFreqs_1->getElement(obsIdx, j));
1559  if (loFreqs_2 && loFreqs_2->nRow()>0 && loFreqs_2->nCol()>0)
1560  o->loFreqByChan_2()->setElement(j, loFreqs_2->getElement(obsIdx, j));
1561 
1562  (*o->chanIdByChan())[j] = channelIds.size()?channelIds.at(obsIdx).at(2*j).toLatin1():' ';
1563  (*o->polarization_1ByChan())[j] = polarizations.size()?
1564  polarizations.at(obsIdx).at(4*j ).toLatin1():' ';
1565  (*o->polarization_2ByChan())[j] = polarizations.size()?
1566  polarizations.at(obsIdx).at(4*j + 2).toLatin1():' ';
1567  (*o->corelIndexNumUSB())[j] = corelIdxNumbersUsb.size()?corelIdxNumbersUsb.at(obsIdx).at(j):0;
1568  (*o->corelIndexNumLSB())[j] = corelIdxNumbersLsb.size()?corelIdxNumbersLsb.at(obsIdx).at(j):0;
1569  (*o->bbcIdxByChan_1())[j] = bbcIdxs_1.size()?bbcIdxs_1.at(obsIdx).at(j):0;
1570  (*o->bbcIdxByChan_2())[j] = bbcIdxs_2.size()?bbcIdxs_2.at(obsIdx).at(j):0;
1571  //
1572  //
1573  // phase calibration data:
1574  if (phaseCalAmps_1 && phaseCalAmps_2 && phaseCalPhases_1 && phaseCalPhases_2 &&
1575  phaseCalFreqs_1 && phaseCalFreqs_2 && phaseCalOffsets_1 && phaseCalOffsets_2)
1576  {
1578  phaseCalAmps_1->getElement(obsIdx, j));
1580  phaseCalAmps_2->getElement(obsIdx, j));
1582  phaseCalPhases_1->getElement(obsIdx, j)*DEG2RAD/100.0);
1584  phaseCalPhases_2->getElement(obsIdx, j)*DEG2RAD/100.0);
1586  phaseCalFreqs_1->getElement(obsIdx, j));
1588  phaseCalFreqs_2->getElement(obsIdx, j));
1590  phaseCalOffsets_1->getElement(obsIdx, j)*DEG2RAD/100.0);
1592  phaseCalOffsets_2->getElement(obsIdx, j)*DEG2RAD/100.0);
1593  hasPhaseCal = true;
1594  }
1595  else
1596  hasPhaseCal = false;
1597  //
1598  //
1599  if (errorRates_1.size())
1600  o->phaseCalData_1ByChan()->setElement (4,j, errorRates_1.at(obsIdx).at(j));
1601  if (errorRates_2.size())
1602  o->phaseCalData_2ByChan()->setElement (4,j, errorRates_2.at(obsIdx).at(j));
1603  //
1604  //
1605  QString ifId((*o->chanIdByChan())[j]);
1606  if (ifId.size() && ifId!=QString(" "))
1607  {
1608  if (skyFreqByIfId_.contains(ifId) &&
1609  skyFreqByIfId_.value(ifId) != o->refFreqByChan()->getElement(j))
1611  "::getDataFromVgosDb(): the IF \"" + ifId + "\" got new sky frequency " +
1612  QString("").sprintf("%.4f (old=%.4f) obs:",
1613  o->refFreqByChan()->getElement(j), skyFreqByIfId_.value(ifId)) +
1614  o->strId());
1615  skyFreqByIfId_[ifId] = o->refFreqByChan()->getElement(j);
1616  };
1617  };
1618  //
1619  if (cppsSoft_ != CPPS_PIMA && hasPhaseCal)
1620  o->calcPhaseCalDelay();
1621  //
1622  if (sampleRate && numOfActualChannels &&
1623  cppsSoft_ != CPPS_PIMA &&
1624  vgosDb->getCorrelatorType() != SgVgosDb::CT_S2)
1625  {
1626  o->setSampleRate(sampleRate->getElement(obsIdx));
1627  // calculate the effective frequencies:
1629  *o->refFreqByChan(), *o->fringeAmplitudeByChan(),
1631  sampleRate->getElement(obsIdx), o->getReferenceFrequency(),
1632  nOfC, effFreq4GR, effFreq4PH, effFreq4RT, correlatorType, o->strId());
1633  o->grDelay().setEffFreq(effFreq4GR);
1634  o->phDelay().setEffFreq(effFreq4PH);
1635  o->phDRate().setEffFreq(effFreq4RT);
1636  // calculate the effective frequencies with equal weights:
1638  *o->refFreqByChan(), *o->fringeAmplitudeByChan(),
1640  sampleRate->getElement(obsIdx), o->getReferenceFrequency(),
1641  nOfC, effFreq4GR, effFreq4PH, effFreq4RT, correlatorType, o->strId(), true);
1642  o->grDelay().setEffFreqEqWgt(effFreq4GR);
1643  o->phDelay().setEffFreqEqWgt(effFreq4PH);
1644  o->phDRate().setEffFreqEqWgt(effFreq4RT);
1645  };
1646  }
1647  else if (numOfChannels.size())
1649  "::getDataFromVgosDb(): get zero number of channels: " + o->strId());
1650  //
1651  //
1652  //
1653  // correlator info stuff:
1654  if (fourfitOutputFName.size())
1655  o->setFourfitOutputFName(fourfitOutputFName.at(obsIdx));
1656  if (fourfitErrorCodes.size())
1657  o->setErrorCode(fourfitErrorCodes.at(obsIdx));
1658  //
1659  if (baselineCodes.size() && cppsSoft_ != CPPS_PIMA)
1660  {
1661  char cid;
1662  cid = baselineCodes.at(obsIdx).at(0).toLatin1();
1663  station1Info = stationsByName_.value(station1Name);
1664  if (station1Info->getCid() == ' ')
1665  {
1666  station1Info->setCid(cid);
1668  "::getDataFromVgosDb(): station#1 " + station1Info->getKey() + " set station CID to \"" +
1669  cid + "\" at " + o->strId());
1670  }
1671  else if (station1Info->getCid() != cid)
1672  {
1674  "::getDataFromVgosDb(): station#1 " + station1Info->getKey() +
1675  " station CID missmatch: \"" + station2Info->getCid() + "\" vs \"" + cid +
1676  "\" at " + o->strId());
1677  };
1678  cid = baselineCodes.at(obsIdx).at(1).toLatin1();
1679  station2Info = stationsByName_.value(station2Name);
1680  if (station2Info->getCid() == ' ')
1681  {
1682  station2Info->setCid(cid);
1684  "::getDataFromVgosDb(): station#2 " + station2Info->getKey() + " set station CID to \"" +
1685  cid + "\" at " + o->strId());
1686  }
1687  else if (station2Info->getCid() != cid)
1688  {
1690  "::getDataFromVgosDb(): station#2 " + station2Info->getKey() +
1691  " station CID missmatch: \"" + station2Info->getCid() + "\" vs \"" + cid +
1692  "\" at " + o->strId());
1693  };
1694  };
1695  //
1696  if (tapeQualityCodes.size())
1697  o->setTapeQualityCode(tapeQualityCodes.at(obsIdx));
1698  if (vlb1FileNames.size())
1699  obs->setCorrRootFileName(vlb1FileNames.at(obsIdx));
1700  if (tapeIds_1.size() && obs->auxObs_1())
1701  obs->auxObs_1()->setTapeId(tapeIds_1.at(obsIdx));
1702  if (tapeIds_2.size() && obs->auxObs_2())
1703  obs->auxObs_2()->setTapeId(tapeIds_2.at(obsIdx));
1704  if (startOffsets.size())
1705  o->setStartOffset(startOffsets.at(obsIdx));
1706  if (stopOffsets.size())
1707  o->setStopOffset(stopOffsets.at(obsIdx));
1708  if (hopsRevisionNumbers.size())
1709  o->setHopsRevisionNumber(hopsRevisionNumbers.at(obsIdx));
1710  if (fourfitVersions.size() && 2<=fourfitVersions.at(obsIdx).size())
1711  {
1712  o->setFourfitVersion(0, fourfitVersions.at(obsIdx).at(0));
1713  o->setFourfitVersion(1, fourfitVersions.at(obsIdx).at(1));
1714  };
1715  //
1716  // epochs:
1717  if (epochsOfCorrelations.size() && 6<=epochsOfCorrelations.at(obsIdx).size())
1718  {
1719  epoch.setUpEpoch(epochsOfCorrelations.at(obsIdx).at(0), epochsOfCorrelations.at(obsIdx).at(1),
1720  epochsOfCorrelations.at(obsIdx).at(2), epochsOfCorrelations.at(obsIdx).at(3),
1721  epochsOfCorrelations.at(obsIdx).at(4), (double)epochsOfCorrelations.at(obsIdx).at(5));
1722  o->setEpochOfCorrelation(epoch);
1723  };
1724  if (epochsOfCentrals.size() && 6<=epochsOfCentrals.at(obsIdx).size())
1725  {
1726  epoch.setUpEpoch(epochsOfCentrals.at(obsIdx).at(0), epochsOfCentrals.at(obsIdx).at(1),
1727  epochsOfCentrals.at(obsIdx).at(2), epochsOfCentrals.at(obsIdx).at(3),
1728  epochsOfCentrals.at(obsIdx).at(4), (double)epochsOfCentrals.at(obsIdx).at(5));
1729  o->setEpochCentral(epoch);
1730  };
1731  if (epochsOfFourfitings.size() && 6<=epochsOfFourfitings.at(obsIdx).size())
1732  {
1733  epoch.setUpEpoch(epochsOfFourfitings.at(obsIdx).at(0), epochsOfFourfitings.at(obsIdx).at(1),
1734  epochsOfFourfitings.at(obsIdx).at(2), epochsOfFourfitings.at(obsIdx).at(3),
1735  epochsOfFourfitings.at(obsIdx).at(4), (double)epochsOfFourfitings.at(obsIdx).at(5));
1736  o->setEpochOfFourfitting(epoch);
1737  };
1738  if (epochsOfNominalScanTime.size() && 6<=epochsOfNominalScanTime.at(obsIdx).size())
1739  {
1740  epoch.setUpEpoch(epochsOfNominalScanTime.at(obsIdx).at(0),
1741  epochsOfNominalScanTime.at(obsIdx).at(1),
1742  epochsOfNominalScanTime.at(obsIdx).at(2), epochsOfNominalScanTime.at(obsIdx).at(3),
1743  epochsOfNominalScanTime.at(obsIdx).at(4), (double)epochsOfNominalScanTime.at(obsIdx).at(5));
1744  o->setEpochOfScan(epoch);
1745  };
1746  //
1747  if (deltaEpochs)
1748  o->setCentrOffset(deltaEpochs->getElement(obsIdx));
1749  if (smplRate)
1750  o->setSampleRate(smplRate->getElement(obsIdx));
1751  if (sbdResids)
1752  o->sbDelay().setResidualFringeFitting(sbdResids->getElement(obsIdx));
1753  if (rateResids)
1754  o->phDRate().setResidualFringeFitting(rateResids->getElement(obsIdx));
1755  if (effDurations)
1756  o->setEffIntegrationTime(effDurations->getElement(obsIdx));
1757  //
1758  if (startSeconds && stopSeconds)
1759  {
1760  SgMJD::MJD_reverse(o->owner()->getDate(), o->owner()->getTime(),
1761  nYr, nMo, nDy, nHr, nMi, dSec);
1762  tStart = SgMJD(nYr, nMo, nDy, nHr, 0, startSeconds->getElement(obsIdx));
1763  tStop = SgMJD(nYr, nMo, nDy, nHr, 0, stopSeconds->getElement(obsIdx));
1764  if (tStart - *o->owner() > 40.0/24.0/60.0)
1765  tStart -= 1.0/24.0;
1766  if (*o->owner() - tStart > 40.0/24.0/60.0)
1767  tStart += 1.0/24.0;
1768  if (*o->owner() - tStop > 40.0/24.0/60.0)
1769  tStop += 1.0/24.0;
1770  if (tStop - *o->owner() > 40.0/24.0/60.0)
1771  tStop -= 1.0/24.0;
1772  if (tStart < tStop)
1773  {
1774  o->setTstart(tStart);
1775  o->setTstop (tStop);
1776  }
1777  else
1778  {
1779  o->setTstart(tStop);
1780  o->setTstop (tStart);
1781  };
1782  };
1783  //
1784  if (percentOfDiscards)
1785  o->setDiscardRatio(percentOfDiscards->getElement(obsIdx));
1786  if (uniformityFactors)
1787  o->setAcceptedRatio(uniformityFactors->getElement(obsIdx));
1788  if (geocenterPhaseResids)
1789  o->setGeocenterResidPhase(geocenterPhaseResids->getElement(obsIdx)/RAD2DEG);
1790  if (geocenterPhaseTotals)
1791  o->setGeocenterTotalPhase(geocenterPhaseTotals->getElement(obsIdx)/RAD2DEG);
1792  if (geocenterSbDelays)
1793  o->sbDelay().setGeocenterValue(geocenterSbDelays->getElement(obsIdx));
1794  if (geocenterGrDelays)
1795  o->grDelay().setGeocenterValue(geocenterGrDelays->getElement(obsIdx));
1796  if (geocenterDelayRates)
1797  o->phDRate().setGeocenterValue(geocenterDelayRates->getElement(obsIdx));
1798  if (delayResids)
1799  o->grDelay().setResidualFringeFitting(delayResids->getElement(obsIdx));
1800  if (probOfFalses)
1801  o->setProbabOfFalseDetection(probOfFalses->getElement(obsIdx));
1802  if (corrAprioriDelays)
1803  o->setAprioriDra(0, corrAprioriDelays->getElement(obsIdx));
1804  if (corrAprioriRates)
1805  o->setAprioriDra(1, corrAprioriRates->getElement(obsIdx));
1806  if (corrAprioriAccs)
1807  o->setAprioriDra(2, corrAprioriAccs->getElement(obsIdx));
1808  if (incohAmps)
1809  o->setIncohChanAddAmp(incohAmps->getElement(obsIdx));
1810  if (incohAmps2)
1811  o->setIncohSegmAddAmp(incohAmps2->getElement(obsIdx));
1812 
1813  // matrices:
1814  if (urvrs)
1815  {
1816  o->setUrVr(0, urvrs->getElement(obsIdx,0));
1817  o->setUrVr(1, urvrs->getElement(obsIdx,1));
1818  };
1819  if (instrDelays)
1820  {
1821  o->setInstrDelay(0, instrDelays->getElement(obsIdx,0));
1822  o->setInstrDelay(1, instrDelays->getElement(obsIdx,1));
1823  };
1824  //
1825  if (starElev)
1826  {
1827  o->setCorrelStarElev_1(starElev->getElement(obsIdx, 0)/RAD2DEG);
1828  o->setCorrelStarElev_2(starElev->getElement(obsIdx, 1)/RAD2DEG);
1829  };
1830  if (zenithDelays)
1831  {
1832  o->setCorrelZdelay_1(zenithDelays->getElement(obsIdx, 0));
1833  o->setCorrelZdelay_2(zenithDelays->getElement(obsIdx, 1));
1834  };
1835  //
1836  if (searchParams)
1837  for (int j=0; j<6; j++)
1838  o->setFourfitSearchParameters(j, searchParams->getElement(obsIdx,j));
1839  if (corrClocks)
1840  {
1841  o->setCorrClocks(0, 0, corrClocks->getElement(obsIdx,0));
1842  o->setCorrClocks(0, 1, corrClocks->getElement(obsIdx,1));
1843  o->setCorrClocks(1, 0, corrClocks->getElement(obsIdx,2));
1844  o->setCorrClocks(1, 1, corrClocks->getElement(obsIdx,3));
1845  };
1846  if (mDlys)
1847  {
1848  o->vDlys()->setElement(0, mDlys->getElement(obsIdx,0));
1849  o->vDlys()->setElement(1, mDlys->getElement(obsIdx,1));
1850  o->vDlys()->setElement(2, mDlys->getElement(obsIdx,2));
1851  };
1852  if (mAux)
1853  {
1854  o->vAuxData()->setElement(0, mAux->getElement(obsIdx,0));
1855  o->vAuxData()->setElement(1, mAux->getElement(obsIdx,1)/RAD2DEG);
1856  o->vAuxData()->setElement(2, mAux->getElement(obsIdx,2));
1857  o->vAuxData()->setElement(3, mAux->getElement(obsIdx,3));
1858  };
1859  // EoCIS
1860  //
1861  if (fourfitControlFile.size())
1862  o->setFourfitControlFile(fourfitControlFile.at(obsIdx));
1863  if (fourfitCommand.size())
1864  o->setFourfitCommandOverride(fourfitCommand.at(obsIdx));
1865  if (numLags.size())
1866  o->setNlags(numLags.at(obsIdx));
1867  if (apLength.size())
1868  obs->setApLength(apLength.at(obsIdx));
1869 
1870  if (delUFlags.size())
1871  o->grDelay().setUnweightFlag(delUFlags.at(obsIdx));
1872  // config_ can be NULL:
1874  (o->grDelay().getUnweightFlag()==1 || o->grDelay().getUnweightFlag()==2))
1876  if (ratUFlags.size())
1877  o->phDRate().setUnweightFlag(ratUFlags.at(obsIdx));
1878  if (phsUFlags.size())
1879  o->phDelay().setUnweightFlag(phsUFlags.at(obsIdx));
1880  // + uAcSup, where to put it?
1881  //
1882  if (ambigs && ambigs->getElement(obsIdx)<=0.0 && // no ambigs for
1883  groupDelays && groupDelays->getElement(obsIdx, 1) > 0.0) // good observation
1884  {
1885  o->setErrorCode("Z");
1886  if (vgosDb->getCorrelatorType()!=SgVgosDb::CT_Unknown || ambigs->getElement(obsIdx)<0.0)
1888  "::getDataFromVgosDb(): wrong ambiguity spacing (" +
1889  QString("").setNum(ambigs->getElement(obsIdx)) + ") for the observable #" +
1890  QString("").setNum(obsIdx) + " at the " + bandKey + "-band of " + obs->getKey() +
1891  " on " + name_);
1892  };
1893  if (qCodes.size() &&
1894  qCodes.at(obsIdx).simplified().size() == 0 && // it is ok, nothing to complain
1895  o->getErrorCode().simplified().size() == 0)
1896  o->setErrorCode("Y");
1897  //
1898  // per band statistics:
1899  band ->incNumTotal(DT_DELAY);
1900  bandStation1Info->incNumTotal(DT_DELAY);
1901  bandStation2Info->incNumTotal(DT_DELAY);
1902  bandSourceInfo ->incNumTotal(DT_DELAY);
1903  bandBaselineInfo->incNumTotal(DT_DELAY);
1904 
1905  band ->incNumTotal(DT_RATE);
1906  bandStation1Info->incNumTotal(DT_RATE);
1907  bandStation2Info->incNumTotal(DT_RATE);
1908  bandSourceInfo ->incNumTotal(DT_RATE);
1909  bandBaselineInfo->incNumTotal(DT_RATE);
1910  }
1911  else
1913  "::getDataFromVgosDb(): skipped observable #" + QString("").setNum(obsIdx) +
1914  " at the " + bandKey + "-band: missed data");
1915  };
1916  //
1917  // set up band's attributes:
1918  band->setTCreation(vgosDb->getDateOfCreation());
1919  band->setInputFileName(vgosDb->getWrapperFileName());
1920 /*
1921  if (hasCorrelatorType_)
1922  band->setCorrelatorType(image->getStr(dCorrelatorType_, 0,0));
1923 */
1924 
1925  if ((ionCals && ionSigmas) || (dTec && dTecStdDev))
1926  {
1929  };
1930  //
1931  // quick'n'dirty:
1932  int idx(0);
1933  o = observations_.at(idx)->observable(bandKey);
1934  while (!o && idx<observations_.size())
1935  o = observations_.at(idx++)->observable(bandKey);
1936  if (o)
1937  band->setFrequency(o->getReferenceFrequency());
1938  };
1939  //
1940  //
1942  "::getDataFromVgosDb(): collected " + QString().setNum(skyFreqByIfId_.size()) +
1943  " ifId<->skyFrq pairs");
1944 
1945  //
1946  // check for fourfit info:
1947  if (fourfitControlFileByBand.size() && fourfitControlFileByBand.begin().value().size()==0)
1948  {
1950  "::getDataFromVgosDb(): no fourfit info found for each band, trying to check the data for the "
1951  "X-band only");
1952 
1953  QVector<QString> fourfitControlFile, fourfitCommand;
1954  QVector<int> numLags;
1955  QVector<double> apL;
1956 
1957  if (!vgosDb->loadMiscFourFit("", fourfitControlFile, fourfitCommand, numLags, apL))
1959  "::getDataFromVgosDb(): reading Fourfit Info has failed");
1960  else
1961  {
1962  for (int i=0; i<numOfObs; i++)
1963  {
1964  SgVlbiObservation *obs=observations_.at(i);
1965  for (QMap<QString, SgVlbiObservable*>::iterator it=obs->observableByKey().begin();
1966  it!=obs->observableByKey().end(); ++it)
1967  {
1968 // SgVlbiObservable *o=obs->observable("X");
1969  SgVlbiObservable *o=it.value();
1970  if (o)
1971  {
1972  o->setFourfitControlFile(fourfitControlFile.at(i));
1973  o->setFourfitCommandOverride(fourfitCommand.at(i));
1974  o->setNlags(numLags.at(i));
1975  };
1976  };
1977  obs->setApLength(apL.at(i));
1978  };
1979  };
1980  fourfitControlFile.clear();
1981  fourfitCommand.clear();
1982  numLags.clear();
1983  apL.clear();
1984  };
1985  //
1986  //
1987  //
1988  if (dTec && dTecStdDev)
1990  //
1991  //
1992  //
1993  // end of phase 1
1994  //
1995  //
1996  //
1997  // checks for available "contributions":
1998  if (calOcean)
1999  hasOceanTideContrib_ = true;
2000  if (calPoleTide)
2001  hasPoleTideContrib_= true;
2002  if (calEarthTide)
2003  hasEarthTideContrib_= true;
2004  if (calWobbleX)
2005  hasWobblePxContrib_= true;
2006  if (calWobbleY)
2007  hasWobblePyContrib_= true;
2008  if (calWobNut)
2009  hasWobbleNutContrib_= true;
2010  if (calEopHiFiXY)
2012  if (calEopHiFiUt)
2013  hasUt1HighFreqContrib_ = true;
2014  if (calTiltRmvr)
2015  hasTiltRemvrContrib_= true;
2016  if (calHiFreqLibrationPm)
2017  hasPxyLibrationContrib_ = true;
2018  if (calHiFreqLibrationUt)
2019  hasUt1LibrationContrib_ = true;
2020  if (calOceanPoleTideLd)
2021  hasOceanPoleTideContrib_ = true;
2022  if (calPoleTideOldRestore)
2023  hasPoleTideOldContrib_= true;
2024  if (calOceanOld)
2025  hasOceanTideOldContrib_ = true;
2026  hasUnPhaseCalContrib_= true;
2027  for (int i=0; i<listOfBands.size(); i++)
2028  {
2029  const QString &bandKey=listOfBands.at(i);
2031  phaseCals_1ByBand[bandKey]!=NULL && phaseCals_2ByBand[bandKey]!=NULL;
2032  };
2033  if (dV_dCipX && dV_dCipY)
2034  hasCipPartials_ = true;
2035  else
2036  hasCipPartials_ = false;
2037  //
2038  //
2039  // clear temporary storages:
2040  for (int i=0; i<vectors2del.size(); i++)
2041  if (vectors2del.at(i))
2042  delete vectors2del.at(i);
2043 
2044  for (int i=0; i<matrices2del.size(); i++)
2045  if (matrices2del.at(i))
2046  delete matrices2del.at(i);
2047  //
2048  scanNames.clear();
2049  scanFullNames.clear();
2050  ionsBits.clear();
2051  obs2Scan.clear();
2052  delUFlags.clear();
2053  phsUFlags.clear();
2054  ratUFlags.clear();
2055  uAcSups.clear();
2056 
2057  for (int i=0; i<listOfBands.size(); i++)
2058  {
2059  const QString &bandKey=listOfBands.at(i);
2060  qCodesByBand[bandKey].clear();
2061 
2062  // correlator info stuff:
2063  fourfitOutputFNameByBand[bandKey].clear();
2064  fourfitErrorCodesByBand[bandKey].clear();
2065  baselineCodesByBand[bandKey].clear();
2066  tapeQualityCodesByBand[bandKey].clear();
2067  vlb1FileNamesByBand[bandKey].clear();
2068  tapeIds_1ByBand[bandKey].clear();
2069  tapeIds_2ByBand[bandKey].clear();
2070 // corelVersionsByBand[bandKey].clear();
2071  startOffsetsByBand[bandKey].clear();
2072  stopOffsetsByBand[bandKey].clear();
2073  hopsRevisionNumbersByBand[bandKey].clear();
2074  fourfitVersionsByBand[bandKey].clear();
2075 // dbeditVersionByBand[bandKey].clear();
2076  epochsOfCorrelationsByBand[bandKey].clear();
2077  epochsOfCentralsByBand[bandKey].clear();
2078  epochsOfFourfitingsByBand[bandKey].clear();
2079  epochsOfNominalScanTimeByBand[bandKey].clear();
2080  if (deltaEpochsByBand[bandKey])
2081  delete deltaEpochsByBand[bandKey];
2082  if (smplRateByBand[bandKey])
2083  delete smplRateByBand[bandKey];
2084  if (sbdResidsByBand[bandKey])
2085  delete sbdResidsByBand[bandKey];
2086  if (rateResidsByBand[bandKey])
2087  delete rateResidsByBand[bandKey];
2088  if (effDurationsByBand[bandKey])
2089  delete effDurationsByBand[bandKey];
2090  if (startSecondsByBand[bandKey])
2091  delete startSecondsByBand[bandKey];
2092  if (stopSecondsByBand[bandKey])
2093  delete stopSecondsByBand[bandKey];
2094  if (percentOfDiscardsByBand[bandKey])
2095  delete percentOfDiscardsByBand[bandKey];
2096 
2097  if (uniformityFactorsByBand[bandKey])
2098  delete uniformityFactorsByBand[bandKey];
2099  if (geocenterPhaseResidsByBand[bandKey])
2100  delete geocenterPhaseResidsByBand[bandKey];
2101  if (geocenterPhaseTotalsByBand[bandKey])
2102  delete geocenterPhaseTotalsByBand[bandKey];
2103  if (geocenterSbDelaysByBand[bandKey])
2104  delete geocenterSbDelaysByBand[bandKey];
2105  if (geocenterGrDelaysByBand[bandKey])
2106  delete geocenterGrDelaysByBand[bandKey];
2107  if (geocenterDelayRatesByBand[bandKey])
2108  delete geocenterDelayRatesByBand[bandKey];
2109  if (probOfFalsesByBand[bandKey])
2110  delete probOfFalsesByBand[bandKey];
2111  if (corrAprioriDelaysByBand[bandKey])
2112  delete corrAprioriDelaysByBand[bandKey];
2113  if (corrAprioriRatesByBand[bandKey])
2114  delete corrAprioriRatesByBand[bandKey];
2115  if (corrAprioriAccsByBand[bandKey])
2116  delete corrAprioriAccsByBand[bandKey];
2117  if (incohAmpsByBand[bandKey])
2118  delete incohAmpsByBand[bandKey];
2119  if (incohAmps2ByBand[bandKey])
2120  delete incohAmps2ByBand[bandKey];
2121  if (delayResidsByBand[bandKey])
2122  delete delayResidsByBand[bandKey];
2123  if (urvrsByBand[bandKey])
2124  delete urvrsByBand[bandKey];
2125  if (instrDelaysByBand[bandKey])
2126  delete instrDelaysByBand[bandKey];
2127  if (starElevByBand[bandKey])
2128  delete starElevByBand[bandKey];
2129  if (zenithDelaysByBand[bandKey])
2130  delete zenithDelaysByBand[bandKey];
2131  if (searchParamsByBand[bandKey])
2132  delete searchParamsByBand[bandKey];
2133  if (corrClocksByBand[bandKey])
2134  delete corrClocksByBand[bandKey];
2135  if (mDlysByBand[bandKey])
2136  delete mDlysByBand[bandKey];
2137  if (mAuxByBand[bandKey])
2138  delete mAuxByBand[bandKey];
2139  // EoCIS
2140 
2141  fourfitControlFileByBand[bandKey].clear();
2142  fourfitCommandByBand[bandKey].clear();
2143  numLagsByBand[bandKey].clear();
2144  apLengthByBand[bandKey].clear();
2145 
2146  numAmbigsByBand[bandKey].clear();
2147  numSubAmbigsByBand[bandKey].clear();
2148  numPhsAmbigsByBand[bandKey].clear();
2149  dataFlagByBand[bandKey].clear();
2150  ionDataFlagByBand[bandKey].clear();
2151  if (ambigsByBand[bandKey])
2152  delete ambigsByBand[bandKey];
2153  if (correlationByBand[bandKey])
2154  delete correlationByBand[bandKey];
2155  if (uvByBand[bandKey])
2156  delete uvByBand[bandKey];
2157  if (calFeedCorrByBand[bandKey])
2158  delete calFeedCorrByBand[bandKey];
2159  if (snrByBand[bandKey])
2160  delete snrByBand[bandKey];
2161  if (sampleRateByBand[bandKey])
2162  delete sampleRateByBand[bandKey];
2163  if (residFringeAmplByChanByBand[bandKey])
2164  delete residFringeAmplByChanByBand[bandKey];
2165  if (residFringePhseByChanByBand[bandKey])
2166  delete residFringePhseByChanByBand[bandKey];
2167  if (refFreqByChanByBand[bandKey])
2168  delete refFreqByChanByBand[bandKey];
2169  if (numOfSamplesByChan_USBByBand[bandKey])
2170  delete numOfSamplesByChan_USBByBand[bandKey];
2171  if (numOfSamplesByChan_LSBByBand[bandKey])
2172  delete numOfSamplesByChan_LSBByBand[bandKey];
2173  if (numOfAccPeriodsByChan_USBByBand[bandKey])
2174  delete numOfAccPeriodsByChan_USBByBand[bandKey];
2175  if (numOfAccPeriodsByChan_LSBByBand[bandKey])
2176  delete numOfAccPeriodsByChan_LSBByBand[bandKey];
2177  if (loFreqs_1ByBand[bandKey])
2178  delete loFreqs_1ByBand[bandKey];
2179  if (loFreqs_2ByBand[bandKey])
2180  delete loFreqs_2ByBand[bandKey];
2181 
2182  if (refFreqsByBand[bandKey])
2183  delete refFreqsByBand[bandKey];
2184  if (phasesByBand[bandKey])
2185  delete phasesByBand[bandKey];
2186  if (ionCalsByBand[bandKey])
2187  delete ionCalsByBand[bandKey];
2188  if (ionSigmasByBand[bandKey])
2189  delete ionSigmasByBand[bandKey];
2190  if (phaseCals_1ByBand[bandKey])
2191  delete phaseCals_1ByBand[bandKey];
2192  if (phaseCals_2ByBand[bandKey])
2193  delete phaseCals_2ByBand[bandKey];
2194  if (ratesByBand[bandKey])
2195  delete ratesByBand[bandKey];
2196  if (groupDelaysByBand[bandKey])
2197  delete groupDelaysByBand[bandKey];
2198  if (singleBandDelaysByBand[bandKey])
2199  delete singleBandDelaysByBand[bandKey];
2200  if (phaseCalFreqs_1ByBand[bandKey])
2201  delete phaseCalFreqs_1ByBand[bandKey];
2202  if (phaseCalAmps_1ByBand[bandKey])
2203  delete phaseCalAmps_1ByBand[bandKey];
2204  if (phaseCalPhases_1ByBand[bandKey])
2205  delete phaseCalPhases_1ByBand[bandKey];
2206  if (phaseCalOffsets_1ByBand[bandKey])
2207  delete phaseCalOffsets_1ByBand[bandKey];
2208  if (phaseCalRates_1ByBand[bandKey])
2209  delete phaseCalRates_1ByBand[bandKey];
2210  if (phaseCalFreqs_2ByBand[bandKey])
2211  delete phaseCalFreqs_2ByBand[bandKey];
2212  if (phaseCalAmps_2ByBand[bandKey])
2213  delete phaseCalAmps_2ByBand[bandKey];
2214  if (phaseCalPhases_2ByBand[bandKey])
2215  delete phaseCalPhases_2ByBand[bandKey];
2216  if (phaseCalOffsets_2ByBand[bandKey])
2217  delete phaseCalOffsets_2ByBand[bandKey];
2218  if (phaseCalRates_2ByBand[bandKey])
2219  delete phaseCalRates_2ByBand[bandKey];
2220  };
2221  listOfBands.clear();
2222  epochs4Scans.clear();
2223  epochs4Obs.clear();
2224  stations_1.clear();
2225  stations_2.clear();
2226  sources.clear();
2227  //
2228  //
2229  //
2230  //
2231  // Phase two. Collecting station infos:
2232  bool isCalced=isAttr(Attr_HAS_CALC_DATA);
2233  bool hasAuxObs=false;
2234  for (StationsByName_it it=stationsByName_.begin(); it!=stationsByName_.end(); ++it)
2235  {
2236  SgVlbiStationInfo *stInfo = it.value();
2237  QString origin("");
2238  //
2239  if (parametersDescriptor_) // can be NULL
2240  {
2243  };
2244  //
2245  const QString stnName(stInfo->getKey());
2246  QList<SgMJD> stEpochs;
2247  if (vgosDb->loadStationEpochs(stnName, stEpochs) && stEpochs.size())
2248  {
2249  int numOfPts=stEpochs.size();
2250  int numOfTsysIFs=0;
2251 // QMap<SgMJD, int> idxByMjd;
2252  QMap<QString, int> idxByMjd;
2253  for (int i=0; i<numOfPts; i++)
2254  idxByMjd.insert(stEpochs.at(i).toString(SgMJD::F_YYYYMMDDHHMMSSSS), i);
2255 
2256  SgVector *parAngle=NULL, *refClockOffset=NULL;
2257  SgMatrix *azTheo=NULL, *elTheo=NULL;
2258  SgMatrix *calAxisOffset=NULL;
2259  SgMatrix *calCable=NULL;
2260  SgMatrix *calCblCorrections=NULL;
2261  SgMatrix *calNmfDry=NULL;
2262  SgMatrix *calNmfWet=NULL;
2263  SgMatrix *calHorzOLoad=NULL, *calVertOLoad=NULL;
2264  SgVector *metAtmPres=NULL, *metAtmRH=NULL, *metAtmTemp=NULL;
2265  SgMatrix *partAxisOffset=NULL;
2266  SgMatrix *partTropZenithDry=NULL, *partTropZenithWet=NULL, *partTropGrad=NULL;
2267  SgMatrix *ocnLdR=NULL, *ocnLdV=NULL;
2268  SgMatrix *tSyses=NULL;
2269  //
2270  QVector<double> tsysFreqs;
2271  QVector<QString> tsysIds, tsysSbs, tsysPzs;
2272 
2273  // KOMB:
2274  if (!vgosDb->loadStationRefClockOffset(stnName, refClockOffset))
2276  "::getDataFromVgosDb(): no reference station clock offset data found for the station " +
2277  stnName); // it is ok
2278  // data from CALC:
2279  if (isCalced && !vgosDb->loadStationAzEl(stnName, azTheo, elTheo))
2281  "::getDataFromVgosDb(): reading of azimuth-elevation file failed for the station " + stnName);
2282  if (isCalced && !vgosDb->loadStationParAngle(stnName, parAngle))
2284  "::getDataFromVgosDb(): reading of parallactic angle file failed for the station " + stnName);
2285  if (isCalced && !vgosDb->loadStationOceanLdDisp(stnName, ocnLdR, ocnLdV))
2287  "::getDataFromVgosDb(): reading of Ocean Loading displacements file failed for the station " +
2288  stnName);
2289  if (isCalced && !vgosDb->loadStationCalAxisOffset(stnName, calAxisOffset))
2291  "::getDataFromVgosDb(): reading of axis offset calibrations file failed for the station " +
2292  stnName);
2293  //
2294  if (isCalced && !vgosDb->loadStationCalSlantPathTropDry(stnName, calNmfDry, kind))
2296  "::getDataFromVgosDb(): reading of hydrostatic troposphere calibrations file failed for the "
2297  "station " + stnName);
2298  else if (!kind.isEmpty() && kind.toUpper() != "NMF")
2300  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of hydrostatic troposphere "
2301  "calibrations for the station " + stnName);
2302  //
2303  if (isCalced && !vgosDb->loadStationCalSlantPathTropWet(stnName, calNmfWet, kind))
2305  "::getDataFromVgosDb(): reading of wet troposphere calibrations file failed for the "
2306  "station " + stnName);
2307  else if (!kind.isEmpty() && kind.toUpper() != "NMF")
2309  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of wet troposphere "
2310  "calibrations for the station " + stnName);
2311  //
2312  if (isCalced && !vgosDb->loadStationCalOceanLoad(stnName, calHorzOLoad, calVertOLoad))
2314  "::getDataFromVgosDb(): reading of ocean loading calibrations file failed for the station " +
2315  stnName);
2316  if (isCalced && !vgosDb->loadStationPartAxisOffset(stnName, partAxisOffset))
2318  "::getDataFromVgosDb(): reading of axis offset partials file failed for the station " +
2319  stnName);
2320  //
2321  if (isCalced && !vgosDb->loadStationPartZenithDelayDry(stnName, partTropZenithDry, kind))
2323  "::getDataFromVgosDb(): reading of troposheric zenith delay (hydrostatic component) partials "
2324  "file failed for the station " + stnName);
2325  else if (!kind.isEmpty() && kind.toUpper() != "NMF")
2327  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of troposheric zenith delay "
2328  "(hydrostatic component) partials for the station " + stnName);
2329  //
2330  if (isCalced && !vgosDb->loadStationPartZenithDelayWet(stnName, partTropZenithWet, kind))
2332  "::getDataFromVgosDb(): reading of troposheric zenith delay (wet component) partials "
2333  "file failed for the station " + stnName);
2334  else if (!kind.isEmpty() && kind.toUpper() != "NMF")
2336  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of troposheric zenith delay "
2337  "(wet component) partials for the station " + stnName);
2338  //
2339  if (isCalced && !vgosDb->loadStationPartHorizonGrad(stnName, partTropGrad, kind))
2341  "::getDataFromVgosDb(): reading of troposheric horizontal gradients partials "
2342  "file failed for the station " + stnName);
2343  else if (!kind.isEmpty() && kind.toUpper() != "NMF")
2345  "::getDataFromVgosDb(): got an unknown, (" + kind + "), kind of troposheric horizontal "
2346  "gradients partials for the station " + stnName);
2347  //
2348  //
2349  if (calNmfDry)
2350  hasNdryContrib_= true;
2351  if (calNmfWet)
2352  hasNwetContrib_= true;
2353  if (partTropGrad)
2354  hasGradPartials_ = true;
2355  //
2356  // from logs:
2357  // cable calibration corrections:
2358  if (vgosDb->loadStationCalCable(stnName, calCable, origin, kind))
2359  {
2360  stInfo->setCableCalsOriginTxt(origin);
2362  if (kind.isEmpty())
2364  else if (kind.toUpper() == "CDMS")
2366  else if (kind.toUpper() == "PCMT")
2368  else
2369  {
2371  "::getDataFromVgosDb(): the station " + stnName +
2372  " has an unknown kind of cable calibration data");
2374  };
2375  }
2376  else
2377  {
2381  "::getDataFromVgosDb(): reading of cable calibrations file failed for the station " + stnName);
2382  };
2383  //
2384  // a set of cable cals: from FS log, CDMS and PCMT:
2385  if (vgosDb->loadStationCalCblCorrections(stnName, calCblCorrections, origin, kind))
2386  {
2388  "::getDataFromVgosDb(): read a set of cable calibration corrections for the station " +
2389  stnName);
2390  };
2391 /* it is ok:
2392  else
2393  logger->write(SgLogger::DBG, SgLogger::IO_NCDF, className() +
2394  "::getDataFromVgosDb(): reading of a set of cable calibration corrections failed for "
2395  "the station " + stnName);
2396 */
2397  //
2398  //
2399  // meteo data:
2400  if (vgosDb->loadStationMet(stnName, metAtmPres, metAtmRH, metAtmTemp, origin, kind))
2401  {
2402  stInfo->setMeteoDataOriginTxt(origin);
2404  if (kind.isEmpty())
2406  else if (kind.toUpper() == "EXTERNAL")
2408  else
2409  {
2411  "::getDataFromVgosDb(): the station " + stnName +
2412  " has an unknown kind of meteorological data");
2414  };
2415  }
2416  else
2417  {
2420  "::getDataFromVgosDb(): reading of Meteo file failed for the station " + stnName);
2421  };
2422  // tsyses:
2423  if (vgosDb->loadStationTsys(stnName, tSyses, tsysFreqs, tsysIds, tsysSbs, tsysPzs))
2424  {
2425  numOfTsysIFs = tSyses->nCol();
2426  if (numOfPts != (int)tSyses->nRow())
2427  {
2429  "::getDataFromVgosDb(): tsys data dimension mismatch for the station " + stnName);
2430  numOfTsysIFs = 0;
2431  };
2432  if (numOfTsysIFs != tsysFreqs.size())
2433  {
2435  "::getDataFromVgosDb(): tsys freqs dimension mismatch for the station " + stnName);
2436  numOfTsysIFs = 0;
2437  };
2438  if (numOfTsysIFs != tsysIds.size())
2439  {
2441  "::getDataFromVgosDb(): tsys ids dimension mismatch for the station " + stnName);
2442  numOfTsysIFs = 0;
2443  };
2444  if (numOfTsysIFs != tsysSbs.size())
2445  {
2447  "::getDataFromVgosDb(): tsys isbs dimension mismatch for the station " + stnName);
2448  numOfTsysIFs = 0;
2449  };
2450  if (numOfTsysIFs != tsysPzs.size())
2451  {
2453  "::getDataFromVgosDb(): tsys pzs dimension mismatch for the station " + stnName);
2454  numOfTsysIFs = 0;
2455  };
2456  if (numOfTsysIFs)
2457  {
2458  stInfo->tsysIfFreqs().resize(numOfTsysIFs);
2459  stInfo->tsysIfIds().resize(numOfTsysIFs);
2460  stInfo->tsysIfSideBands().resize(numOfTsysIFs);
2461  stInfo->tsysIfPolarizations().resize(numOfTsysIFs);
2462  for (int j=0; j<numOfTsysIFs; j++)
2463  {
2464  stInfo->tsysIfFreqs()[j] = tsysFreqs[j];
2465  stInfo->tsysIfIds()[j] = tsysIds[j];
2466  stInfo->tsysIfSideBands()[j] = tsysSbs[j];
2467  stInfo->tsysIfPolarizations()[j] = tsysPzs[j];
2468  }
2470  };
2471  }
2472  else
2473  {
2476  "::getDataFromVgosDb(): reading of tsys file failed for the station " + stnName);
2477  };
2478  //
2479  // clear this attributes:
2483  //
2484  QMap<QString, SgVlbiAuxObservation*>
2485  *auxObsByScan=stInfo->auxObservationByScanId();
2486  QMap<QString, SgVlbiAuxObservation*>::iterator
2487  jt=auxObsByScan->begin();
2488  for (; jt!=auxObsByScan->end(); ++jt)
2489  {
2490  SgVlbiAuxObservation *auxObs = jt.value();
2491 // if (idxByMjd.contains(*auxObs))
2492  if (idxByMjd.contains(auxObs->toString(SgMJD::F_YYYYMMDDHHMMSSSS)))
2493  {
2494 // int idx=idxByMjd.value(*auxObs);
2495  int idx=idxByMjd.value(auxObs->toString(SgMJD::F_YYYYMMDDHHMMSSSS));
2496  if (azTheo && elTheo)
2497  {
2498  auxObs->setAzimuthAngle (azTheo->getElement(idx, 0));
2499  auxObs->setAzimuthAngleRate (azTheo->getElement(idx, 1));
2500  auxObs->setElevationAngle (elTheo->getElement(idx, 0));
2501  auxObs->setElevationAngleRate (elTheo->getElement(idx, 1));
2502  };
2503  if (parAngle)
2504  auxObs->setParallacticAngle(parAngle->getElement(idx));
2505  if (refClockOffset)
2506  auxObs->setRefClockOffset(refClockOffset->getElement(idx));
2507  if (calAxisOffset)
2508  {
2509  auxObs->setCalcAxisOffset4Delay(calAxisOffset->getElement(idx, 0));
2510  auxObs->setCalcAxisOffset4Rate (calAxisOffset->getElement(idx, 1));
2511  };
2512  if (calNmfDry)
2513  {
2514  auxObs->setCalcNdryCont4Delay(calNmfDry->getElement(idx, 0));
2515  auxObs->setCalcNdryCont4Rate (calNmfDry->getElement(idx, 1));
2516  };
2517  if (calNmfWet)
2518  {
2519  auxObs->setCalcNwetCont4Delay(calNmfWet->getElement(idx, 0));
2520  auxObs->setCalcNwetCont4Rate (calNmfWet->getElement(idx, 1));
2521  };
2522  if (calHorzOLoad && calVertOLoad)
2523  {
2524  auxObs->setCalcOLoadHorz4Delay(calHorzOLoad->getElement(idx, 0));
2525  auxObs->setCalcOLoadHorz4Rate (calHorzOLoad->getElement(idx, 1));
2526  auxObs->setCalcOLoadVert4Delay(calVertOLoad->getElement(idx, 0));
2527  auxObs->setCalcOLoadVert4Rate (calVertOLoad->getElement(idx, 1));
2528  };
2529  if (partAxisOffset)
2530  {
2531  auxObs->setDdel_dAxsOfs(partAxisOffset->getElement(idx, 0));
2532  auxObs->setDrat_dAxsOfs(partAxisOffset->getElement(idx, 1));
2533  };
2534  if (partTropZenithDry)
2535  {
2536  auxObs->setDdel_dTzdDry(partTropZenithDry->getElement(idx, 0));
2537  auxObs->setDrat_dTzdDry(partTropZenithDry->getElement(idx, 1));
2538  };
2539  if (partTropZenithWet)
2540  {
2541  auxObs->setDdel_dTzdWet(partTropZenithWet->getElement(idx, 0));
2542  auxObs->setDrat_dTzdWet(partTropZenithWet->getElement(idx, 1));
2543  };
2544  if (partTropGrad)
2545  {
2546  auxObs->setDdel_dTzdGrdN (partTropGrad->getElement(idx, 0));
2547  auxObs->setDdel_dTzdGrdE (partTropGrad->getElement(idx, 1));
2548  auxObs->setDrat_dTzdGrdN (partTropGrad->getElement(idx, 2));
2549  auxObs->setDrat_dTzdGrdE (partTropGrad->getElement(idx, 3));
2550  };
2551  //
2552  if (calCable)
2553  {
2554  auxObs->setCableCalibration(calCable->getElement(idx, 0));
2556  calCable->getElement(idx, 0));
2557  hasAuxObs = true;
2558  }
2559  else
2561  if (calCblCorrections)
2562  {
2564  calCblCorrections->getElement(idx, SgVlbiAuxObservation::CCT_FSLG));
2566  calCblCorrections->getElement(idx, SgVlbiAuxObservation::CCT_CDMS));
2568  calCblCorrections->getElement(idx, SgVlbiAuxObservation::CCT_PCMT));
2569  };
2570  if (metAtmPres && metAtmRH && metAtmTemp)
2571  {
2572  auxObs->setMeteoData(SgMeteoData(metAtmTemp->getElement(idx),
2573  metAtmPres->getElement(idx), metAtmRH->getElement(idx)));
2575  hasAuxObs = true;
2576  };
2577  if (tSyses && numOfTsysIFs)
2578  {
2579  auxObs->setTsysesSize(numOfTsysIFs);
2580  for (int j=0; j<numOfTsysIFs; j++)
2581  auxObs->tSyses()->setElement(j, tSyses->getElement(idx, j));
2582  };
2583  if (ocnLdR && ocnLdV)
2584  {
2585  auxObs->setOcnLdR( Sg3dVector(ocnLdR->getElement(idx,0),
2586  ocnLdR->getElement(idx,1),
2587  ocnLdR->getElement(idx,2)));
2588  auxObs->setOcnLdV( Sg3dVector(ocnLdV->getElement(idx,0),
2589  ocnLdV->getElement(idx,1),
2590  ocnLdV->getElement(idx,2)));
2591  };
2592  //
2593  }
2594  else
2596  "::getDataFromVgosDb(): cannot find epoch " + auxObs->toString() +
2597  " in the block of station info for the station " + stnName);
2598  };
2600  // free allocated spaces:
2601  if (azTheo)
2602  delete azTheo;
2603  if (elTheo)
2604  delete elTheo;
2605  if (parAngle)
2606  delete parAngle;
2607  if (refClockOffset)
2608  delete refClockOffset;
2609  if (calAxisOffset)
2610  delete calAxisOffset;
2611  if (calCblCorrections)
2612  delete calCblCorrections;
2613  if (calNmfDry)
2614  delete calNmfDry;
2615  if (calNmfWet)
2616  delete calNmfWet;
2617  if (calHorzOLoad)
2618  delete calHorzOLoad;
2619  if (calVertOLoad)
2620  delete calVertOLoad;
2621  if (metAtmPres)
2622  delete metAtmPres;
2623  if (metAtmRH)
2624  delete metAtmRH;
2625  if (metAtmTemp)
2626  delete metAtmTemp;
2627  if (partAxisOffset)
2628  delete partAxisOffset;
2629  if (ocnLdR)
2630  delete ocnLdR;
2631  if (ocnLdV)
2632  delete ocnLdV;
2633  if (partTropZenithDry)
2634  delete partTropZenithDry;
2635  if (partTropZenithWet)
2636  delete partTropZenithWet;
2637  if (partTropGrad)
2638  delete partTropGrad;
2639  }
2640  else
2642  "::getDataFromVgosDb(): cannot load time table for the station " + stnName + ", skipped");
2643  };
2644  if (hasAuxObs)
2646  //
2647  //
2648  //
2649  //
2650  // Phase three. Collecting a priori for sourses, stations:
2651  QVector<QString> sourcesNames, sourcesApRefs, eccTypes, eccNums;
2652  QVector<QString> stationsNames4Coo, stationsNames4Ant, stationsNames4Ecc,
2653  stationsNames4AprioriClocks, tectonicPlateNames;
2654  QVector<int> axisTypes;
2655  SgVector *axisOffsets=NULL;
2656  SgMatrix *srcCoo=NULL, *axisTilts=NULL, *eccVals=NULL, *stnCoo=NULL,
2657  *offsets_n_rates=NULL;
2658 
2659 
2660  if (!vgosDb->loadSourcesApriories(sourcesNames, srcCoo, sourcesApRefs))
2661  {
2663  "::getDataFromVgosDb(): limited use data, missed info: a priori: sources");
2664 // isOk = false;
2665  };
2666  if (!vgosDb->loadStationsApriories(stationsNames4Coo, stnCoo, tectonicPlateNames))
2667  {
2669  "::getDataFromVgosDb(): limited use data, missed info: a priori: stations");
2670 // isOk = false;
2671  };
2672  if (!vgosDb->loadAntennaApriories(stationsNames4Ant, axisTypes, axisOffsets, axisTilts))
2673  {
2675  "::getDataFromVgosDb(): limited use data, missed info: a priori: antennae");
2676 // isOk = false;
2677  };
2678  vgosDb->loadEccentricities(stationsNames4Ecc, eccTypes, eccNums, eccVals);
2679  vgosDb->loadClockApriories(stationsNames4AprioriClocks, offsets_n_rates);
2680 
2681 
2682  //
2683  // sources:
2684  //
2685  if (sourcesNames.size() && srcCoo)
2686  {
2687  if (sourcesNames.size()!=sourcesByName_.size())
2689  "::getDataFromVgosDb(): the number of a priori source positions " +
2690  QString().sprintf("(%d) is not equal to the actual number of sources (%d)",
2691  sourcesNames.size(), sourcesByName_.size()));
2692  for (int i=0; i<sourcesNames.size(); i++)
2693  {
2694  sourceName = sourcesNames.at(i);
2695  if (sourcesByName_.contains(sourceName))
2696  {
2697  sourceInfo = sourcesByName_.value(sourceName);
2698  double ra=srcCoo->getElement(i, 0);
2699  double dn=srcCoo->getElement(i, 1);
2700  sourceInfo->setRA(ra);
2701  sourceInfo->setDN(dn);
2702  if (sourcesApRefs.size() == sourcesNames.size())
2703  sourceInfo->setAprioriReference(sourcesApRefs.at(i));
2704  }
2705  else // complain:
2707  "::getDataFromVgosDb(): cannot find a priori entry '" + sourceName +
2708  "' in the list of session sources");
2709  };
2710  }
2711  else
2713  "::getDataFromVgosDb(): cannot find sources a priori coordinates in the vgosDb tree");
2714  //
2715  // stations:
2716  // here we have three lists and the order of stations could be different
2717  // first, coordinates:
2718  if (stationsNames4Coo.size() && stnCoo && tectonicPlateNames.size())
2719  {
2720  if (stationsNames4Coo.size()!=stationsByName_.size())
2722  "::getDataFromVgosDb(): the number of a priori stations positions " +
2723  QString().sprintf("(%d) is not equal to the actual number of stations (%d)",
2724  stationsNames4Coo.size(), stationsByName_.size()));
2725  calcInfo_.stations().clear();
2726  for (int i=0; i<stationsNames4Coo.size(); i++)
2727  {
2728  station1Name = stationsNames4Coo.at(i);
2729  if (stationsByName_.contains(station1Name))
2730  {
2731  station1Info = stationsByName_.value(station1Name);
2732  Sg3dVector r(v3Zero);
2733  r(X_AXIS) = stnCoo->getElement(i, 0);
2734  r(Y_AXIS) = stnCoo->getElement(i, 1);
2735  r(Z_AXIS) = stnCoo->getElement(i, 2);
2736  station1Info->setR(r);
2737  station1Info->setTectonicPlateName(tectonicPlateNames.at(i));
2738  // set up the order:
2739  calcInfo_.stations().append(station1Info);
2740  }
2741  else // complain:
2743  "::getDataFromVgosDb(): cannot find station '" + station1Name + "' in the list of stations");
2744  };
2745  }
2746  else
2748  "::getDataFromVgosDb(): cannot find stations a priori coordinates in the vgosDb tree");
2749  //
2750  // then, antenna parameters:
2751  if (stationsNames4Ant.size() && axisTypes.size() && axisOffsets)
2752  {
2753  if (stationsNames4Ant.size()!=stationsByName_.size())
2755  "::getDataFromVgosDb(): the number of a priori antenna parameters " +
2756  QString().sprintf("(%d) is not equal to the actual number of stations (%d)",
2757  stationsNames4Ant.size(), stationsByName_.size()));
2758  for (int i=0; i<stationsNames4Ant.size(); i++)
2759  {
2760  station1Name = stationsNames4Ant.at(i);
2761  if (stationsByName_.contains(station1Name))
2762  {
2763  station1Info = stationsByName_.value(station1Name);
2765  Sg3dVector r(v3Zero);
2766  //
2767  // axis offset type:
2768  if (axisTypes.size())
2769  {
2770  mnt = SgVlbiStationInfo::int2mntType(axisTypes.at(i));
2771  if (mnt != SgVlbiStationInfo::MT_UNKN)
2772  {
2773  station1Info->setMntType(mnt);
2775  "::getDataFromVgosDb(): set up mounting type [" + sMntTypes[mnt] + "] for the antenna " +
2776  station1Info->getKey());
2777  };
2778  };
2779  // axis offset:
2780  if (axisOffsets)
2781  {
2782  station1Info->setAxisOffset(axisOffsets->getElement(i));
2784  "::getDataFromVgosDb(): the value of axis offset for the antenna " +
2785  station1Info->getKey() + " has been set to " +
2786  QString("").setNum(station1Info->getAxisOffset()));
2787  };
2788  }
2789  else // complain:
2791  "::getDataFromVgosDb(): cannot find station '" + station1Name + "' in the list of stations");
2792  };
2793  }
2794  else
2796  "::getDataFromVgosDb(): cannot find antenna a priori parameters in the vgosDb tree");
2797  //
2798  //
2799  // and eccentricities:
2800  if (stationsNames4Ecc.size() && eccTypes.size() && eccNums.size() && eccVals)
2801  {
2802  for (int i=0; i<stationsNames4Ecc.size(); i++)
2803  {
2804  station1Name = stationsNames4Ecc.at(i);
2805  if (stationsByName_.contains(station1Name))
2806  {
2807  station1Info = stationsByName_.value(station1Name);
2808  if (station1Info)
2809  {
2810  station1Info->eccRec() = new SgEccRec();
2811  if (eccTypes.at(i) == "XY")
2812  station1Info->eccRec()->setEccType(SgEccRec::ET_XYZ);
2813  else if (eccTypes.at(i) == "NE")
2814  station1Info->eccRec()->setEccType(SgEccRec::ET_NEU);
2815  else
2816  {
2817  station1Info->eccRec()->setEccType(SgEccRec::ET_N_A);
2819  "::getDataFromVgosDb(): cannot figure out Ecc type from the string \"" +
2820  eccTypes.at(i) + "\" for the station \"" + station1Info->getKey() + "\"");
2821  };
2822  //
2823  station1Info->eccRec()->setDR(
2824  Sg3dVector(eccVals->getElement(i, 0), eccVals->getElement(i, 1), eccVals->getElement(i, 2)));
2825  station1Info->eccRec()->setCdpNumber(eccNums.at(i));
2826  }
2827  else
2829  "::getDataFromVgosDb(): parsing ecc: the station # " + QString("").setNum(i) + " is NULL");
2830  }
2831  else
2833  "::getDataFromVgosDb(): cannot find a station \"" + station1Name + "\" in the map");
2834  };
2835  }
2836  else
2838  "::getDataFromVgosDb(): cannot find eccentricities in the vgosDb tree");
2839  //
2840  // a priori clocks:
2841  if (stationsNames4AprioriClocks.size() && offsets_n_rates)
2842  {
2843  for (int i=0; i<stationsNames4AprioriClocks.size(); i++)
2844  {
2845  station1Name = stationsNames4AprioriClocks.at(i);
2846  if (stationsByName_.contains(station1Name))
2847  {
2848  station1Info = stationsByName_.value(station1Name);
2849  station1Info->setAPrioriClockTerm_0(offsets_n_rates->getElement(i, 0));
2850  station1Info->setAPrioriClockTerm_1(offsets_n_rates->getElement(i, 1));
2851  station1Info->setNeed2useAPrioriClocks(true);
2852  }
2853  else // complain:
2855  "::getDataFromVgosDb(): cannot find station \"" + station1Name +
2856  "\" in the list of stations for a priori clocks");
2857  };
2858  };
2859 
2860 
2861  bool hasTidalUt1;
2862 //int tidalUt1(0);
2863 //hasTidalUt1 = vgosDb->loadCalcInfo(tidalUt1, calcVersionValue);
2864 //calcInfo_.setDversion(calcVersionValue);
2865  hasTidalUt1 = vgosDb->loadCalcInfo(calcInfo_);
2866  //
2867  //
2868  //
2869  eccTypes.clear();
2870  eccNums.clear();
2871  axisTypes.clear();
2872  stationsNames4AprioriClocks.clear();
2873  if (axisOffsets)
2874  delete axisOffsets;
2875  if (srcCoo)
2876  delete srcCoo;
2877  if (axisTilts)
2878  delete axisTilts;
2879  if (eccVals)
2880  delete eccVals;
2881  if (stnCoo)
2882  delete stnCoo;
2883  if (offsets_n_rates)
2884  delete offsets_n_rates;
2885  //
2886  //
2887  //
2888  //
2889  // Phase four. Solve-related parameters:
2890  // atm setup:
2891  SgVector *atmInterval=NULL, *atmRateConstraint=NULL;
2892  QVector<QString> atmStationsNames;
2893  // clock setup:
2894  SgVector *clkInterval=NULL, *clkRateConstraint=NULL;
2895  QList<QString> refClocks;
2896  QVector<QString> clockStationsNames;
2897  // EOP:
2898  SgVector *pmArrayInfo=NULL, *utArrayInfo=NULL, *utValues=NULL;
2899  SgMatrix *pmValues=NULL;
2900  QString sUtMode, sUtModule, sUtOrigin, sPmMode, sPmModule, sPmOrigin;
2901  // calibrations:
2902  int obsCalFlags(31);
2903  QVector<int> statCalFlags;
2904  QVector< QVector<int> > flybyFlags;
2905  QVector<QString> statCalNames, flybyNames, calSiteNames, obsCalNames, blwNames;
2906  // selection status:
2907  QVector<int> sourcesSelection;
2908  QVector< QVector<int> > baselinesSelection;
2909  // additional weights:
2910  SgMatrix *groupBlWeights=NULL;
2911  // calc info:
2912  int leapSecond=0;
2913  // clock breaks:
2914  QVector<QString> cbNames;
2915  QVector<SgMJD> cbEpochs;
2916  QVector<int> cbFlags;
2917  // cable signs:
2918  QMap<QString, QString> cableSignByKey;
2919  bool hasLeapSecond;
2920  //
2921  // load data:
2922  //
2923  vgosDb->loadAtmSetup(atmInterval, atmRateConstraint, atmStationsNames);
2924  vgosDb->loadClockSetup(refClocks, clkInterval, clkRateConstraint, clockStationsNames);
2925  vgosDb->loadCalcEop(pmArrayInfo, utArrayInfo, pmValues, utValues, sUtMode, sUtModule, sUtOrigin,
2926  sPmMode, sPmModule, sPmOrigin);
2927  vgosDb->loadCalibrations(obsCalFlags, statCalFlags, flybyFlags, statCalNames, flybyNames,
2928  calSiteNames, obsCalNames);
2929  vgosDb->loadSelectionStatus(sourcesSelection, baselinesSelection);
2930  vgosDb->loadSolveWeights(blwNames, groupBlWeights);
2931  vgosDb->loadClockBreaks(cbNames, cbEpochs, cbFlags);
2932  hasLeapSecond = vgosDb->loadLeapSecond(leapSecond);
2933  vgosDb->loadMiscCable(cableSignByKey);
2934 
2935 
2936  if (atmInterval && atmRateConstraint)
2938 
2939  //
2940  // update the session:
2941  //
2943  {
2944  QString siteName("");
2945  //
2946  // clocks:
2947  if (clkInterval && clkRateConstraint)
2948  {
2950  if (clkInterval->n()==1)
2951  {
2952  pCfg.setPwlStep(clkInterval->getElement(0)/24.0); // hr->day
2954  }
2955  else
2956  for (int i=0; i<clockStationsNames.size(); i++)
2957  {
2958  siteName = clockStationsNames.at(i);
2959  if (siteName.size() < 8)
2960  siteName.sprintf("%-8s", qPrintable(siteName));
2961  if (stationsByName_.contains(siteName))
2962  {
2963  SgVlbiStationInfo *si=stationsByName_.value(siteName);
2964  si->pcClocks()->setPwlStep(clkInterval->getElement(i)/24.0); // hr->day
2965  if (fabs(parametersDescriptor_->getClock0().getPwlStep() -
2966  si->pcClocks()->getPwlStep()) > 1.0e-3)
2968  }
2969  else
2971  "::getDataFromVgosDb(): cannot find siteName \"" + siteName +
2972  "\" in the map of stations");
2973  };
2974  //
2975  if (clkRateConstraint->n()==1)
2976  {
2977  pCfg.setPwlAPriori(clkRateConstraint->getElement(0)*864.0);
2979  }
2980  else
2981  for (int i=0; i<clockStationsNames.size(); i++)
2982  {
2983  siteName = clockStationsNames.at(i);
2984  if (siteName.size() < 8)
2985  siteName.sprintf("%-8s", qPrintable(siteName));
2986  if (stationsByName_.contains(siteName))
2987  {
2988  SgVlbiStationInfo *si=stationsByName_.value(siteName);
2989  si->pcClocks()->setPwlAPriori(clkRateConstraint->getElement(i)*864.0);
2991  si->pcClocks()->getPwlAPriori()) > 1.0e-3)
2993  }
2994  else
2996  "::getDataFromVgosDb(): cannot find siteName \"" + siteName +
2997  "\" in the map of stations");
2998  };
2999  }
3000  else
3002  "::getDataFromVgosDb(): no clock interval or clock rate constraint found");
3003  //
3004  // zenith:
3005  if (atmInterval && atmRateConstraint)
3006  {
3008  if (atmInterval->n()==1)
3009  {
3010  pCfg.setPwlStep(atmInterval->getElement(0)/24.0); // hr->day
3012  }
3013  else
3014  for (int i=0; i<atmStationsNames.size(); i++)
3015  {
3016  siteName = atmStationsNames.at(i);
3017  if (siteName.size() < 8)
3018  siteName.sprintf("%-8s", qPrintable(siteName));
3019  if (stationsByName_.contains(siteName))
3020  {
3021  SgVlbiStationInfo *si=stationsByName_.value(siteName);
3022  si->pcZenith()->setPwlStep(atmInterval->getElement(i)/24.0); // hr->day
3023  if (fabs(parametersDescriptor_->getZenith().getPwlStep() -
3024  si->pcZenith()->getPwlStep()) > 1.0e-3)
3026  }
3027  else
3029  "::getDataFromVgosDb(): cannot find siteName \"" + siteName +
3030  "\" in the map of stations");
3031  };
3032  //
3033  if (atmRateConstraint->n()==1)
3034  {
3035  pCfg.setPwlAPriori(atmRateConstraint->getElement(0)*1.0e-12*24.0*vLight*100.0);
3037  }
3038  else
3039  for (int i=0; i<atmStationsNames.size(); i++)
3040  {
3041  siteName = atmStationsNames.at(i);
3042  if (siteName.size() < 8)
3043  siteName.sprintf("%-8s", qPrintable(siteName));
3044  if (stationsByName_.contains(siteName))
3045  {
3046  SgVlbiStationInfo *si=stationsByName_.value(siteName);
3047  si->pcZenith()->setPwlAPriori(atmRateConstraint->getElement(i)*1.0e-12*24.0*vLight*100.0);
3049  si->pcZenith()->getPwlAPriori()) > 1.0e-3)
3051  }
3052  else
3054  "::getDataFromVgosDb(): cannot find siteName \"" + siteName +
3055  "\" in the map of stations");
3056  };
3057  }
3058  else
3060  "::getDataFromVgosDb(): no atm interval or atm rate constraint found");
3061  };
3062 
3063 
3064 /*
3065  if (atmInterval && atmRateConstraint && atmInterval->n()==atmRateConstraint->n()
3066  && atmInterval->n()==1)
3067  {
3068  if (parametersDescriptor_)
3069  {
3070  SgParameterCfg pCfg=parametersDescriptor_->getZenith();
3071  pCfg.setPwlAPriori(atmRateConstraint->getElement(0)*(1.0e-12*24.0*vLight*100.0));
3072  pCfg.setPwlStep(atmInterval->getElement(0)/24.0); // hr->day
3073  parametersDescriptor_->setZenith(pCfg);
3074  };
3075  };
3076 */
3077 /*
3078  if (parametersDescriptor_ &&
3079  clkInterval && clkRateConstraint &&
3080  clkInterval->n()==clkRateConstraint->n() &&
3081  clkInterval->n()==1)
3082  {
3083  SgParameterCfg pCfg=parametersDescriptor_->getClock0();
3084  pCfg.setPwlAPriori(clkRateConstraint->getElement(0)*864.0);
3085  pCfg.setPwlStep(clkInterval->getElement(0)/24.0); // hr->day
3086  parametersDescriptor_->setClock0(pCfg);
3087  };
3088 */
3089 
3090  //
3091  // set up a reference clock site, if available:
3092  bool hasRC(false);
3093  if (refClocks.size())
3094  {
3095  for (int i=0; i<refClocks.size(); i++)
3096  {
3097  QString clockSiteName(refClocks.at(i));
3098  if (clockSiteName.size()<8)
3099  clockSiteName.sprintf("%-8s", qPrintable(refClocks.at(i)));
3100  if (stationsByName_.contains(clockSiteName))
3101  {
3102  stationsByName_.value(clockSiteName)->addAttr(SgVlbiStationInfo::Attr_REFERENCE_CLOCKS);
3103  hasRC = true;
3105  "::getDataFromVgosDb(): Reference Clock attribute has been assigned to the station " +
3106  stationsByName_.value(clockSiteName)->getKey());
3107  };
3108  };
3109  };
3110  if (!hasRC)
3112  "::getDataFromVgosDb(): no Reference Clock attribute has been found for the session");
3113  // reference clock site finished.
3114  //
3115  // EOP, UT1:
3116  if (utArrayInfo && utValues)
3117  {
3118  double t0=utArrayInfo->getElement(0);
3119  double dt=utArrayInfo->getElement(1);
3120  unsigned int numOfPts=round(utArrayInfo->getElement(2));
3121  if (t0 > 2390000.0)
3122  t0 -= 2400000.5;
3123  if (utValues->n() < numOfPts)
3124  numOfPts = utValues->n();
3125  allocUt1InterpolEpochs(t0, dt, numOfPts);
3126  *utValues *= -1.0;
3127  allocUt1InterpolValues(utValues);
3128  hasUt1Interpolation_ = true;
3131  calcInfo_.ut1Interpolation().setOrigin(sUtOrigin);
3133  "::getDataFromVgosDb(): loaded " + QString().setNum(numOfPts) +
3134  " records for UT1 interpolation");
3135  }
3136  else
3137  {
3139  {
3140  delete args4Ut1Interpolation_;
3141  args4Ut1Interpolation_ = NULL;
3142  };
3144  {
3145  delete tabs4Ut1Interpolation_;
3146  tabs4Ut1Interpolation_ = NULL;
3147  };
3148  hasUt1Interpolation_ = false;
3149  };
3150  // EOP, PM:
3151  if (pmArrayInfo && pmValues)
3152  {
3153  double t0=pmArrayInfo->getElement(0);
3154  double dt=pmArrayInfo->getElement(1);
3155  unsigned int numOfPts=round(pmArrayInfo->getElement(2));
3156  if (t0 > 2390000.0)
3157  t0 -= 2400000.5;
3158  if (pmValues->nRow() < numOfPts)
3159  numOfPts = pmValues->nRow();
3160  allocPxyInterpolEpochs(t0, dt, numOfPts);
3161  allocPxyInterpolValues(pmValues);
3162  hasPxyInterpolation_ = true;
3164  "::getDataFromVgosDb(): loaded " + QString().setNum(numOfPts) +
3165  " records for polar motion interpolation");
3166 
3170  }
3171  else
3172  {
3174  {
3175  delete args4PxyInterpolation_;
3176  args4PxyInterpolation_ = NULL;
3177  };
3179  {
3180  delete tabs4PxyInterpolation_;
3181  tabs4PxyInterpolation_ = NULL;
3182  };
3183  hasPxyInterpolation_ = false;
3184  };
3185 
3186  if (hasTidalUt1)
3187  {
3188  QString ut1Type("");
3189  switch (calcInfo_.getFlagTidalUt1())
3190  {
3191  case 1:
3193  ut1Type = "Seriesfull of tides";
3194  break;
3195  case -1: // UT1R
3197  ut1Type = "Only short period tidal terms are removed";
3198  break;
3199  case -2: // UT1S
3201  ut1Type = "All tidal terms are removed";
3202  break;
3203  default:
3205  "::getDataFromVgosDb(): got undocumented value for the TIDALUT1 value: " +
3206  QString().setNum(calcInfo_.getFlagTidalUt1()) + "; the UT1 type has been reverted to default");
3207  break;
3208  };
3210  "::getDataFromVgosDb(): the type of the UT1 inner series has been set to " + ut1Type);
3211  };
3212  //
3213  // calibrations:
3214  if (obsCalNames.size() && config_)
3215  {
3216  QList<QString> calList;
3217  for (int i=0; i<obsCalNames.size(); i++)
3218  calList << obsCalNames.at(i);
3219  applyObsCalibrationSetup(obsCalFlags, calList);
3220  calList.clear();
3221  }
3222  else
3224  "::getDataFromVgosDb(): the observation calibration list is empty");
3225  //
3226  // flags for cable calibrations (is available):
3227  if (statCalNames.size() && calSiteNames.size() && statCalFlags.size())
3228  {
3229  bool isCableCalMatched(false);
3230  int cableCalFlagIdx(-1);
3231  for (int i=0; i<statCalNames.size(); i++)
3232  if (statCalNames.at(i) == "CABL DEL")
3233  {
3234  isCableCalMatched = true;
3235  cableCalFlagIdx = i;
3236  };
3237  if (isCableCalMatched)
3238  {
3239  QString str;
3240  // use order of stations from calSiteNames list:
3241  for (int i=0; i<calSiteNames.size(); i++)
3242  {
3243  str = calSiteNames.at(i);
3244  if (stationsByName_.contains(str))
3245  {
3246  SgVlbiStationInfo *si=stationsByName_.value(str);
3247  // just alternate cable cal flag:
3248  int nFlag=statCalFlags.at(i);
3249  if (nFlag & 1<<cableCalFlagIdx)
3251  else
3253  }
3254  else
3256  "::getDataFromVgosDb(): cannot find " + str +
3257  " (an entry from CalSiteName variable) in the list of stations");
3258  };
3259  }
3260  else
3262  "::getDataFromVgosDb(): there is no \"CABL DEL\" flag in the list of calibrations");
3263  };
3264  //
3265  //
3266  // sources selection status:
3267  if (sourcesSelection.size() && sourcesNames.size())
3268  {
3269  if (sourcesSelection.size() == sourcesNames.size())
3270  {
3271  int bitArray;
3272  SgVlbiSourceInfo *si;
3273  for (int i=0; i<sourcesNames.size(); i++)
3274  {
3275  sourceName = sourcesNames.at(i);
3276  if (sourcesByName_.contains(sourceName))
3277  {
3278  si = sourcesByName_.value(sourceName);
3279  bitArray = sourcesSelection.at(i);
3280  si->applyStatusBits(bitArray);
3281  };
3282  };
3283  }
3284  else
3286  "::getDataFromVgosDb(): sourcesSelection and sourcesNames size mismatch");
3287  };
3288  //
3289  // baselines selection status:
3290  if (baselinesSelection.size() && stationsNames4Coo.size())
3291  {
3292  if (baselinesSelection.size() == stationsNames4Coo.size())
3293  {
3294  int bitArray;
3295  SgVlbiBaselineInfo *bi, *biR;
3296  for (int i=0; i<stationsNames4Coo.size(); i++)
3297  {
3298  station1Name = stationsNames4Coo.at(i);
3299  if (stationsByName_.contains(station1Name))
3300  {
3301  for (int j=0; j<stationsNames4Coo.size(); j++)
3302  {
3303  station2Name = stationsNames4Coo.at(j);
3304  if (stationsByName_.contains(station2Name))
3305  {
3306 // ???????????
3307 // bitArray = baselinesSelection.at(j).at(i);
3308  bitArray = baselinesSelection.at(i).at(j);
3309  // image->getI2(dBaselinesSelStatus_, dSiteNames_->dim2()*j + i,0,0);
3310  if (baselinesByName_.contains(station1Name + ":" + station2Name))
3311  bi = baselinesByName_.value(station1Name + ":" + station2Name);
3312  else
3313  bi = NULL;
3314  if (baselinesByName_.contains (station2Name + ":" + station1Name))
3315  biR = baselinesByName_.value(station2Name + ":" + station1Name);
3316  else
3317  biR = NULL;
3318  // check for deselect flag:
3319  if (!(bitArray & (1<<1)))
3320  {
3322  {
3325  "::getDataFromVgosDb(): the baseline " + bi->getKey() + " has been deselected");
3326  };
3327  if (biR && !biR->isAttr(SgVlbiBaselineInfo::Attr_NOT_VALID))
3328  {
3331  "::getDataFromVgosDb(): the baseline " + biR->getKey() + " has been deselected");
3332  };
3333  };
3334  // check for baseline clocks flag:
3335  if ((bitArray & (1<<3)))
3336  {
3337  if (bi)
3338  {
3341  "::getDataFromVgosDb(): clock estimation has been assigned to the baseline " +
3342  bi->getKey());
3343  };
3344  if (biR)
3345  {
3348  "::getDataFromVgosDb(): clock estimation has been assigned to the baseline " +
3349  biR->getKey());
3350  };
3351  };
3352  };
3353  };
3354  };
3355  };
3356  }
3357  else
3359  "::getDataFromVgosDb(): baselinesSelection and stationsNames size mismatch");
3360  };
3361  //
3362  // weight corrections:
3363  if (groupBlWeights && blwNames.size() && groupBlWeights->nCol()==(unsigned)blwNames.size())
3364  {
3365  SgVlbiBaselineInfo *bi;
3366  for (int i=0; i<blwNames.size(); i++)
3367  {
3368  const QString &st=blwNames.at(i);
3369  int idx=st.indexOf(':');
3370  if (idx>0)
3371  {
3372  QString st1 = st.left(idx);
3373  QString st2 = st.mid(idx + 1);
3374  if (baselinesByName_.contains(blwNames.at(i)))
3375  {
3376  bi = baselinesByName_.value(blwNames.at(i));
3377  bi->setSigma2add(DT_DELAY, groupBlWeights->getElement(0, i));
3378  bi->setSigma2add(DT_RATE, groupBlWeights->getElement(1, i));
3379  }
3380  else if (baselinesByName_.contains(st2 + ":" + st1)) // reverted?
3381  {
3382  bi = baselinesByName_.value(st2 + ":" + st1);
3383  bi->setSigma2add(DT_DELAY, groupBlWeights->getElement(0, i));
3384  bi->setSigma2add(DT_RATE, groupBlWeights->getElement(1, i));
3386  "::getDataFromVgosDb(): the list of baseline weights contains a reverted name: [" +
3387  blwNames.at(i) + "]");
3388  }
3389  else
3390  {
3392  "::getDataFromVgosDb(): cannot find baseline [" + blwNames.at(i) +
3393  "] in the map of baselines; supposed weight corrections are " +
3394  QString("").sprintf("%.1fps and %.1fE-14s/s",
3395  groupBlWeights->getElement(0, i)*1.0e12, groupBlWeights->getElement(1, i)*1.0e14));
3396  }
3397  }
3398  else
3400  "::getDataFromVgosDb(): malformed name of a baseline: \"" + st + "\", skipped");
3401  };
3403  }
3404  else if (config_)
3405  {
3406  for (BaselinesByName_it ij=baselinesByName_.begin(); ij!=baselinesByName_.end(); ++ij)
3407  {
3408  ij.value()->setSigma2add(DT_DELAY, config_->getInitAuxSigma4Delay());
3409  ij.value()->setSigma2add(DT_RATE, config_->getInitAuxSigma4Rate());
3410  };
3411  };
3412  //
3413  // clock breaks:
3414  if (cbNames.size() && cbEpochs.size() && cbFlags.size())
3415  {
3416  int numOfClockBreaks;
3417  numOfClockBreaks = cbNames.size();
3418  if (numOfClockBreaks != cbEpochs.size())
3419  {
3421  "::getDataFromVgosDb(): the number of clock breaks sites (" +
3422  QString("").setNum(numOfClockBreaks) + ") is not equal to the number of clock break epochs " +
3423  QString("").setNum(cbEpochs.size()));
3424  numOfClockBreaks = std::min(numOfClockBreaks, cbEpochs.size());
3425  };
3426  QString stnName("");
3427  for (int i=0; i<numOfClockBreaks; i++)
3428  {
3429  const SgMJD &tBreak=cbEpochs.at(i);
3430  SgVlbiStationInfo *stn2Correct=NULL;
3431  stnName = cbNames.at(i);
3432  if (stnName.size() < 8)
3433  {
3434  stnName = cbNames.at(i).leftJustified(8, ' ');
3436  "::getDataFromVgosDb(): a name of station \"" + cbNames.at(i) +
3437  "\" from the ClockBreak file has been adjusted to \"" + stnName + "\"");
3438  };
3439  // add a clock break, set it to estimate in a common solution:
3440  if (stationsByName_.contains(stnName))
3441  {
3442  stn2Correct = stationsByName_.value(stnName);
3443  SgParameterBreak *clockBreak=new SgParameterBreak(tBreak, 0.0);
3445  if (stn2Correct->clockBreaks().addBreak(clockBreak))
3447  "::getDataFromVgosDb(): a clock break at station " + stn2Correct->getKey() +
3448  " that occurred on " + tBreak.toString() + " has been added");
3449  else
3451  "::getDataFromVgosDb(): adding new clock break at " + stn2Correct->getKey() +
3452  " station on " + tBreak.toString() + " has failed");
3453  }
3454  else
3456  "::getDataFromVgosDb(): cannot find station \"" + stnName +
3457  "\" in the map of stations, adding a clock break has failed");
3458  /*
3459  // ok, we add a clock break to each band:
3460  SgVlbiBand *band=NULL;
3461  for (int iBand=0; iBand<bands_.size(); iBand++)
3462  {
3463  band = bands_.at(iBand);
3464  if (band->stationsByName().contains(stnName))
3465  {
3466  stn2Correct = band->stationsByName().value(stnName);
3467  SgParameterBreak *clockBreak=new SgParameterBreak(tBreak, 0.0);
3468  if (stn2Correct->clockBreaks().addBreak(clockBreak))
3469  logger->write(SgLogger::INF, SgLogger::IO_NCDF, className() +
3470  "::getDataFromVgosDb(): a clock break at station " + stn2Correct->getKey() +
3471  " that occurred on " + tBreak.toString() + " has been added to the " +
3472  band->getKey() + "-band");
3473  else
3474  logger->write(SgLogger::WRN, SgLogger::IO_NCDF, className() +
3475  "::getDataFromVgosDb(): adding new clock break at " + stn2Correct->getKey() +
3476  " station on " + tBreak.toString() + " has failed");
3477  };
3478  };
3479  */
3480  };
3482  }
3483  else
3485  "::getDataFromVgosDb(): no clock breaks found");
3486  // end of clock breaks.
3487  //
3488  // check for leap seconds:
3489  if (hasLeapSecond)
3490  {
3491  setLeapSeconds(leapSecond);
3493  "::getDataFromVgosDb(): a number of leap seconds has been found; " + QString().setNum(leapSecond) +
3494  " leap seconds were assigned");
3495  };
3496  //
3497  // check for the applied cable cal signs:
3498  if (cableSignByKey.size())
3499  {
3500  for (QMap<QString, QString>::const_iterator it=cableSignByKey.begin();
3501  it!=cableSignByKey.end(); ++it)
3502  {
3503  const QString &stnNme=it.key();
3504  const QString &stnSgn=it.value();
3505  if (stationsByName_.contains(stnNme))
3506  {
3507  double d;
3508  if (stnSgn.contains("-"))
3509  d = -1.0;
3510  else if (stnSgn.contains("+"))
3511  d = 1.0;
3512  else
3513  d = 0.0;
3514  stationsByName_[stnNme]->setCableCalMultiplierDBCal(d);
3516  "::getDataFromVgosDb(): an applied cable calibration sign " + QString().sprintf("%+g", d) +
3517  " has been set for the station [" + stnNme + "] on the basis of string: \"" + stnSgn +
3518  "\"");
3519  }
3520  else
3522  "::getDataFromVgosDb(): got cable cal sign for a station that is not in the session: " +
3523  stnNme);
3524  };
3526  "::getDataFromVgosDb(): " + QString().setNum(cableSignByKey.size()) +
3527  " cable calibration signs were applied to stations");
3528  };
3529 
3530  if (cppsSoft_ == CPPS_UNKNOWN)
3531  cppsSoft_ = CPPS_HOPS;
3532 
3533  //
3534  //
3535  // clear temporary storages:
3536  if (atmInterval)
3537  delete atmInterval;
3538  if (atmRateConstraint)
3539  delete atmRateConstraint;
3540  if (clkInterval)
3541  delete clkInterval;
3542  if (clkRateConstraint)
3543  delete clkRateConstraint;
3544 
3545  if (pmArrayInfo)
3546  delete pmArrayInfo;
3547  if (utArrayInfo)
3548  delete utArrayInfo;
3549  if (utValues)
3550  delete utValues;
3551  if (pmValues)
3552  delete pmValues;
3553  if (groupBlWeights)
3554  delete groupBlWeights;
3555 
3556  sourcesNames.clear();
3557  stationsNames4Coo.clear();
3558  tectonicPlateNames.clear();
3559  stationsNames4Ant.clear();
3560  stationsNames4Ecc.clear();
3561 
3562  cbNames.clear();
3563  cbEpochs.clear();
3564  cbFlags.clear();
3565  cableSignByKey.clear();
3566 
3567  // pick up history, put it in every band:
3568  for (int iBand=0; iBand<numberOfBands(); iBand++)
3569  {
3570  SgVlbiBand *band=bands_.at(iBand);
3571  vgosDb->loadHistory(band->history());
3572  if (lastProcessed_ < vgosDb->getLastModified() )
3573  lastProcessed_ = vgosDb->getLastModified();
3574  band->setInputFileVersion(vgosDb->getCurrentVersion());
3575  band->setCorrelatorType(correlatorType);
3576  };
3577  //
3579  //
3580  //
3581  isOk = isOk && selfCheck(guiExpected);
3582  //
3583  SgMJD finisEpoch(SgMJD::currentMJD());
3585  ": getDataFromVgosDb(): the session " + getName() + " has been read from vgosDb data set" +
3586  ", elapsed time: " + QString("").sprintf("%.2f", (finisEpoch - startEpoch)*86400000.0) + " ms");
3587 
3588 
3589  //
3590  return isOk;
3591 };
3592 
3593 /*=====================================================================================================*/
3594 
3595 
3596 
3597 
3598 
3599 /*=====================================================================================================*/
3600 //
3601 // constants:
3602 //
3603 
3604 
3605 
3606 /*=====================================================================================================*/
3607 
3608 /*=====================================================================================================*/
const Sg3dVector v3Zero(0.0, 0.0, 0.0)
const double vLight
Definition: SgConstants.cpp:35
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
DIRECTION
Definition: SgMathSupport.h:81
@ Z_AXIS
Definition: SgMathSupport.h:81
@ X_AXIS
Definition: SgMathSupport.h:81
@ Y_AXIS
Definition: SgMathSupport.h:81
#define RAD2DEG
radians to degrees:
Definition: SgMathSupport.h:41
#define DEG2RAD
degrees to seconds:
Definition: SgMathSupport.h:49
QMap< QString, SgVlbiBaselineInfo * >::iterator BaselinesByName_it
const QString sMntTypes[]
void evaluateEffectiveFreqs(const SgVector &numOfAccPeriodsByChan_USB, const SgVector &numOfAccPeriodsByChan_LSB, const SgVector &refFreqByChan, const SgVector &fringeAmplitudeByChan, const SgVector &numOfSamplesByChan_USB, const SgVector &numOfSamplesByChan_LSB, double sampleRate, double refFreq, int numOfChannels, double &effFreq4GR, double &effFreq4PH, double &effFreq4RT, const QString &correlatorType, const QString &oId, bool useEqualWeights=false)
QMap< QString, SgVlbiStationInfo * >::iterator StationsByName_it
@ DT_DELAY
Definition: SgWrmsable.h:44
@ DT_RATE
Definition: SgWrmsable.h:45
bool isAttr(uint a) const
Definition: SgAttribute.h:226
void delAttr(uint a)
Definition: SgAttribute.h:210
void addAttr(uint a)
Definition: SgAttribute.h:202
bool addBreak(const SgMJD &t, double a0=0.0, double a1=0.0, double a2=0.0, bool isDynamic=false)
void setDR(const Sg3dVector &)
Definition: SgEccRec.h:299
@ ET_NEU
Definition: SgEccRec.h:51
@ ET_N_A
Definition: SgEccRec.h:50
@ ET_XYZ
Definition: SgEccRec.h:52
void setEccType(EccType)
Definition: SgEccRec.h:307
void setCdpNumber(const QString &)
Definition: SgEccRec.h:267
const SgMJD & getDateOfCreation() const
Definition: SgIoDriver.h:100
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_NCDF
Definition: SgLogger.h:66
@ IO_TXT
Definition: SgLogger.h:65
Definition: SgMJD.h:59
double getTime() const
Definition: SgMJD.h:455
@ F_YYYYMMDDHHMMSSSS
Long verbose: Fri, the 2nd of Apr, 2010; 17hr 02min 43.6400sec.
Definition: SgMJD.h:67
@ F_INTERNAL
Digits, date and time: 20100402.71.
Definition: SgMJD.h:72
QString toString(Format format=F_Verbose) const
Definition: SgMJD.cpp:1008
int getDate() const
Definition: SgMJD.h:447
int calcHour() const
Definition: SgMJD.h:493
int calcDayOfYear() const
Definition: SgMJD.cpp:238
static SgMJD currentMJD()
Definition: SgMJD.cpp:119
void setUpEpoch(int year, int month, int day, int hour, int min, double sec)
Definition: SgMJD.cpp:255
int calcMin() const
Definition: SgMJD.h:500
static void MJD_reverse(int date, double time, int &nYear, int &nMonth, int &nDay, int &nHour, int &nMin, double &dSec)
Definition: SgMJD.cpp:75
double calcSec() const
Definition: SgMJD.h:507
void clear()
Definition: SgMatrix.h:425
unsigned int nRow() const
Definition: SgMatrix.h:352
void setElement(unsigned int i, unsigned int j, double d)
Definition: SgMatrix.h:402
double getElement(unsigned int i, unsigned int j) const
Definition: SgMatrix.h:385
unsigned int nCol() const
Definition: SgMatrix.h:360
@ Attr_ARTIFICIAL_DATA
data are artificial (mean values or some model);
Definition: SgMeteoData.h:52
void setDefinition(const QString &def)
Definition: SgModelsInfo.h:73
void setOrigin(const QString &orig)
Definition: SgModelsInfo.h:74
void setControlFlag(const QString &flag)
Definition: SgModelsInfo.h:72
QList< SgVlbiStationInfo * > & stations()
Definition: SgModelsInfo.h:155
DasModel & ut1Interpolation()
Definition: SgModelsInfo.h:140
short getFlagTidalUt1() const
Definition: SgModelsInfo.h:116
DasModel & polarMotionInterpolation()
Definition: SgModelsInfo.h:138
void setKey(const QString &key)
Definition: SgObjectInfo.h:447
int getIdx() const
Definition: SgObjectInfo.h:335
void incNumTotal(DataType, int=1)
Definition: SgObjectInfo.h:519
const QString & getKey() const
Definition: SgObjectInfo.h:319
void setSigma2add(DataType dType, double d)
Definition: SgObjectInfo.h:471
virtual void setMediaIdx(int idx)
virtual void setMJD(const SgMJD &)
@ Attr_NOT_VALID
omit the observation;
Definition: SgObservation.h:78
@ Attr_DYNAMIC
parameters supposed to be estimated during the common solution;
Definition: SgBreakModel.h:60
double getPwlStep() const
double getPwlAPriori() const
void setPwlStep(double s)
void setPwlAPriori(double)
const SgParameterCfg & getZenith() const
void setClock0(const SgParameterCfg &p)
void setZenith(const SgParameterCfg &p)
const SgParameterCfg & getClock0() const
double getInitAuxSigma4Delay() const
Definition: SgTaskConfig.h:243
bool getUseSolveObsSuppresionFlags() const
Definition: SgTaskConfig.h:929
double getInitAuxSigma4Rate() const
Definition: SgTaskConfig.h:244
@ CT_ALL_TERMS_REMOVED
Definition: SgTidalUt1.h:63
@ CT_SHORT_TERMS_REMOVED
Definition: SgTidalUt1.h:62
unsigned int n() const
Definition: SgVector.h:327
void setElement(unsigned int i, double d)
Definition: SgVector.h:348
double getElement(unsigned int i) const
Definition: SgVector.h:362
bool loadObsSNR(const QString &band, SgVector *&snrs)
bool loadObsCrossRefs(QVector< int > &obs2Scan)
bool loadClockSetup(QList< QString > &refClocks, SgVector *&interval, SgVector *&rateConstraint, QVector< QString > &stationsNames)
bool loadStationCalOceanLoad(const QString &stnName, SgMatrix *&calHorzOLoad, SgMatrix *&calVertOLoad)
bool loadHistory(QList< SgVlbiHistoryRecord * > &)
bool loadStationCalSlantPathTropDry(const QString &stnName, SgMatrix *&calNmfDry, QString &kind)
bool loadObsAmbigSpacing(const QString &band, SgVector *&)
bool loadObsPartNut2KXY(SgMatrix *&dV_dCipX, SgMatrix *&dV_dCipY, QString &kind)
bool loadObsNumPhaseAmbigs(const QString &band, QVector< int > &numAmbigs)
bool loadObsCorrelatorInfo(const QString &band, QList< QString > &fourfitOutputFName, QList< QString > &fourfitErrorCodes, SgVector *&scanStartSec, SgVector *&scanStopSec)
bool loadObsSingleBandDelays(const QString &band, SgMatrix *&)
bool loadCalibrations(int &obsCalFlags, QVector< int > &statCalFlags, QVector< QVector< int > > &flybyFlags, QVector< QString > &statCalNames, QVector< QString > &flybyNames, QVector< QString > &calSiteNames, QVector< QString > &obsCalNames)
bool loadSelectionStatus(QVector< int > &sourcesSelection, QVector< QVector< int > > &baselinesSelection)
bool loadAtmSetup(SgVector *&interval, SgVector *&rateConstraint, QVector< QString > &stationsNames)
bool loadObsCalTiltRmvr(SgMatrix *&cals)
bool loadScanNutationEqx(SgMatrix *&pPsiEps, SgMatrix *&pPsiEps_rates, QString &kind)
bool loadLeapSecond(int &leapSecond)
bool loadObsEffFreqs(const QString &band, SgMatrix *&)
bool loadSolveWeights(QVector< QString > &baselineNames, SgMatrix *&groupBlWeights)
bool loadObsCalHiFyLibration(SgMatrix *&, QString &kind)
bool loadObsCalUnphase(const QString &band, SgMatrix *&unPhaseCal_1, SgMatrix *&unPhaseCal_2)
bool loadObsNumGroupAmbigs(const QString &band, QVector< int > &numAmbigs, QVector< int > &numSubAmbigs)
bool loadObsPartGamma(SgMatrix *&part)
bool loadObsRefFreqs(const QString &band, SgVector *&)
bool loadObsCalBendSunHigher(SgMatrix *&cals)
bool loadObsUserCorrections(int idx, SgMatrix *m, QString &name)
bool loadObsCalOceanOld(SgMatrix *&)
bool loadStationsApriories(QVector< QString > &stationsNames, SgMatrix *&cooXYZ, QVector< QString > &tectonicPlateNames)
bool loadObsGroupDelays(const QString &band, SgMatrix *&)
bool loadObsCalFeedCorr(SgMatrix *&)
bool loadScanNutationEqxWahr(SgMatrix *&pPsiEps, SgMatrix *&pPsiEps_rates)
@ CT_GSI
Definition: SgVgosDb.h:192
@ CT_Unknown
Definition: SgVgosDb.h:188
@ CT_CRL
Definition: SgVgosDb.h:191
int getNumOfUserCorrections() const
Definition: SgVgosDb.h:302
bool loadObsCalOceanPoleTideLoad(SgMatrix *&)
bool loadObsPartBend(SgMatrix *&partBend)
int getCurrentVersion() const
Definition: SgVgosDb.h:280
bool loadScanName(QVector< QString > &scanNames, QVector< QString > &scanFullNames)
bool loadObsPartParallax(SgMatrix *&part)
bool loadStationCalSlantPathTropWet(const QString &stnName, SgMatrix *&calNmfWet, QString &kind)
bool loadObsCalHiFyErp(SgMatrix *&, SgMatrix *&, QString &kind)
bool loadObsCalBend(SgMatrix *&cals)
bool loadStationCalAxisOffset(const QString &stnName, SgMatrix *&cal)
bool loadObsDtec(SgVector *&dTec, SgVector *&dTecStdDev)
bool loadStationOceanLdDisp(const QString &stnName, SgMatrix *&dis, SgMatrix *&vel)
bool loadStationMet(const QString &stnName, SgVector *&metAtmPres, SgVector *&metAtmRH, SgVector *&metAtmTemp, QString &origin, QString &kind)
bool loadSessionHead(QString &corrType, QString &corrName, QString &piName, QString &experimentName, int &experimentSerialNumber, QString &experimentDescription, QString &recordingMode, QList< QString > &stations, QList< QString > &sources, SgMJD &tStart, SgMJD &tFinis, int &cppsIdx)
bool hasBand(const QString &band) const
Definition: SgVgosDb.h:385
bool loadStationRefClockOffset(const QString &stnName, SgVector *&refClockOffset)
bool loadObsPartRaDec(SgMatrix *&dV_dRA, SgMatrix *&dV_dDN)
QList< QString > getListOfBands() const
Definition: SgVgosDb.h:381
bool loadObsCalWobble(SgMatrix *&, SgMatrix *&)
bool loadObsCalPoleTide(SgMatrix *&, QString &kind)
bool loadObsCorrelation(const QString &band, SgVector *&correlations)
bool loadScanTrf2crf(SgMatrix *&val, SgMatrix *&rat, SgMatrix *&acc)
bool loadClockBreaks(QVector< QString > &cbNames, QVector< SgMJD > &cbEpochs, QVector< int > &cbFlags)
bool loadEccentricities(QVector< QString > &stationsNames, QVector< QString > &eccTypes, QVector< QString > &eccNums, SgMatrix *&eccVals)
bool loadStationCalCable(const QString &stnName, SgMatrix *&cal, QString &origin, QString &kind)
bool loadStationPartZenithDelayDry(const QString &stnName, SgMatrix *&part, QString &kind)
const SgMJD & getLastModified() const
Definition: SgVgosDb.h:304
bool loadObsDataFlag(const QString &band, QVector< int > &delUFlag)
bool loadMiscFourFit(const QString &band, QVector< QString > &fourfitControlFile, QVector< QString > &fourfitCommand, QVector< int > &numLags, QVector< double > &apLength)
bool loadObsPhase(const QString &band, SgMatrix *&)
bool loadObsCalParallax(SgMatrix *&cals)
bool loadObsChannelInfo(const QString &band, QVector< QString > &channelIds, QVector< QString > &polarizations, QVector< int > &numOfChannels, QVector< int > &bitsPerSamples, QVector< QVector< int > > &errorRates_1, QVector< QVector< int > > &errorRates_2, QVector< QVector< int > > &bbcIdxs_1, QVector< QVector< int > > &bbcIdxs_2, QVector< QVector< int > > &corelIdxNumbersUsb, QVector< QVector< int > > &corelIdxNumbersLsb, SgVector *&sampleRate, SgMatrix *&residFringeAmplByChan, SgMatrix *&residFringePhseByChan, SgMatrix *&refFreqByChan, SgMatrix *&numOfSamplesByChan_USB, SgMatrix *&numOfSamplesByChan_LSB, SgMatrix *&numOfAccPeriodsByChan_USB, SgMatrix *&numOfAccPeriodsByChan_LSB, SgMatrix *&loFreqs_1, SgMatrix *&loFreqs_2)
bool loadCalcEop(SgVector *&pmArrayInfo, SgVector *&utArrayInfo, SgMatrix *&pmValues, SgVector *&utValues, QString &sUtMode, QString &sUtModule, QString &sUtOrigin, QString &sPmMode, QString &sPmModule, QString &sPmOrigin)
bool loadObsPartEOP(SgMatrix *&dV_dPx, SgMatrix *&dV_dPy, SgMatrix *&dV_dUT1)
bool loadStationParAngle(const QString &stnName, SgVector *&parAngle)
bool loadObsFractC(SgVector *&v)
bool loadStationCalCblCorrections(const QString &stnName, SgMatrix *&cal, QString &origin, QString &kind)
const QString & getSessionCode() const
Definition: SgVgosDb.h:264
bool loadStationTsys(const QString &stnName, SgMatrix *&tsyses, QVector< double > &frqs, QVector< QString > &ids, QVector< QString > &sbs, QVector< QString > &polzs)
bool loadSourcesApriories(QVector< QString > &sourcesNames, SgMatrix *&cooRaDe, QVector< QString > &sourcesApRefs)
bool loadStationPartHorizonGrad(const QString &stnName, SgMatrix *&part, QString &kind)
const QString & getSessionName() const
Definition: SgVgosDb.h:268
bool loadObsPhaseCalInfo(const QString &band, SgMatrix *&phaseCalFreqs_1, SgMatrix *&phaseCalAmps_1, SgMatrix *&phaseCalPhases_1, SgMatrix *&phaseCalOffsets_1, SgVector *&phaseCalRates_1, SgMatrix *&phaseCalFreqs_2, SgMatrix *&phaseCalAmps_2, SgMatrix *&phaseCalPhases_2, SgMatrix *&phaseCalOffsets_2, SgVector *&phaseCalRates_2)
bool loadMiscCable(QMap< QString, QString > &cableSignByKey)
bool loadObsEditData(QVector< int > &delUFlag, QVector< int > &phsUFlag, QVector< int > &ratUFlag, QVector< int > &uAcSup)
bool loadCalcInfo(int &tidalUt1, double &calcVersionValue)
const QString & getWrapperFileName() const
Definition: SgVgosDb.h:276
bool loadObsCalOcean(SgMatrix *&)
bool loadObsCalIonGroup(const QString &band, SgMatrix *&ionCals, SgMatrix *&ionSigmas, QVector< int > &ionDataFlag)
bool loadStationEpochs(const QString &stnName, QList< SgMJD > &epochs)
bool loadAntennaApriories(QVector< QString > &stationsNames, QVector< int > &axisTypes, SgVector *&axisOffsets, SgMatrix *&axisTilts)
bool loadObsCalPoleTideOldRestore(SgMatrix *&cals)
bool loadScanNutationNro(SgMatrix *&pXys, SgMatrix *&pXys_rates, QString &kind)
bool loadObsUVFperAsec(const QString &band, SgMatrix *&uvfPerAsec)
bool loadObsCalBendSun(SgMatrix *&cals)
bool loadObsRates(const QString &band, SgMatrix *&)
bool loadScanCrootFname(QVector< QString > &corrRootFnames)
bool loadEpochs4Scans(QList< SgMJD > &)
CorrelatorType getCorrelatorType() const
Definition: SgVgosDb.h:296
bool loadEpochs4Obs(QList< SgMJD > &)
bool loadObsQualityCodes(const QString &band, QVector< QString > &qualityCodes)
bool loadScanEphemeris(SgMatrix *&rSun, SgMatrix *&rMoon, SgMatrix *&rEarth, SgMatrix *&vSun, SgMatrix *&vMoon, SgMatrix *&vEarth, SgMatrix *&aEarth)
bool loadObsPartPoleTides(SgMatrix *&partX, SgMatrix *&partY, QString &kind)
bool loadObsPartXYZ(SgMatrix *&dTau_dR_1, SgMatrix *&dRat_dR_1)
bool loadStationPartZenithDelayWet(const QString &stnName, SgMatrix *&part, QString &kind)
bool loadClockApriories(QVector< QString > &stationNames, SgMatrix *&offsets_n_rates)
bool loadStationAzEl(const QString &stnName, SgMatrix *&azTheo, SgMatrix *&elTheo)
bool loadObsCalEarthTide(SgMatrix *&, QString &kind)
bool loadErpApriori(SgVector *&ut1_tai, SgMatrix *&pm)
bool loadObsTheoreticals(SgVector *&delays, SgVector *&rates)
bool loadObsObjectNames(QList< QString > &, QList< QString > &, QList< QString > &)
bool loadStationPartAxisOffset(const QString &stnName, SgMatrix *&partAxisOffset)
void setOcnLdV(const Sg3dVector &v)
void setCableCalibration(double cable)
void setMeteoData(const SgMeteoData &meteo)
void setAzimuthAngle(double angle)
void setDdel_dTzdDry(double v)
@ Attr_CABLE_CAL_BAD
clock break occured at the station
void setCalcNwetCont4Delay(double v)
void setCalcNdryCont4Delay(double v)
void setDrat_dTzdWet(double v)
void setCalcOLoadHorz4Delay(double v)
void setCalcOLoadHorz4Rate(double v)
void setDdel_dTzdGrdE(double v)
void setAzimuthAngleRate(double rate)
void setCalcOLoadVert4Rate(double v)
void setDrat_dTzdGrdE(double v)
void setParallacticAngle(double angle)
void setDdel_dTzdGrdN(double v)
void setCalcOLoadVert4Delay(double v)
void setCalcAxisOffset4Delay(double v)
void setDrat_dTzdGrdN(double v)
void setOcnLdR(const Sg3dVector &r)
void setCalcNwetCont4Rate(double v)
const SgVector & cableCorrections() const
void setElevationAngle(double angle)
void setElevationAngleRate(double rate)
void setCalcNdryCont4Rate(double v)
void setDdel_dTzdWet(double v)
void setDrat_dTzdDry(double v)
void setRefClockOffset(double d)
void setTapeId(const QString id)
void setCalcAxisOffset4Rate(double v)
void setFrequency(double f)
Definition: SgVlbiBand.h:402
void setTCreation(const SgMJD &t)
Definition: SgVlbiBand.h:410
void setCorrelatorType(const QString &name)
Definition: SgVlbiBand.h:434
QMap< QString, SgVlbiBaselineInfo * > & baselinesByName()
Definition: SgVlbiBand.h:376
QMap< QString, SgVlbiStationInfo * > & stationsByName()
Definition: SgVlbiBand.h:368
void setInputFileName(const QString &fileName)
Definition: SgVlbiBand.h:418
void setInputFileVersion(int version)
Definition: SgVlbiBand.h:426
QMap< int, SgVlbiBaselineInfo * > & baselinesByIdx()
Definition: SgVlbiBand.h:304
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
Definition: SgVlbiBand.h:384
QMap< int, SgVlbiSourceInfo * > & sourcesByIdx()
Definition: SgVlbiBand.h:312
SgVlbiHistory & history()
Definition: SgVlbiBand.h:360
QMap< int, SgVlbiStationInfo * > & stationsByIdx()
Definition: SgVlbiBand.h:296
@ Attr_HAS_IONO_SOLUTION
the band contains ionospheric corrections;
Definition: SgVlbiBand.h:61
@ Attr_MISSING_CHANNEL_INFO
the band lacks info on channel setup;
Definition: SgVlbiBand.h:63
@ Attr_ESTIMATE_CLOCKS
estimate baseline clocks;
@ Attr_NOT_VALID
omit the baseline;
void setAmbiguitySpacing(double)
void setEffFreqEqWgt(double)
short int getUnweightFlag() const
void setIonoSigma(double)
void setNumOfSubAmbigs(int n)
void setEffFreq(double)
void setNumOfAmbiguities(int)
void setIonoValue(double)
double getSigma() const
void setResidualFringeFitting(double r)
void setGeocenterValue(double)
void setUnweightFlag(short int)
QVector< int > * corelIndexNumLSB()
void setEpochOfCorrelation(const SgMJD &)
void setEpochCentral(const SgMJD &)
void setBitsPerSample(int bps)
void setTstart(const SgMJD &t)
void setCorrClocks(int i, int j, double d)
void setTotalPhase(double)
void setHopsRevisionNumber(int num)
void setPhaseCalGrDelays(int i, double d)
QVector< char > * polarization_1ByChan()
SgVector * loFreqByChan_1()
QVector< char > * chanIdByChan()
void setIncohSegmAddAmp(double d)
QVector< int > * corelIndexNumUSB()
SgMatrix * phaseCalData_2ByChan()
void setAcceptedRatio(double d)
const QString & getErrorCode() const
void setTstop(const SgMJD &t)
void setEpochOfFourfitting(const SgMJD &)
SgVlbiObservation * owner()
SgVector * numOfAccPeriodsByChan_LSB()
void setIncohChanAddAmp(double d)
void setCentrOffset(double offset)
void setEffIntegrationTime(double d)
void setFourfitOutputFName(const QString &)
QVector< char > * polarization_2ByChan()
SgVector * numOfAccPeriodsByChan_USB()
QVector< int > * bbcIdxByChan_1()
void setFourfitControlFile(const QString &cf)
SgVlbiMeasurement & phDRate()
void setGeocenterResidPhase(double d)
void setCorrelStarElev_2(double v)
void setSnr(double)
void setProbabOfFalseDetection(double d)
void setQualityFactor(int)
QString strId() const
void setNlags(int n)
void setGeocenterTotalPhase(double d)
void setDiscardRatio(double d)
SgVector * fringeAmplitudeByChan()
void setCorrCoeff(double)
SgVector * vAuxData()
void setEpochOfScan(const SgMJD &)
void setUrVr(int i, double d)
void setCorrelZdelay_1(double v)
SgVector * numOfSamplesByChan_LSB()
void setAprioriDra(int i, double d)
void setInstrDelay(int i, double d)
void setPhaseCalRates(int i, double d)
void setStopOffset(int offset)
SgVector * vDlys()
void setUvFrPerAsec(int i, double d)
void setErrorCode(const QString &)
SgMatrix * phaseCalData_1ByChan()
SgVector * numOfSamplesByChan_USB()
void setFourfitCommandOverride(const QString &co)
void setReferenceFrequency(double)
void setCorrelZdelay_2(double v)
double getReferenceFrequency() const
void allocateChannelsSetupStorages(int numOfChans)
SgVlbiMeasurement & phDelay()
void setTapeQualityCode(const QString &code)
void setCalcFeedCorrDelay(double v)
SgVector * loFreqByChan_2()
SgVlbiMeasurement & grDelay()
void setStartOffset(int offset)
SgVlbiMeasurement & sbDelay()
SgVector * fringePhaseByChan()
SgVector * refFreqByChan()
void setFourfitSearchParameters(int i, double d)
void setSampleRate(double sr)
void setCorrelStarElev_1(double v)
void setCalcFeedCorrRate(double v)
QVector< int > * bbcIdxByChan_2()
void setFourfitVersion(int idx, int ver)
void setCalcOceanTideDelay(double v)
void setCalcHiFyPxyRate(double v)
void setCalcNut2006_dPsiV(double v)
void setStation1Idx(short int idx)
void setRearth(const Sg3dVector &r)
void setScanId(const QString &sId)
void setCalcConsBendingRate(double d)
@ Attr_SBD_NOT_VALID
omit the observation if single band delay is analysed;
void setCalcHiFyPxyDelay(double v)
void setDdel_dRA(double d)
void setDrat_dPolTideY(double d)
void setCalcOceanPoleTideLdDelay(double v)
void setDrat_dR_1(const Sg3dVector &r)
void setCalcHiFyUt1Rate(double v)
void setCalcPxDelay(double v)
void setSourceIdx(short int idx)
void setCalcNut2006_dEpsV(double v)
void setCalcPoleTideDelay(double v)
void setDdel_dGamma(double d)
void setApLength(double d)
void setCalcTiltRemvrRate(double v)
SgVlbiAuxObservation * auxObs_2()
void setCalcConsBendingSunRate(double d)
bool addObservable(const QString &, const SgVlbiObservable &)
void setRsun(const Sg3dVector &r)
void setCalcEarthTideDelay(double v)
void setCalcConsensusDelay(double tau)
void setDTecStdDev(double e)
void setCalcNut2006_dPsiR(double v)
void setAuxObs_2(SgVlbiAuxObservation *aux)
void setCalcNut2006_dEpsR(double v)
void setVsun(const Sg3dVector &v)
void setCalcHiFyPxyLibrationRate(double v)
void setAuxObs_1(SgVlbiAuxObservation *aux)
void setCalcPyDelay(double v)
void setScanName(const QString &sName)
void setCalcCipSr(double v)
void setCalcPoleTideOldDelay(double v)
short int getStation1Idx() const
void setDrat_dPolTideX(double d)
void setCalcPoleTideRate(double v)
void setCalcHiFyUt1LibrationDelay(double v)
void setCalcPmY(double d)
void setDTec(double d)
void setVmoon(const Sg3dVector &v)
void setCalcConsBendingSunHigherDelay(double d)
void setCalcConsensusRate(double r)
void setCalcUt1_Tai(double d)
void setCalcNutWahr_dEpsV(double v)
void setCalcNutWahr_dPsiV(double v)
void setDrat_dParallaxRev(double d)
void setDrat_dCipY(double d)
void setCalcCipYv(double v)
short int getSourceIdx() const
void setDrat_dGamma(double d)
Sg3dMatrix & trf2crfRat()
void setCalcOceanTideOldRate(double v)
void setDrat_dRA(double d)
void setCorrRootFileName(const QString &sName)
void setD2rat_dUT12(double d)
void setCalcHiFyPxyLibrationDelay(double v)
void setCalcPmX(double d)
void setCalcOceanTideOldDelay(double v)
void setDdel_dR_1(const Sg3dVector &r)
void setDdel_dUT1(double d)
void setDrat_dBend(double d)
void setVearth(const Sg3dVector &v)
void setDdel_dPolTideX(double d)
void setCalcCipXr(double v)
void setCalcCipSv(double v)
void setCalcConsBendingSunHigherRate(double d)
void setDdel_dCipY(double d)
void setStation2Idx(short int idx)
void setCalcCipXv(double v)
void setDrat_dParallax(double d)
void setCalcNutWahr_dEpsR(double v)
QVector< double > & userCorrections()
void setDdel_dParallax(double d)
void setCalcEarthTideRate(double v)
void setDdel_dPy(double d)
void setD2del_dUT12(double d)
short int getStation2Idx() const
void setDdel_dPx(double d)
QMap< QString, SgVlbiObservable * > & observableByKey()
void setCalcTiltRemvrDelay(double v)
void setDdel_dCipX(double d)
void setRmoon(const Sg3dVector &r)
void setCalcOceanPoleTideLdRate(double v)
void setCalcConsBendingDelay(double d)
void setDdel_dBend(double d)
void setCalcOceanTideRate(double v)
Sg3dMatrix & trf2crfAcc()
SgVlbiAuxObservation * auxObs_1()
void setDrat_dCipX(double d)
void setCalcHiFyUt1LibrationRate(double v)
void setCalcHiFyUt1Delay(double v)
void setDrat_dPx(double d)
void setDdel_dParallaxRev(double d)
void setAearth(const Sg3dVector &a)
const QString & getKey()
void setCalcPyRate(double v)
void setDrat_dDN(double d)
void setBaselineIdx(short int idx)
void setCalcPxRate(double v)
void setDdel_dR_2(const Sg3dVector &r)
void setCalcNutWahr_dPsiR(double v)
void setScanFullName(const QString &sId)
void setCalcPoleTideOldRate(double v)
void setCalcConsBendingSunDelay(double d)
short int getBaselineIdx() const
void setDrat_dUT1(double d)
void setFractC(double d)
void setDrat_dR_2(const Sg3dVector &r)
void setCalcWobNutatContrib(double v)
void setDrat_dPy(double d)
void setKey(const QString &)
void setCalcCipYr(double v)
Sg3dMatrix & trf2crfVal()
void setDdel_dPolTideY(double d)
void setDdel_dDN(double d)
const QString & getName() const
void setRecordingMode(const QString &mode)
void setSessionCode(const QString &code)
void setDescription(const QString &description)
void setName(const QString &name)
void setCorrelatorType(const QString &name)
CorrelatorPostProcSoftware cppsSoft_
@ Attr_PRE_PROCESSED
the observations has been prepared for analysis;
@ Attr_HAS_CALC_DATA
the theoretical values are available;
@ Attr_HAS_DTEC
the session contains diffTec values;
@ Attr_HAS_AUX_OBS
session contains aux.observations (e.g.: meteo data, cables);
@ Attr_HAS_IONO_CORR
the theoretical values are available;
@ Attr_HAS_WEIGHTS
the theoretical values are available;
@ Attr_HAS_CLOCK_BREAKS
there is at least one clock break at one of stations;
@ CPPS_UNKNOWN
unknown (=all others);
QString networkSuffix_
a char that specifies network (e.g., A, E, U, etc.);
void setExperimentSerialNumber(int sn)
void setCorrelatorName(const QString &name)
void setPiAgencyName(const QString &name)
QString name_
name of the session (e.g., 10JUL22XE);
int numberOfBands() const
StationsByName stationsByName_
bool hasOceanPoleTideContrib_
bool hasWobbleNutContrib_
bool getDataFromVgosDb(SgVgosDb *vgosDb, bool have2LoadImmatureSession, bool guiExpected)
void allocPxyInterpolValues(const SgMatrix *vals)
void setLeapSeconds(double s)
bool hasUt1LibrationContrib_
QMap< QString, SgVlbiObservation * > observationByKey_
QList< SgVlbiBand * > bands_
QVector< bool > userCorrectionsUse_
SgTidalUt1::UT1TideContentType tabsUt1Type_
SgVector * args4PxyInterpolation_
bool selfCheck(bool guiExpected)
QMap< QString, SgVlbiBand * > bandByKey_
void applyObsCalibrationSetup(int bitFlags, const QList< QString > &calList)
bool hasOceanTideContrib_
QList< SgVlbiObservation * > observations_
void allocPxyInterpolEpochs(double t0, double dt, unsigned int numOfPts)
bool hasPoleTideOldContrib_
bool hasWobblePxContrib_
void allocUt1InterpolEpochs(double t0, double dt, unsigned int numOfPts)
bool hasWobbleHighFreqContrib_
bool hasUnPhaseCalContrib_
QMap< int, SgVlbiStationInfo * > stationsByIdx_
SgModelsInfo calcInfo_
bool hasUt1HighFreqContrib_
void allocUt1InterpolValues(const SgVector *vals)
bool hasPxyInterpolation_
QMap< QString, double > skyFreqByIfId_
bool hasWobblePyContrib_
QVector< QString > userCorrectionsName_
BaselinesByName baselinesByName_
bool hasUt1Interpolation_
SgParametersDescriptor * parametersDescriptor_
bool hasPoleTideContrib_
void setInputDriver(SgIoDriver *drv)
bool hasEarthTideContrib_
static QString className()
SgVector * args4Ut1Interpolation_
bool hasPxyLibrationContrib_
SgMatrix * tabs4Ut1Interpolation_
bool hasFeedCorrContrib_
QMap< int, SgVlbiBaselineInfo * > baselinesByIdx_
SgMJD lastProcessed_
SourcesByName sourcesByName_
SgTaskConfig * config_
bool hasTiltRemvrContrib_
bool hasOceanTideOldContrib_
SgMatrix * tabs4PxyInterpolation_
QMap< int, SgVlbiSourceInfo * > sourcesByIdx_
void applyStatusBits(short bitArray)
void setDN(double dn)
void setRA(double ra)
void setAprioriReference(const QString &ref)
void setNeed2useAPrioriClocks(bool)
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
void setR(const Sg3dVector &r)
QVector< QString > & tsysIfSideBands()
QVector< double > & tsysIfFreqs()
double getAxisOffset() const
QVector< QString > & tsysIfIds()
void setMeteoDataOriginTxt(const QString &origin)
void setMntType(MountingType m)
@ Attr_REFERENCE_CLOCKS
the clocks are the reference ones;
@ Attr_HAS_CABLE_CAL
a station has cable calibration readings;
@ Attr_IGNORE_CABLE_CAL
do not apply cable calibration;
@ Attr_METEO_MODIFIED
a station has meteo parameters;
@ Attr_USE_LOCAL_ZENITH
use its own setup for the zenith delay parameter;
@ Attr_USE_LOCAL_CLOCKS
use its own setup for the clock parameter;
@ Attr_CABLE_CAL_MODIFIED
a station has cable calibration readings;
@ Attr_HAS_METEO
a station has meteo parameters;
SgParameterCfg * pcZenith()
void setMeteoDataOrigin(MeteoDataOrigin origin)
void setAPrioriClockTerm_1(double)
void setTectonicPlateName(const QString &name)
SgParameterCfg * pcClocks()
static MountingType int2mntType(int)
void setCableCalsOriginTxt(const QString &origin)
void setAxisOffset(double v)
void setCableCalsOrigin(CableCalsOrigin origin)
SgBreakModel & clockBreaks()
void setAPrioriClockTerm_0(double)
void checkPresenceOfCableCalibratioCorrections()
QVector< QString > & tsysIfPolarizations()
void setPcClocks(const SgParameterCfg &pc)
void setPcZenith(const SgParameterCfg &pc)