General Purpose Geodetic Library
SgVgosDbLoadObs.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 
24 
25 #include <math.h>
26 
27 #include <SgLogger.h>
28 #include <SgNetCdf.h>
29 #include <SgVersion.h>
30 #include <SgVgosDb.h>
31 
32 
33 
34 
35 
36 
37 
38 
39 /*=====================================================================================================*/
40 /* */
41 /* SgVgosDb implementation (continue -- loadObs part of vgosDb data tree) */
42 /* */
43 /*=====================================================================================================*/
44 //
46 {
48  {
50  "::loadEpochs4Obs(): the vgosDb variable ObservationTimeUTC is empty");
51  return false;
52  };
54  ncdf.getData();
55  //
56  if (!checkFormat(fcfTimeUTC, ncdf, true))
57  {
59  "::loadEpochs4Obs(): format check failed");
60  return false;
61  };
62  //
63  const double *pSeconds=ncdf.lookupVar(fcSecond.name())->data2double();
64  const short *pYMDHM =ncdf.lookupVar(fcYmdhm .name())->data2short();
65  epochs.clear();
66  numOfObs_ = ncdf.lookupVar(fcSecond.name())->dimensions().at(0)->getN();
67  for (int i=0; i<numOfObs_; i++)
68  epochs.append( SgMJD(pYMDHM[5*i ], pYMDHM[5*i+1], pYMDHM[5*i+2], pYMDHM[5*i+3],
69  pYMDHM[5*i+4], pSeconds[i]));
70  if (epochs.size())
72  "::loadEpochs4Obs(): read " + QString("").setNum(epochs.size()) +
73  " observation epochs from " + ncdf.getFileName());
74  return true;
75 };
76 
77 
78 
79 //
81  QList<QString>& sources)
82 {
83  if (vBaseline_.isEmpty())
84  {
86  "::loadObsObjectNames(): the vgosDb variable Baseline is empty");
87  return false;
88  };
89  if (vSource_.isEmpty())
90  {
92  "::loadObsObjectNames(): the vgosDb variable Source is empty");
93  return false;
94  };
95  //
96  // stations:
97  //
99  ncdf.getData();
100  if (!checkFormat(fcfBaseline, ncdf))
101  {
103  "::loadObsObjectNames(): baseline format check failed");
104  return false;
105  };
106  const char *p=ncdf.lookupVar(fcBaseline.name())->data2char();
107  int strLength=fcBaseline.dims().last();
108  stations_1.clear();
109  stations_2.clear();
110  for (int i=0; i<numOfObs_; i++)
111  {
112  stations_1.append(QString::fromLatin1(p + strLength* 2*i , strLength));
113  stations_2.append(QString::fromLatin1(p + strLength*(2*i+1), strLength));
114  };
115  if (stations_1.size())
117  "::loadObsObjectNames(): read " + QString("").setNum(stations_1.size()) +
118  " station names from " + ncdf.getFileName());
119  //
120  // sources:
121  //
122  ncdf.reset();
124  ncdf.getData();
125  if (!checkFormat(fcfSource, ncdf))
126  {
128  "::loadObsObjectNames(): source format check failed");
129  return false;
130  };
131  p = ncdf.lookupVar(fcSource.name())->data2char();
132  strLength = fcSource.dims().last();
133  sources.clear();
134  for (int i=0; i<numOfObs_; i++)
135  sources.append(QString::fromLatin1(p + strLength*i, strLength));
136  if (sources.size())
138  "::loadObsObjectNames(): read " + QString("").setNum(sources.size()) +
139  " source names from " + ncdf.getFileName());
140  //
141  return true;
142 };
143 
144 
145 
146 //
147 bool SgVgosDb::loadObsCrossRefs(QVector<int>& obs2Scan)
148 {
149  if (vObsCrossRef_.isEmpty())
150  {
152  "::loadObsCrossRefs(): the vgosDb variable ObsCrossRef is empty");
153  return false;
154  };
156  ncdf.getData();
157  if (!checkFormat(fcfObsCrossRef, ncdf))
158  {
160  "::loadObsCrossRefs(): format check failed");
161  return false;
162  };
163  const int *p=ncdf.lookupVar(fcObs2Scan.name())->data2int();
164  obs2Scan.resize(numOfObs_);
165  for (int i=0; i<numOfObs_; i++)
166  obs2Scan[i] = p[i];
168  "::loadObsCrossRefs(): read " + QString("").setNum(numOfObs_) +
169  " obs2scan references from " + ncdf.getFileName());
170  return true;
171 };
172 
173 
174 
175 //
176 bool SgVgosDb::loadObsSingleBandDelays(const QString &band, SgMatrix* &singleBandDelays)
177 {
178  if (!bandDataByName_.contains(band))
179  {
181  "::loadObsSingleBandDelays(): the band \"" + band + "\" is not registered");
182  return false;
183  };
184  SgVdbVariable &var=bandDataByName_[band].vSBDelay_;
185  if (var.isEmpty())
186  {
188  "::loadObsSingleBandDelays(): the vgosDb variable SBDelay for the band [" + band + "] is empty");
189  return false;
190  };
191  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
192  ncdf.getData();
193  if (!checkFormat(fcfSBDelay, ncdf))
194  {
196  "::loadObsSingleBandDelays(): format check failed");
197  return false;
198  };
199  const double *pVal=ncdf.lookupVar(fcSBDelay.name())->data2double();
200  const double *pSig=NULL;
201  if (ncdf.lookupVar(fcSBDelaySig.name()))
202  pSig=ncdf.lookupVar(fcSBDelaySig.name())->data2double();
203  singleBandDelays = new SgMatrix(numOfObs_, 2);
204  for (int i=0; i<numOfObs_; i++)
205  {
206  singleBandDelays->setElement(i,0, pVal[i]);
207  if (pSig)
208  singleBandDelays->setElement(i,1, pSig[i]);
209  else
210  singleBandDelays->setElement(i,1, 1.0e-9);
211  };
213  "::loadObsSingleBandDelays(): data loaded successfully from " + ncdf.getFileName());
214  return true;
215 };
216 
217 
218 
219 //
220 bool SgVgosDb::loadObsGroupDelays(const QString& band, SgMatrix*& groupDelays)
221 {
222  if (!bandDataByName_.contains(band))
223  {
225  "::loadObsGroupDelays(): the band \"" + band + "\" is not registered");
226  return false;
227  };
228  SgVdbVariable &var=bandDataByName_[band].vGroupDelay_;
229  if (var.isEmpty())
230  {
232  "::loadObsGroupDelays(): the vgosDb variable GroupDelay for the band [" + band + "] is empty");
233  return false;
234  };
235  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
236  ncdf.getData();
237  if (!checkFormat(fcfGroupDelay, ncdf))
238  {
240  "::loadObsGroupDelays(): format check failed");
241  return false;
242  };
243  const double *pVal=ncdf.lookupVar(fcGroupDelay .name())->data2double();
244  const double *pSig=ncdf.lookupVar(fcGroupDelaySig.name())->data2double();
245  groupDelays = new SgMatrix(numOfObs_, 2);
246  for (int i=0; i<numOfObs_; i++)
247  {
248  groupDelays->setElement(i,0, pVal[i]);
249  groupDelays->setElement(i,1, pSig[i]);
250  };
252  "::loadObsGroupDelays(): data loaded successfully from " + ncdf.getFileName());
253  return true;
254 };
255 
256 
257 
258 //
259 bool SgVgosDb::loadObsRates(const QString& band, SgMatrix*& rates)
260 {
261  if (!bandDataByName_.contains(band))
262  {
264  "::loadObsRates(): the band \"" + band + "\" is not registered");
265  return false;
266  };
267  SgVdbVariable &var=bandDataByName_[band].vGroupRate_;
268  if (var.isEmpty())
269  {
271  "::loadObsRates(): the vgosDb variable GroupRate for the band [" + band + "] is empty");
272  return false;
273  };
274  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
275  ncdf.getData();
276  if (!checkFormat(fcfGroupRate, ncdf))
277  {
279  "::loadObsRates(): format check failed");
280  return false;
281  };
282  const double *pVal=ncdf.lookupVar(fcGroupRate .name())->data2double();
283  const double *pSig=ncdf.lookupVar(fcGroupRateSig.name())->data2double();
284  rates = new SgMatrix(numOfObs_, 2);
285  for (int i=0; i<numOfObs_; i++)
286  {
287  rates->setElement(i,0, pVal[i]);
288  rates->setElement(i,1, pSig[i]);
289  };
291  "::loadObsRates(): data loaded successfully from " + ncdf.getFileName());
292  return true;
293 };
294 
295 
296 
297 //
298 bool SgVgosDb::loadObsPhase(const QString& band, SgMatrix*& phases)
299 {
300  if (!bandDataByName_.contains(band))
301  {
303  "::loadObsPhase(): the band \"" + band + "\" is not registered");
304  return false;
305  };
306  SgVdbVariable &var=bandDataByName_[band].vPhase_;
307  if (var.isEmpty())
308  {
310  "::loadObsPhase(): the vgosDb variable Phase for the band [" + band + "] is empty");
311  return false;
312  };
313  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
314  ncdf.getData();
315  if (!checkFormat(fcfPhase, ncdf))
316  {
318  "::loadObsPhase(): format check failed");
319  return false;
320  };
321  const double *pVal=ncdf.lookupVar(fcPhase .name())->data2double();
322  const double *pSig=ncdf.lookupVar(fcPhaseSig.name())?
323  ncdf.lookupVar(fcPhaseSig.name())->data2double():NULL;
324  phases = new SgMatrix(numOfObs_, 2);
325  for (int i=0; i<numOfObs_; i++)
326  {
327  phases->setElement(i,0, pVal[i]);
328  phases->setElement(i,1, pSig?pSig[i]:0.0);
329  };
331  "::loadObsPhase(): data loaded successfully from " + ncdf.getFileName());
332  return true;
333 };
334 
335 
336 
337 //
338 bool SgVgosDb::loadObsRefFreqs(const QString& band, SgVector*& rf)
339 {
340  if (!bandDataByName_.contains(band))
341  {
343  "::loadObsRefFreqs(): the band \"" + band + "\" is not registered");
344  return false;
345  };
346  SgVdbVariable &var=bandDataByName_[band].vRefFreq_;
347  if (var.isEmpty())
348  {
350  "::loadObsRefFreqs(): the vgosDb variable RefFreq for the band [" + band + "] is empty");
351  return false;
352  };
353  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
354  ncdf.getData();
355  if (!checkFormat(fcfRefFreq, ncdf))
356  {
358  "::loadObsRefFreqs(): format check failed");
359  return false;
360  };
361  const double *p=ncdf.lookupVar(fcRefFreq.name())->data2double();
362  rf = new SgVector(numOfObs_);
363  for (int i=0; i<numOfObs_; i++)
364  rf->setElement(i, p[i]);
366  "::loadObsRefFreqs(): data loaded successfully from " + ncdf.getFileName());
367  return true;
368 };
369 
370 
371 
372 //
373 bool SgVgosDb::loadObsEffFreqs(const QString& band, SgMatrix*& freqs)
374 {
375  if (!bandDataByName_.contains(band))
376  {
378  "::loadObsEffFreqs(): the band \"" + band + "\" is not registered");
379  return false;
380  };
381  SgVdbVariable &var=bandDataByName_[band].vEffFreq_;
382  if (var.isEmpty())
383  {
385  "::loadObsEffFreqs(): the vgosDb variable EffFreq for the band [" + band + "] is empty");
386  return false;
387  };
388  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
389  ncdf.getData();
390  if (!checkFormat(fcfEffFreq, ncdf))
391  {
393  "::loadObsEffFreqs(): format check failed");
394  return false;
395  };
396  const double *pG=ncdf.lookupVar(fcFreqGroupIon.name())?
397  ncdf.lookupVar(fcFreqGroupIon.name())->data2double():NULL;
398  const double *pP=ncdf.lookupVar(fcFreqPhaseIon.name())?
399  ncdf.lookupVar(fcFreqPhaseIon.name())->data2double():NULL;
400  const double *pR=ncdf.lookupVar(fcFreqRateIon .name())?
401  ncdf.lookupVar(fcFreqRateIon .name())->data2double():NULL;
402  if (!(pG || pP || pR))
403  {
405  "::loadObsEffFreqs(): nothing to read");
406  return false;
407  };
408  freqs = new SgMatrix(numOfObs_, 3);
409  for (int i=0; i<numOfObs_; i++)
410  {
411  freqs->setElement(i,0, pG?pG[i]:0.0);
412  freqs->setElement(i,1, pP?pP[i]:0.0);
413  freqs->setElement(i,2, pR?pR[i]:0.0);
414  };
416  "::loadObsEffFreqs(): data loaded successfully from " + ncdf.getFileName());
417  return true;
418 };
419 
420 
421 
422 //
423 bool SgVgosDb::loadObsAmbigSpacing(const QString& band, SgVector*& ambigs)
424 {
425  if (!bandDataByName_.contains(band))
426  {
428  "::loadObsAmbigSpacing(): the band \"" + band + "\" is not registered");
429  return false;
430  };
431  SgVdbVariable &var=bandDataByName_[band].vAmbigSize_;
432  if (var.isEmpty())
433  {
435  "::loadObsAmbigSpacing(): the vgosDb variable AmbigSize for the band [" + band + "] is empty");
436  return false;
437  };
438  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
439  ncdf.getData();
440  if (!checkFormat(fcfAmbigSize, ncdf))
441  {
443  "::loadObsAmbigSpacing(): format check failed");
444  return false;
445  };
446  const double *p=ncdf.lookupVar(fcAmbigSize.name())->data2double();
447  ambigs = new SgVector(numOfObs_);
448  for (int i=0; i<numOfObs_; i++)
449  ambigs->setElement(i, p[i]);
451  "::loadObsAmbigSpacing(): data loaded successfully from " + ncdf.getFileName());
452  return true;
453 };
454 
455 
456 
457 //
458 bool SgVgosDb::loadObsQualityCodes(const QString& band, QVector<QString>& qualityCodes)
459 {
460  if (!bandDataByName_.contains(band))
461  {
463  "::loadObsQualityCodes(): the band \"" + band + "\" is not registered");
464  return false;
465  };
466  SgVdbVariable &var=bandDataByName_[band].vQualityCode_;
467  if (var.isEmpty())
468  {
470  "::loadObsQualityCodes(): the vgosDb variable QualityCode for the band [" + band + "] is empty");
471  return false;
472  };
473  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
474  ncdf.getData();
475  if (!checkFormat(fcfQualityCode, ncdf))
476  {
478  "::loadObsQualityCodes(): format check failed");
479  return false;
480  };
481  const char *p=ncdf.lookupVar(fcQualityCode.name())->data2char();
482  qualityCodes.resize(numOfObs_);
483  for (int i=0; i<numOfObs_; i++)
484  qualityCodes[i] = QString::fromLatin1(p + i, 1);
486  "::loadObsQualityCodes(): data loaded successfully from " + ncdf.getFileName());
487  return true;
488 };
489 
490 
491 
492 //
493 bool SgVgosDb::loadObsCorrelation(const QString &band, SgVector* &correlations)
494 {
495  if (!bandDataByName_.contains(band))
496  {
498  "::loadObsCorrelation(): the band \"" + band + "\" is not registered");
499  return false;
500  };
501  SgVdbVariable &var=bandDataByName_[band].vCorrelation_;
502  if (var.isEmpty())
503  {
505  "::loadObsCorrelation(): the vgosDb variable Correlation for the band [" + band + "] is empty");
506  return false;
507  };
508  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
509  ncdf.getData();
510  if (!checkFormat(fcfCorrelation, ncdf))
511  {
513  "::loadObsCorrelation(): format check failed");
514  return false;
515  };
516  const double *p=ncdf.lookupVar(fcCorrelation.name())->data2double();
517  correlations = new SgVector(numOfObs_);
518  for (int i=0; i<numOfObs_; i++)
519  correlations->setElement(i, p[i]);
521  "::loadObsCorrelation(): data loaded successfully from " + ncdf.getFileName());
522  return true;
523 };
524 
525 
526 
527 //
528 bool SgVgosDb::loadObsUVFperAsec(const QString &band, SgMatrix* &uvfPerAsec)
529 {
530  if (!bandDataByName_.contains(band))
531  {
533  "::loadObsUVFperAsec(): the band \"" + band + "\" is not registered");
534  return false;
535  };
536  SgVdbVariable &var=bandDataByName_[band].vUVFperAsec_;
537  if (var.isEmpty())
538  {
540  "::loadObsUVFperAsec(): the vgosDb variable UVFperAsec for the band [" + band + "] is empty");
541  return false;
542  };
543  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
544  ncdf.getData();
545  if (!checkFormat(fcfUVFperAsec, ncdf))
546  {
548  "::loadObsUVFperAsec(): format check failed");
549  return false;
550  };
551  const double *p=ncdf.lookupVar(fcUVFperAsec.name())->data2double();
552  uvfPerAsec = new SgMatrix(numOfObs_, 2);
553  for (int i=0; i<numOfObs_; i++)
554  {
555  uvfPerAsec->setElement(i,0, p[2*i ]);
556  uvfPerAsec->setElement(i,1, p[2*i + 1]);
557  };
559  "::loadObsUVFperAsec(): data loaded successfully from " + ncdf.getFileName());
560  return true;
561 };
562 
563 
564 
565 //
566 bool SgVgosDb::loadObsSNR(const QString &band, SgVector* &snrs)
567 {
568  if (!bandDataByName_.contains(band))
569  {
571  "::loadObsSNR(): the band \"" + band + "\" is not registered");
572  return false;
573  };
574  SgVdbVariable &var=bandDataByName_[band].vSNR_;
575  if (var.isEmpty())
576  {
578  "::loadObsSNR(): the vgosDb variable SNR for the band [" + band + "] is empty");
579  return false;
580  };
581  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
582  ncdf.getData();
583  if (!checkFormat(fcfSNR, ncdf))
584  {
586  "::loadObsSNR(): format check failed");
587  return false;
588  };
589  const double *p=ncdf.lookupVar(fcSNR.name())->data2double();
590  snrs = new SgVector(numOfObs_);
591  for (int i=0; i<numOfObs_; i++)
592  snrs->setElement(i, p[i]);
594  "::loadObsSNR(): data loaded successfully from " + ncdf.getFileName());
595  return true;
596 };
597 
598 
599 
600 //
601 bool SgVgosDb::loadObsDtec(SgVector* &dTec, SgVector* &dTecStdDev)
602 {
604  if (var.isEmpty())
605  {
607  "::loadObsDtec(): the vgosDb variable DiffTec is empty");
608  return false;
609  };
610  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
611  ncdf.getData();
612  if (!checkFormat(fcfDTec, ncdf))
613  {
615  "::loadObsDtec(): format check failed");
616  return false;
617  };
618  const double *d=ncdf.lookupVar(fcDtec .name())->data2double();
619  const double *e=ncdf.lookupVar(fcDtecStdErr .name())->data2double();
620  dTec = new SgVector(numOfObs_);
621  dTecStdDev = new SgVector(numOfObs_);
622  for (int i=0; i<numOfObs_; i++)
623  {
624  dTec ->setElement(i, d[i]);
625  dTecStdDev->setElement(i, e[i]);
626  };
628  "::loadObsDtec(): data loaded successfully from " + ncdf.getFileName());
629  return true;
630 };
631 
632 
633 
634 //
635 bool SgVgosDb::loadObsDelayDataFlag(const QString &band, QVector<int>& delUFlag)
636 {
637  if (!bandDataByName_.contains(band))
638  {
640  "::loadObsDelayDataFlag(): the band \"" + band + "\" is not registered");
641  return false;
642  };
643  SgVdbVariable &var=bandDataByName_[band].vDelayDataFlag_;
644  if (var.isEmpty())
645  {
647  "::loadObsDelayDataFlag(): the vgosDb variable DelayDataFlag for the band [" + band + "] is empty");
648  return false;
649  };
650  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
651  ncdf.getData();
652  if (!checkFormat(fcfDelayDataFlag, ncdf))
653  {
655  "::loadObsDelayDataFlag(): format check failed");
656  return false;
657  };
658  const short *p=ncdf.lookupVar(fcDelayDataFlag.name())->data2short();
659  delUFlag.resize(numOfObs_);
660  for (int i=0; i<numOfObs_; i++)
661  delUFlag[i] = p[i];
663  "::loadObsDelayDataFlag(): data loaded successfully from " + ncdf.getFileName());
664  return true;
665 };
666 
667 
668 
669 //
670 bool SgVgosDb::loadObsDataFlag(const QString &band, QVector<int>& delUFlag)
671 {
672  if (!bandDataByName_.contains(band))
673  {
675  "::loadObsDataFlag(): the band \"" + band + "\" is not registered");
676  return false;
677  };
678  SgVdbVariable &var=bandDataByName_[band].vDataFlag_;
679  if (var.isEmpty())
680  {
682  "::loadObsDataFlag(): the vgosDb variable DataFlag for the band [" + band + "] is empty");
683  return false;
684  };
685  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
686  ncdf.getData();
687  if (!checkFormat(fcfDataFlag, ncdf))
688  {
690  "::loadObsDataFlag(): format check failed");
691  return false;
692  };
693  const short *p=ncdf.lookupVar(fcDataFlag.name())?
694  ncdf.lookupVar(fcDataFlag.name())->data2short():NULL;
695  if (!p)
696  {
698  "::loadObsDataFlag(): nothing to read for " + band + "-band");
699  return false;
700  };
701  delUFlag.resize(numOfObs_);
702  for (int i=0; i<numOfObs_; i++)
703  delUFlag[i] = p[i];
705  "::loadObsDataFlag(): data loaded successfully from " + ncdf.getFileName());
706  return true;
707 };
708 
709 
710 
711 //
713 {
714  // delays:
716  {
718  "::loadObsTheoreticals(): the vgosDb variable DelayTheoretical is empty");
719  return false;
720  };
722  ncdf.getData();
723  if (!checkFormat(fcfDelayTheoretical, ncdf))
724  {
726  "::loadObsTheoreticals(): DelayTheoretical format check failed");
727  return false;
728  };
729  const double *p=ncdf.lookupVar(fcDelayTheoretical.name())->data2double();
730  delays = new SgVector(numOfObs_);
731  for (int i=0; i<numOfObs_; i++)
732  delays->setElement(i, p[i]);
734  "::loadObsTheoreticals(): data loaded successfully from " + ncdf.getFileName());
735  //
736  // and rates:
738  {
740  "::loadObsTheoreticals(): the vgosDb variable RateTheoretical is empty");
741  return false;
742  };
743  ncdf.reset();
745  ncdf.getData();
746  if (!checkFormat(fcfRateTheoretical, ncdf))
747  {
749  "::loadObsTheoreticals(): RateTheoretical format check failed");
750  return false;
751  };
753  rates = new SgVector(numOfObs_);
754  for (int i=0; i<numOfObs_; i++)
755  rates->setElement(i, p[i]);
757  "::loadObsTheoreticals(): data loaded successfully from " + ncdf.getFileName());
758  return true;
759 };
760 
761 
762 
763 //
764 bool SgVgosDb::loadObsChannelInfo(const QString& band, // SgVlbiSessionInfo::OriginType originType,
765  QVector<QString>& channelIds, // CHAN ID
766  QVector<QString>& polarizations, // POLARIZ
767  QVector<int>& numOfChannels, // #CHANELS
768  QVector<int>& bitsPerSamples, // BITSAMPL
769  QVector< QVector<int> >& errorRates_1, // ERRORATE @1, phasecal data
770  QVector< QVector<int> >& errorRates_2, // ERRORATE @2, phasecal data
771  QVector< QVector<int> >& bbcIdxs_1, // BBC IND @1
772  QVector< QVector<int> >& bbcIdxs_2, // BBC IND @2
773  QVector< QVector<int> >& corelIdxNumbersUsb, // INDEXNUM usb
774  QVector< QVector<int> >& corelIdxNumbersLsb, // INDEXNUM lsb
775  SgVector*&sampleRate, // SAMPLRAT
776  SgMatrix*&residFringeAmplByChan, // AMPBYFRQ Amp
777  SgMatrix*&residFringePhseByChan, // AMPBYFRQ Phs
778  SgMatrix*&refFreqByChan, // RFREQ
779  SgMatrix*&numOfSamplesByChan_USB, // #SAMPLES usb
780  SgMatrix*&numOfSamplesByChan_LSB, // #SAMPLES lsb
781  SgMatrix*&numOfAccPeriodsByChan_USB, // NO.OF AP usb
782  SgMatrix*&numOfAccPeriodsByChan_LSB, // NO.OF AP lsb
783  SgMatrix*&loFreqs_1, // LO FREQ @1
784  SgMatrix*&loFreqs_2 // LO FREQ @2
785  )
786 {
787  bool isOk=false;
788  //
789  if (!bandDataByName_.contains(band))
790  {
792  "::loadObsChannelInfo(): the band \"" + band + "\" is not registered");
793  return false;
794  };
795  SgVdbVariable &var=bandDataByName_[band].vChannelInfo_;
796  if (var.isEmpty())
797  {
799  "::loadObsChannelInfo(): the vgosDb variable ChannelInfo for the band [" + band + "] is empty");
800  return false;
801  };
802  // clear the containers:
803  channelIds.clear();
804  polarizations.clear();
805  numOfChannels.clear();
806  bitsPerSamples.clear();
807 
808  if (errorRates_1.size())
809  for (int i=0; i<errorRates_1.size(); i++)
810  errorRates_1[i].clear();
811  errorRates_1.clear();
812  if (errorRates_2.size())
813  for (int i=0; i<errorRates_2.size(); i++)
814  errorRates_2[i].clear();
815  errorRates_2.clear();
816 
817  if (bbcIdxs_1.size())
818  for (int i=0; i<bbcIdxs_1.size(); i++)
819  bbcIdxs_1[i].clear();
820  bbcIdxs_1.clear();
821  if (bbcIdxs_2.size())
822  for (int i=0; i<bbcIdxs_2.size(); i++)
823  bbcIdxs_2[i].clear();
824  bbcIdxs_2.clear();
825 
826  if (corelIdxNumbersUsb.size())
827  for (int i=0; i<corelIdxNumbersUsb.size(); i++)
828  corelIdxNumbersUsb[i].clear();
829  corelIdxNumbersUsb.clear();
830  if (corelIdxNumbersLsb.size())
831  for (int i=0; i<corelIdxNumbersLsb.size(); i++)
832  corelIdxNumbersLsb[i].clear();
833  corelIdxNumbersLsb.clear();
834 
835  sampleRate = NULL;
836  residFringeAmplByChan = NULL;
837  residFringePhseByChan = NULL;
838  refFreqByChan = NULL;
839  numOfSamplesByChan_USB = NULL;
840  numOfSamplesByChan_LSB = NULL;
841  numOfAccPeriodsByChan_USB = NULL;
842  numOfAccPeriodsByChan_LSB = NULL;
843  loFreqs_1 = NULL;
844  loFreqs_2 = NULL;
845 
846  if (correlatorType_ == CT_Mk3 ||
848  correlatorType_ == CT_CRL ||
850 // isOk = loadObsChannelInfoMk3(band, numOfChannels, sampleRate,
851 // numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, refFreqByChan,
852 // numOfSamplesByChan_USB, numOfSamplesByChan_LSB, fringeAmplitudeByChan);
853  isOk = loadObsChannelInfoMk3(band, channelIds, polarizations, numOfChannels,
854  bitsPerSamples, errorRates_1, errorRates_2, bbcIdxs_1, bbcIdxs_2, corelIdxNumbersUsb,
855  corelIdxNumbersLsb, sampleRate, residFringeAmplByChan, residFringePhseByChan,
856  refFreqByChan, numOfSamplesByChan_USB, numOfSamplesByChan_LSB,
857  numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, loFreqs_1, loFreqs_2);
858  else if (correlatorType_ == CT_S2 )
859 // isOk = loadObsChannelInfoS2(band, numOfChannels, sampleRate,
860 // numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, refFreqByChan,
861 // numOfSamplesByChan_USB, numOfSamplesByChan_LSB, fringeAmplitudeByChan);
862  isOk = loadObsChannelInfoS2(band, channelIds, polarizations, numOfChannels,
863  bitsPerSamples, errorRates_1, errorRates_2, bbcIdxs_1, bbcIdxs_2, corelIdxNumbersUsb,
864  corelIdxNumbersLsb, sampleRate, residFringeAmplByChan, residFringePhseByChan,
865  refFreqByChan, numOfSamplesByChan_USB, numOfSamplesByChan_LSB,
866  numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, loFreqs_1, loFreqs_2);
867  else if ( correlatorType_ == CT_Mk4 ||
870 // isOk = loadObsChannelInfoMk4(band, numOfChannels, sampleRate,
871 // numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, refFreqByChan,
872 // numOfSamplesByChan_USB, numOfSamplesByChan_LSB, fringeAmplitudeByChan);
873  isOk = loadObsChannelInfoMk4(band, channelIds, polarizations, numOfChannels,
874  bitsPerSamples, errorRates_1, errorRates_2, bbcIdxs_1, bbcIdxs_2, corelIdxNumbersUsb,
875  corelIdxNumbersLsb, sampleRate, residFringeAmplByChan, residFringePhseByChan,
876  refFreqByChan, numOfSamplesByChan_USB, numOfSamplesByChan_LSB,
877  numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, loFreqs_1, loFreqs_2);
878  else
879  {
880  // Unknown, try each of types:
882  "::loadObsChannelInfo(): unknown correlator type, trying Mk4 data format");
883 // isOk = loadObsChannelInfoMk4(band, numOfChannels, sampleRate,
884 // numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, refFreqByChan,
885 // numOfSamplesByChan_USB, numOfSamplesByChan_LSB, fringeAmplitudeByChan);
886  isOk = loadObsChannelInfoMk4(band, channelIds, polarizations, numOfChannels,
887  bitsPerSamples, errorRates_1, errorRates_2, bbcIdxs_1, bbcIdxs_2, corelIdxNumbersUsb,
888  corelIdxNumbersLsb, sampleRate, residFringeAmplByChan, residFringePhseByChan,
889  refFreqByChan, numOfSamplesByChan_USB, numOfSamplesByChan_LSB,
890  numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, loFreqs_1, loFreqs_2);
891  if (!isOk)
892  {
894  "::loadObsChannelInfo(): unknown correlator type, trying S2 data format");
895  isOk = loadObsChannelInfoS2(band, channelIds, polarizations, numOfChannels,
896  bitsPerSamples, errorRates_1, errorRates_2, bbcIdxs_1, bbcIdxs_2, corelIdxNumbersUsb,
897  corelIdxNumbersLsb, sampleRate, residFringeAmplByChan, residFringePhseByChan,
898  refFreqByChan, numOfSamplesByChan_USB, numOfSamplesByChan_LSB,
899  numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, loFreqs_1, loFreqs_2);
900 // isOk = loadObsChannelInfoS2(band, numOfChannels, sampleRate,
901 // numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, refFreqByChan,
902 // numOfSamplesByChan_USB, numOfSamplesByChan_LSB, fringeAmplitudeByChan);
903  };
904  if (!isOk)
905  {
907  "::loadObsChannelInfo(): unknown correlator type, trying Mk3 data format");
908 // isOk = loadObsChannelInfoMk3(band, numOfChannels, sampleRate,
909 // numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, refFreqByChan,
910 // numOfSamplesByChan_USB, numOfSamplesByChan_LSB, fringeAmplitudeByChan);
911  isOk = loadObsChannelInfoMk3(band, channelIds, polarizations, numOfChannels,
912  bitsPerSamples, errorRates_1, errorRates_2, bbcIdxs_1, bbcIdxs_2, corelIdxNumbersUsb,
913  corelIdxNumbersLsb, sampleRate, residFringeAmplByChan, residFringePhseByChan,
914  refFreqByChan, numOfSamplesByChan_USB, numOfSamplesByChan_LSB,
915  numOfAccPeriodsByChan_USB, numOfAccPeriodsByChan_LSB, loFreqs_1, loFreqs_2);
916  };
917  };
918  return isOk;
919 };
920 
921 
922 
923 //
924 //bool SgVgosDb::loadObsChannelInfoMk3(const QString& band, QVector<int>& numOfChannels,
925 // SgVector*& sampleRate, SgMatrix*& numOfAccPeriodsByChan_USB, SgMatrix*& numOfAccPeriodsByChan_LSB,
926 // SgMatrix*& refFreqByChan, SgMatrix*& numOfSamplesByChan_USB, SgMatrix*& numOfSamplesByChan_LSB,
927 // SgMatrix*& fringeAmplitudeByChan)
928 bool SgVgosDb::loadObsChannelInfoMk3(const QString& band,
929  QVector<QString>& /*channelIds*/, // CHAN ID
930  QVector<QString>& /*polarizations*/, // POLARIZ
931  QVector<int>& numOfChannels, // #CHANELS
932  QVector<int>& /*bitsPerSamples*/, // BITSAMPL
933  QVector< QVector<int> >& /*errorRates_1*/, // ERRORATE @1, phasecal data
934  QVector< QVector<int> >& /*errorRates_2*/, // ERRORATE @2, phasecal data
935  QVector< QVector<int> >& /*bbcIdxs_1*/, // BBC IND @1
936  QVector< QVector<int> >& /*bbcIdxs_2*/, // BBC IND @2
937  QVector< QVector<int> >& /*corelIdxNumbersUsb*/, // INDEXNUM usb
938  QVector< QVector<int> >& /*corelIdxNumbersLsb*/, // INDEXNUM lsb
939  SgVector*&sampleRate, // SAMPLRAT
940  SgMatrix*&residFringeAmplByChan, // AMPBYFRQ Amp
941  SgMatrix*&residFringePhseByChan, // AMPBYFRQ Phs
942  SgMatrix*&refFreqByChan, // RFREQ
943  SgMatrix*&numOfSamplesByChan_USB, // #SAMPLES usb
944  SgMatrix*&numOfSamplesByChan_LSB, // #SAMPLES lsb
945  SgMatrix*&numOfAccPeriodsByChan_USB, // NO.OF AP usb
946  SgMatrix*&numOfAccPeriodsByChan_LSB, // NO.OF AP lsb
947  SgMatrix*&/*loFreqs_1*/, // LO FREQ @1
948  SgMatrix*&/*loFreqs_2*/ // LO FREQ @2
949  )
950 {
951  if (!bandDataByName_.contains(band))
952  {
954  "::loadObsChannelInfoMk3(): the band \"" + band + "\" is not registered");
955  return false;
956  };
957  SgVdbVariable &var=bandDataByName_[band].vChannelInfo_;
958  if (var.isEmpty())
959  {
961  "::loadObsChannelInfoMk3(): the vgosDb variable ChannelInfo for the band [" + band + "] is empty");
962  return false;
963  };
964  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
965  ncdf.getData();
967  {
969  "::loadObsChannelInfoMk3(): format check failed");
970  return false;
971  };
972 
973  const short *pNumChannels=ncdf.lookupVar(fcNumChannels.name())->data2short();
974  const double *pSampleRate=ncdf.lookupVar(fcSampleRate.name())->data2double();
975  const double *pChannelFreq=ncdf.lookupVar(fcChannelFreq.name())->data2double();
976  const short *pNumAp=ncdf.lookupVar(fcNumAp.name())->data2short();
977  const double *pChanAmpPhase=ncdf.lookupVar(fcChanAmpPhase.name())->data2double();
978 
979  //
980  numOfChan_ = ncdf.lookupVar(fcNumAp.name())->dimensions().at(1)->getN();
981  //
982  numOfChannels.resize(numOfObs_);
983  numOfAccPeriodsByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
984  numOfAccPeriodsByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
985  sampleRate = new SgVector(numOfObs_);
986  refFreqByChan = new SgMatrix(numOfObs_, numOfChan_);
987  residFringeAmplByChan = new SgMatrix(numOfObs_, numOfChan_);
988  residFringePhseByChan = new SgMatrix(numOfObs_, numOfChan_);
989  numOfSamplesByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
990  numOfSamplesByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
991  for (int i=0; i<numOfObs_; i++)
992  {
993  numOfChannels[i] = pNumChannels[i];
994  sampleRate->setElement(i, pSampleRate[i]);
995  for (int j=0; j<numOfChan_; j++)
996  {
997  numOfAccPeriodsByChan_USB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j ]);
998  numOfAccPeriodsByChan_LSB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j + 1]);
999  refFreqByChan->setElement(i,j, pChannelFreq[numOfChan_*i + j]);
1000  residFringeAmplByChan->setElement(i,j, pChanAmpPhase[numOfChan_*2*i + 2*j + 0]);
1001  residFringePhseByChan->setElement(i,j, pChanAmpPhase[numOfChan_*2*i + 2*j + 1]);
1002  };
1003  };
1004  //
1006  ":loadObsChannelInfoMk3(): data loaded successfully from " + ncdf.getFileName());
1007  return true;
1008 };
1009 
1010 
1011 
1012 //
1013 //bool SgVgosDb::loadObsChannelInfoS2(const QString& band, QVector<int>& numOfChannels,
1014 // SgVector*& sampleRate, SgMatrix*& numOfAccPeriodsByChan_USB, SgMatrix*& numOfAccPeriodsByChan_LSB,
1015 // SgMatrix*& refFreqByChan, SgMatrix*& numOfSamplesByChan_USB, SgMatrix*& numOfSamplesByChan_LSB,
1016 // SgMatrix*& fringeAmplitudeByChan)
1017 bool SgVgosDb::loadObsChannelInfoS2(const QString& band,
1018  QVector<QString>& /*channelIds*/, // CHAN ID
1019  QVector<QString>& /*polarizations*/, // POLARIZ
1020  QVector<int>& numOfChannels, // #CHANELS
1021  QVector<int>& /*bitsPerSamples*/, // BITSAMPL
1022  QVector< QVector<int> >& /*errorRates_1*/, // ERRORATE @1, phasecal data
1023  QVector< QVector<int> >& /*errorRates_2*/, // ERRORATE @2, phasecal data
1024  QVector< QVector<int> >& /*bbcIdxs_1*/, // BBC IND @1
1025  QVector< QVector<int> >& /*bbcIdxs_2*/, // BBC IND @2
1026  QVector< QVector<int> >& /*corelIdxNumbersUsb*/, // INDEXNUM usb
1027  QVector< QVector<int> >& /*corelIdxNumbersLsb*/, // INDEXNUM lsb
1028  SgVector*&sampleRate, // SAMPLRAT
1029  SgMatrix*&residFringeAmplByChan, // AMPBYFRQ Amp
1030  SgMatrix*&residFringePhseByChan, // AMPBYFRQ Phs
1031  SgMatrix*&refFreqByChan, // RFREQ
1032  SgMatrix*&numOfSamplesByChan_USB, // #SAMPLES usb
1033  SgMatrix*&numOfSamplesByChan_LSB, // #SAMPLES lsb
1034  SgMatrix*&numOfAccPeriodsByChan_USB, // NO.OF AP usb
1035  SgMatrix*&numOfAccPeriodsByChan_LSB, // NO.OF AP lsb
1036  SgMatrix*&/*loFreqs_1*/, // LO FREQ @1
1037  SgMatrix*&/*loFreqs_2*/ // LO FREQ @2
1038  )
1039 {
1040  if (!bandDataByName_.contains(band))
1041  {
1043  "::loadObsChannelInfoS2(): the band \"" + band + "\" is not registered");
1044  return false;
1045  };
1046  SgVdbVariable &var=bandDataByName_[band].vChannelInfo_;
1047  if (var.isEmpty())
1048  {
1050  "::loadObsChannelInfoS2(): the vgosDb variable ChannelInfo for the band [" + band + "] is empty");
1051  return false;
1052  };
1053  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1054  ncdf.getData();
1055  if (!checkFormat(fcfChannelInfoInptS2, ncdf))
1056  {
1058  "::loadObsChannelInfoS2(): format check failed");
1059  return false;
1060  };
1061 
1062  // S2 miss some of them:
1063  const short *pNumChannels=ncdf.lookupVar(fcNumChannels.name())?
1064  ncdf.lookupVar(fcNumChannels.name())->data2short():NULL;
1065  const double *pSampleRate=ncdf.lookupVar(fcSampleRate.name())?
1066  ncdf.lookupVar(fcSampleRate.name())->data2double():NULL;
1067  const double *pChannelFreq=ncdf.lookupVar(fcChannelFreq.name())?
1068  ncdf.lookupVar(fcChannelFreq.name())->data2double():NULL;
1069  const double *pVIRTFREQ=ncdf.lookupVar(fcVIRTFREQ.name())?
1070  ncdf.lookupVar(fcVIRTFREQ.name())->data2double():NULL;
1071  const short *pNumAp=ncdf.lookupVar(fcNumAp.name())?
1072  ncdf.lookupVar(fcNumAp.name())->data2short():NULL;
1073  const short *pNumAccum=ncdf.lookupVar(fcNumAccum.name())?
1074  ncdf.lookupVar(fcNumAccum.name())->data2short():NULL;
1075  const double *pChanAmp=ncdf.lookupVar(fcVFRQAM.name())?
1076  ncdf.lookupVar(fcVFRQAM.name())->data2double():NULL;
1077  const double *pChanPhs=ncdf.lookupVar(fcVFRQPH.name())?
1078  ncdf.lookupVar(fcVFRQPH.name())->data2double():NULL;
1079 
1080  // S2 specific:
1081  if (pVIRTFREQ)
1082  numOfChan_ = ncdf.lookupVar(fcVIRTFREQ.name())->dimensions().at(1)->getN();
1083  else if (pChannelFreq)
1084  numOfChan_ = ncdf.lookupVar(fcChannelFreq.name())->dimensions().at(1)->getN();
1085 
1086  //
1087 // numOfChan_ = ncdf.lookupVar(fcNumAp.name())->dimensions().at(1)->getN();
1088  //
1089  if (pNumChannels)
1090  numOfChannels.resize(numOfObs_);
1091  if (pNumAp || pNumAccum)
1092  {
1093  numOfAccPeriodsByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
1094  numOfAccPeriodsByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
1095  };
1096  if (pSampleRate)
1097  sampleRate = new SgVector(numOfObs_);
1098  if (pChannelFreq)
1099  refFreqByChan = new SgMatrix(numOfObs_, numOfChan_);
1100  if (pChanAmp)
1101  residFringeAmplByChan = new SgMatrix(numOfObs_, numOfChan_);
1102  if (pChanPhs)
1103  residFringePhseByChan = new SgMatrix(numOfObs_, numOfChan_);
1104  if (false) //??
1105  {
1106  numOfSamplesByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
1107  numOfSamplesByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
1108  };
1109 
1110  for (int i=0; i<numOfObs_; i++)
1111  {
1112  if (pNumChannels)
1113  numOfChannels[i] = pNumChannels[i];
1114  if (pSampleRate)
1115  sampleRate->setElement(i, pSampleRate[i]);
1116  for (int j=0; j<numOfChan_; j++)
1117  {
1118  if (pNumAp)
1119  {
1120  numOfAccPeriodsByChan_USB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j ]);
1121  numOfAccPeriodsByChan_LSB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j + 1]);
1122  }
1123  else if (pNumAccum) //??
1124  {
1125  numOfAccPeriodsByChan_USB->setElement(i,j, pNumAccum[numOfChan_*i + j]);
1126  numOfAccPeriodsByChan_LSB->setElement(i,j, pNumAccum[numOfChan_*i + j]);
1127  };
1128  if (pChannelFreq)
1129  refFreqByChan->setElement(i,j, pChannelFreq[numOfChan_*i + j]);
1130  if (pChanAmp)
1131  residFringeAmplByChan->setElement(i,j, pChanAmp[numOfChan_*i + j]);
1132  if (pChanPhs)
1133  residFringePhseByChan->setElement(i,j, pChanPhs[numOfChan_*i + j]);
1134  };
1135  };
1136  //
1138  ":loadObsChannelInfoS2(): data loaded successfully from " + ncdf.getFileName());
1139  return true;
1140 };
1141 
1142 
1143 
1144 //
1145 //bool SgVgosDb::loadObsChannelInfoMk4(const QString& band, QVector<int>& numOfChannels,
1146 // SgVector*& sampleRate, SgMatrix*& numOfAccPeriodsByChan_USB, SgMatrix*& numOfAccPeriodsByChan_LSB,
1147 // SgMatrix*& refFreqByChan, SgMatrix*& numOfSamplesByChan_USB, SgMatrix*& numOfSamplesByChan_LSB,
1148 // SgMatrix*& fringeAmplitudeByChan)
1149 bool SgVgosDb::loadObsChannelInfoMk4(const QString& band,
1150  QVector<QString>& channelIds, // CHAN ID
1151  QVector<QString>& polarizations, // POLARIZ
1152  QVector<int>& numOfChannels, // #CHANELS
1153  QVector<int>& bitsPerSamples, // BITSAMPL
1154  QVector< QVector<int> >& errorRates_1, // ERRORATE @1, phasecal data
1155  QVector< QVector<int> >& errorRates_2, // ERRORATE @2, phasecal data
1156  QVector< QVector<int> >& bbcIdxs_1, // BBC IND @1
1157  QVector< QVector<int> >& bbcIdxs_2, // BBC IND @2
1158  QVector< QVector<int> >& corelIdxNumbersUsb, // INDEXNUM usb
1159  QVector< QVector<int> >& corelIdxNumbersLsb, // INDEXNUM lsb
1160  SgVector*&sampleRate, // SAMPLRAT
1161  SgMatrix*&residFringeAmplByChan, // AMPBYFRQ Amp
1162  SgMatrix*&residFringePhseByChan, // AMPBYFRQ Phs
1163  SgMatrix*&refFreqByChan, // RFREQ
1164  SgMatrix*&numOfSamplesByChan_USB, // #SAMPLES usb
1165  SgMatrix*&numOfSamplesByChan_LSB, // #SAMPLES lsb
1166  SgMatrix*&numOfAccPeriodsByChan_USB, // NO.OF AP usb
1167  SgMatrix*&numOfAccPeriodsByChan_LSB, // NO.OF AP lsb
1168  SgMatrix*&loFreqs_1, // LO FREQ @1
1169  SgMatrix*&loFreqs_2 // LO FREQ @2
1170  )
1171 {
1172  if (!bandDataByName_.contains(band))
1173  {
1175  "::loadObsChannelInfoMk4(): the band \"" + band + "\" is not registered");
1176  return false;
1177  };
1178  SgVdbVariable &var=bandDataByName_[band].vChannelInfo_;
1179  if (var.isEmpty())
1180  {
1182  "::loadObsChannelInfoMk4(): the vgosDb variable ChannelInfo for the band [" + band + "] is empty");
1183  return false;
1184  };
1185  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1186  ncdf.getData();
1187  if (!checkFormat(fcfChannelInfoInptMk4, ncdf))
1188  {
1190  "::loadObsChannelInfoMk4(): format check failed");
1191  return false;
1192  };
1193 
1194  const char *pChannelID=ncdf.lookupVar(fcChannelID.name())?
1195  ncdf.lookupVar(fcChannelID.name())->data2char():NULL;
1196  const char *pPolarization=ncdf.lookupVar(fcPolarization.name())?
1197  ncdf.lookupVar(fcPolarization.name())->data2char():NULL;
1198  const short *pNumChannels=ncdf.lookupVar(fcNumChannels.name())->data2short();
1199 
1200  const short *pBITSAMPL=ncdf.lookupVar(fcBITSAMPL.name())?
1201  ncdf.lookupVar(fcBITSAMPL.name())->data2short():NULL;
1202  const short *pERRORATE=ncdf.lookupVar(fcERRORATE.name())?
1203  ncdf.lookupVar(fcERRORATE.name())->data2short():NULL;
1204  const short *pBBCIndex=ncdf.lookupVar(fcBBCIndex.name())?
1205  ncdf.lookupVar(fcBBCIndex.name())->data2short():NULL;
1206  const short *pINDEXNUM=ncdf.lookupVar(fcINDEXNUM.name())?
1207  ncdf.lookupVar(fcINDEXNUM.name())->data2short():NULL;
1208 
1209  const double *pSampleRate=ncdf.lookupVar(fcSampleRate.name())->data2double();
1210  const double *pChannelFreq=ncdf.lookupVar(fcChannelFreq.name())->data2double();
1211  const short *pNumAp=ncdf.lookupVar(fcNumAp.name())->data2short();
1212  const double *pChanAmpPhase=ncdf.lookupVar(fcChanAmpPhase.name())->data2double();
1213  const double *pNumSamples=ncdf.lookupVar(fcNumSamples.name())?
1214  ncdf.lookupVar(fcNumSamples.name())->data2double():NULL;
1215 
1216  const double *pLOFreq=ncdf.lookupVar(fcLOFreq.name())?
1217  ncdf.lookupVar(fcLOFreq.name())->data2double():NULL;
1218  int lChannelID, lPolarization;
1219  //
1220  numOfChan_ = ncdf.lookupVar(fcNumAp.name())->dimensions().at(1)->getN();
1221  //
1222  if (pChannelID)
1223  channelIds.resize(numOfObs_);
1224  if (pPolarization)
1225  polarizations.resize(numOfObs_);
1226  numOfChannels.resize(numOfObs_);
1227  if (pBITSAMPL)
1228  bitsPerSamples.resize(numOfObs_);
1229  //
1230  if (pERRORATE)
1231  {
1232  errorRates_1.resize(numOfObs_);
1233  errorRates_2.resize(numOfObs_);
1234  };
1235  bbcIdxs_1.resize(numOfObs_);
1236  bbcIdxs_2.resize(numOfObs_);
1237  corelIdxNumbersUsb.resize(numOfObs_);
1238  corelIdxNumbersLsb.resize(numOfObs_);
1239  for (int i=0; i<numOfObs_; i++)
1240  {
1241  if (pERRORATE)
1242  {
1243  errorRates_1[i].resize(numOfChan_);
1244  errorRates_2[i].resize(numOfChan_);
1245  };
1246  bbcIdxs_1[i].resize(numOfChan_);
1247  bbcIdxs_2[i].resize(numOfChan_);
1248  corelIdxNumbersUsb[i].resize(numOfChan_);
1249  corelIdxNumbersLsb[i].resize(numOfChan_);
1250  };
1251 
1252  //
1253  numOfAccPeriodsByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
1254  numOfAccPeriodsByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
1255  sampleRate = new SgVector(numOfObs_);
1256  refFreqByChan = new SgMatrix(numOfObs_, numOfChan_);
1257  if (pNumSamples)
1258  {
1259  numOfSamplesByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
1260  numOfSamplesByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
1261  };
1262  if (pChanAmpPhase)
1263  {
1264  residFringeAmplByChan = new SgMatrix(numOfObs_, numOfChan_);
1265  residFringePhseByChan = new SgMatrix(numOfObs_, numOfChan_);
1266  };
1267  loFreqs_1 = new SgMatrix(numOfObs_, numOfChan_);
1268  loFreqs_2 = new SgMatrix(numOfObs_, numOfChan_);
1269  //
1270  //
1271  //
1272  lChannelID = pChannelID?ncdf.lookupVar(fcChannelID.name())->dimensions().at(1)->getN():0;
1273  lPolarization = pPolarization?
1274  ncdf.lookupVar(fcPolarization.name())->dimensions().at(1)->getN()*
1275  ncdf.lookupVar(fcPolarization.name())->dimensions().at(2)->getN():0;
1276 
1277  for (int i=0; i<numOfObs_; i++)
1278  {
1279  if (pChannelID)
1280  channelIds[i] = QString::fromLatin1(pChannelID + i*lChannelID, lChannelID);
1281  if (pPolarization)
1282  polarizations[i] = QString::fromLatin1(pPolarization + i*lPolarization, lPolarization);
1283 
1284  numOfChannels[i] = pNumChannels[i];
1285  if (pBITSAMPL)
1286  bitsPerSamples[i] = pBITSAMPL[i];
1287 
1288  sampleRate->setElement(i, pSampleRate[i]);
1289  for (int j=0; j<numOfChan_; j++)
1290  {
1291  numOfAccPeriodsByChan_USB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j ]);
1292  numOfAccPeriodsByChan_LSB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j + 1]);
1293  refFreqByChan->setElement(i,j, pChannelFreq[numOfChan_*i + j]);
1294  if (pNumSamples)
1295  {
1296  numOfSamplesByChan_USB->setElement(i,j, pNumSamples[2*numOfChan_*i + 2*j ]);
1297  numOfSamplesByChan_LSB->setElement(i,j, pNumSamples[2*numOfChan_*i + 2*j + 1]);
1298  };
1299  if (pChanAmpPhase)
1300  {
1301  residFringeAmplByChan->setElement(i,j, pChanAmpPhase[numOfChan_*2*i + 2*j + 0]);
1302  residFringePhseByChan->setElement(i,j, pChanAmpPhase[numOfChan_*2*i + 2*j + 1]);
1303  };
1304  if (pERRORATE)
1305  {
1306  errorRates_1[i][j] = pERRORATE[4*numOfChan_*i + 4*j ];
1307  errorRates_2[i][j] = pERRORATE[4*numOfChan_*i + 4*j + 1];
1308  };
1309  //
1310  if (pBBCIndex)
1311  {
1312  bbcIdxs_1[i][j] = pBBCIndex[2*numOfChan_*i + 2*j ];
1313  bbcIdxs_2[i][j] = pBBCIndex[2*numOfChan_*i + 2*j + 1];
1314  }
1315  else
1316  {
1317  bbcIdxs_1[i][j] = 0;
1318  bbcIdxs_2[i][j] = 0;
1319  };
1320  //
1321  if (pINDEXNUM)
1322  {
1323  corelIdxNumbersUsb[i][j] = pINDEXNUM[2*numOfChan_*i + 2*j ];
1324  corelIdxNumbersLsb[i][j] = pINDEXNUM[2*numOfChan_*i + 2*j + 1];
1325  }
1326  else
1327  {
1328  corelIdxNumbersUsb[i][j] = 0;
1329  corelIdxNumbersLsb[i][j] = 0;
1330  };
1331  //
1332  if (pLOFreq)
1333  {
1334  loFreqs_1->setElement(i,j, pLOFreq[2*numOfChan_*i + 2*j ]);
1335  loFreqs_2->setElement(i,j, pLOFreq[2*numOfChan_*i + 2*j + 1]);
1336  }
1337  else
1338  {
1339  loFreqs_1->setElement(i,j, 0.0);
1340  loFreqs_2->setElement(i,j, 0.0);
1341  };
1342  };
1343  };
1344  //
1346  "::loadObsChannelInfoMk4(): data loaded successfully from " + ncdf.getFileName());
1347  return true;
1348 };
1349 
1350 
1351 
1352 //
1353 bool SgVgosDb::loadObsPhaseCalInfo(const QString& band,
1354  SgMatrix*& phaseCalFreqs_1, SgMatrix*& phaseCalAmps_1, SgMatrix*& phaseCalPhases_1,
1355  SgMatrix*& phaseCalOffsets_1, SgVector*& phaseCalRates_1,
1356  SgMatrix*& phaseCalFreqs_2, SgMatrix*& phaseCalAmps_2, SgMatrix*& phaseCalPhases_2,
1357  SgMatrix*& phaseCalOffsets_2, SgVector*& phaseCalRates_2
1358  )
1359 {
1360  bool isOk=false;
1361  if (!bandDataByName_.contains(band))
1362  {
1364  "::loadObsPhaseCalInfo(): the band \"" + band + "\" is not registered");
1365  return false;
1366  };
1367  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1368  if (var.isEmpty())
1369  {
1371  "::loadObsPhaseCalInfo(): the vgosDb variable PhaseCalInfo for the band [" + band + "] is empty");
1372  return false;
1373  };
1374  //
1375  if (correlatorType_ == CT_Mk3 ||
1376  correlatorType_ == CT_VLBA ||
1377  correlatorType_ == CT_CRL ||
1378  correlatorType_ == CT_GSI )
1379  isOk = loadObsPhaseCalInfoMk3(band,
1380  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1381  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1382  else if (correlatorType_ == CT_S2 )
1383  isOk = loadObsPhaseCalInfoS2(band,
1384  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1385  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1386  else if ( correlatorType_ == CT_Mk4 ||
1389  isOk = loadObsPhaseCalInfoMk4(band,
1390  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1391  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1392  else
1393  {
1394  // Unknown, try each of types:
1396  "::loadObsPhaseCalInfo(): unknown correlator type, trying Mk4 data format");
1397  isOk = loadObsPhaseCalInfoMk4(band,
1398  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1399  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1400  if (!isOk)
1401  {
1403  "::loadObsPhaseCalInfo(): unknown correlator type, trying S2 data format");
1404  isOk = loadObsPhaseCalInfoS2(band,
1405  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1406  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1407  };
1408  if (!isOk)
1409  {
1411  "::loadObsPhaseCalInfo(): unknown correlator type, trying Mk3 data format");
1412  isOk = loadObsPhaseCalInfoMk3(band,
1413  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1414  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1415  };
1416  };
1417  return isOk;
1418 };
1419 
1420 
1421 
1422 //
1423 bool SgVgosDb::loadObsPhaseCalInfoMk3(const QString& band,
1424  SgMatrix*& phaseCalFreqs_1, SgMatrix*& phaseCalAmps_1, SgMatrix*& phaseCalPhases_1,
1425  SgMatrix*& phaseCalOffsets_1, SgVector*& phaseCalRates_1,
1426  SgMatrix*& phaseCalFreqs_2, SgMatrix*& phaseCalAmps_2, SgMatrix*& phaseCalPhases_2,
1427  SgMatrix*& phaseCalOffsets_2, SgVector*& phaseCalRates_2
1428  )
1429 {
1430  if (!bandDataByName_.contains(band))
1431  {
1433  "::loadObsPhaseCalInfoMk3(): the band \"" + band + "\" is not registered");
1434  return false;
1435  };
1436  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1437  if (var.isEmpty())
1438  {
1440  "::loadObsPhaseCalInfoMk3(): the vgosDb variable PhaseCalInfo for the band [" + band + "] is empty");
1441  return false;
1442  };
1443  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1444  ncdf.getData();
1445  if (!checkFormat(fcfPhaseCalInfoMk3, ncdf))
1446  {
1448  "::loadObsPhaseCalInfoMk3(): format check failed");
1449  return false;
1450  };
1451  const short *pPhCalFreqs=ncdf.lookupVar(fcPhaseCalFreq.name())->data2short();
1452  const short *pPhCalAmps =ncdf.lookupVar(fcPhaseCalAmp.name())->data2short();
1453  const short *pPhCalPhass=ncdf.lookupVar(fcPhaseCalPhase.name())->data2short();
1454  const double *pPhCalRates=ncdf.lookupVar(fcPhaseCalRate.name())->data2double();
1455  //
1456  phaseCalFreqs_1 = new SgMatrix(numOfObs_, numOfChan_);
1457  phaseCalAmps_1 = new SgMatrix(numOfObs_, numOfChan_);
1458  phaseCalPhases_1 = new SgMatrix(numOfObs_, numOfChan_);
1459  phaseCalOffsets_1 = new SgMatrix(numOfObs_, numOfChan_);
1460  phaseCalRates_1 = new SgVector(numOfObs_);
1461  phaseCalFreqs_2 = new SgMatrix(numOfObs_, numOfChan_);
1462  phaseCalAmps_2 = new SgMatrix(numOfObs_, numOfChan_);
1463  phaseCalPhases_2 = new SgMatrix(numOfObs_, numOfChan_);
1464  phaseCalOffsets_2 = new SgMatrix(numOfObs_, numOfChan_);
1465  phaseCalRates_2 = new SgVector(numOfObs_);
1466  for (int i=0; i<numOfObs_; i++)
1467  {
1468  phaseCalRates_1->setElement(i, pPhCalRates[2*i ]);
1469  phaseCalRates_2->setElement(i, pPhCalRates[2*i + 1]);
1470  for (int j=0; j<numOfChan_; j++)
1471  {
1472  phaseCalFreqs_1 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j ]);
1473  phaseCalFreqs_2 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j + 1]);
1474  phaseCalAmps_1 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j ]);
1475  phaseCalAmps_2 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j + 1]);
1476  phaseCalPhases_1->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j ]);
1477  phaseCalPhases_2->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j + 1]);
1478  };
1479  };
1480  //
1482  "::loadObsPhaseCalInfoMk3(): data loaded successfully from " + ncdf.getFileName());
1483  return true;
1484 };
1485 
1486 
1487 
1488 //
1489 bool SgVgosDb::loadObsPhaseCalInfoS2(const QString& band,
1490  SgMatrix*& phaseCalFreqs_1, SgMatrix*& phaseCalAmps_1, SgMatrix*& phaseCalPhases_1,
1491  SgMatrix*& phaseCalOffsets_1, SgVector*& phaseCalRates_1,
1492  SgMatrix*& phaseCalFreqs_2, SgMatrix*& phaseCalAmps_2, SgMatrix*& phaseCalPhases_2,
1493  SgMatrix*& phaseCalOffsets_2, SgVector*& phaseCalRates_2
1494  )
1495 {
1496  if (!bandDataByName_.contains(band))
1497  {
1499  "::loadObsPhaseCalInfoS2(): the band \"" + band + "\" is not registered");
1500  return false;
1501  };
1502  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1503  if (var.isEmpty())
1504  {
1506  "::loadObsPhaseCalInfoS2(): the vgosDb variable PhaseCalInfo for the band [" + band + "] is empty");
1507  return false;
1508  };
1509  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1510  ncdf.getData();
1511  if (!checkFormat(fcfPhaseCalInfoS2, ncdf))
1512  {
1514  "::loadObsPhaseCalInfoS2(): format check failed");
1515  return false;
1516  };
1517  const double *pPhCalFreqs=ncdf.lookupVar(fcPhaseCalFreqS2.name())?
1518  ncdf.lookupVar(fcPhaseCalFreqS2.name())->data2double():NULL;
1519  const double *pPhCalAmps =ncdf.lookupVar(fcPhaseCalAmpS2.name())->data2double();
1520  const double *pPhCalPhass=ncdf.lookupVar(fcPhaseCalPhaseS2.name())->data2double();
1521  const double *pPhCalRates=ncdf.lookupVar(fcPhaseCalRate.name())->data2double();
1522  //
1523  if (pPhCalFreqs)
1524  {
1525  phaseCalFreqs_1 = new SgMatrix(numOfObs_, numOfChan_);
1526  phaseCalFreqs_2 = new SgMatrix(numOfObs_, numOfChan_);
1527  };
1528  phaseCalAmps_1 = new SgMatrix(numOfObs_, numOfChan_);
1529  phaseCalAmps_2 = new SgMatrix(numOfObs_, numOfChan_);
1530  phaseCalPhases_1 = new SgMatrix(numOfObs_, numOfChan_);
1531  phaseCalPhases_2 = new SgMatrix(numOfObs_, numOfChan_);
1532  phaseCalOffsets_1 = new SgMatrix(numOfObs_, numOfChan_);
1533  phaseCalOffsets_2 = new SgMatrix(numOfObs_, numOfChan_);
1534  phaseCalRates_1 = new SgVector(numOfObs_);
1535  phaseCalRates_2 = new SgVector(numOfObs_);
1536  for (int i=0; i<numOfObs_; i++)
1537  {
1538  phaseCalRates_1->setElement(i, pPhCalRates[2*i ]);
1539  phaseCalRates_2->setElement(i, pPhCalRates[2*i + 1]);
1540  for (int j=0; j<numOfChan_; j++)
1541  {
1542  if (pPhCalFreqs)
1543  {
1544  phaseCalFreqs_1 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j ]);
1545  phaseCalFreqs_2 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j + 1]);
1546  };
1547  phaseCalAmps_1 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j ]);
1548  phaseCalAmps_2 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j + 1]);
1549  phaseCalPhases_1->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j ]);
1550  phaseCalPhases_2->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j + 1]);
1551  };
1552  };
1553  //
1555  "::loadObsPhaseCalInfoS2(): data loaded successfully from " + ncdf.getFileName());
1556  return true;
1557 };
1558 
1559 
1560 
1561 //
1562 bool SgVgosDb::loadObsPhaseCalInfoMk4(const QString& band,
1563  SgMatrix*& phaseCalFreqs_1, SgMatrix*& phaseCalAmps_1, SgMatrix*& phaseCalPhases_1,
1564  SgMatrix*& phaseCalOffsets_1, SgVector*& phaseCalRates_1,
1565  SgMatrix*& phaseCalFreqs_2, SgMatrix*& phaseCalAmps_2, SgMatrix*& phaseCalPhases_2,
1566  SgMatrix*& phaseCalOffsets_2, SgVector*& phaseCalRates_2
1567  )
1568 {
1569  if (!bandDataByName_.contains(band))
1570  {
1572  "::loadObsPhaseCalInfoMk4(): the band \"" + band + "\" is not registered");
1573  return false;
1574  };
1575  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1576  if (var.isEmpty())
1577  {
1579  "::loadObsPhaseCalInfoMk4(): the vgosDb variable PhaseCalInfo for the band [" + band + "] is empty");
1580  return false;
1581  };
1582  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1583  ncdf.getData();
1584  if (!checkFormat(fcfPhaseCalInfoMk4, ncdf))
1585  {
1587  "::loadObsPhaseCalInfoMk4(): format check failed");
1588  return false;
1589  };
1590  const short *pPhCalFreqs=ncdf.lookupVar(fcPhaseCalFreq.name())?
1591  ncdf.lookupVar(fcPhaseCalFreq.name())->data2short():NULL;
1592  const short *pPhCalAmps =ncdf.lookupVar(fcPhaseCalAmp.name())->data2short();
1593  const short *pPhCalPhass=ncdf.lookupVar(fcPhaseCalPhase.name())->data2short();
1594  const short *pPhCalOffss=ncdf.lookupVar(fcPhaseCalOffset.name())?
1595  ncdf.lookupVar(fcPhaseCalOffset.name())->data2short():NULL;
1596  const double *pPhCalRates=ncdf.lookupVar(fcPhaseCalRate.name())->data2double();
1597  //
1598  if (pPhCalFreqs)
1599  {
1600  phaseCalFreqs_1 = new SgMatrix(numOfObs_, numOfChan_);
1601  phaseCalFreqs_2 = new SgMatrix(numOfObs_, numOfChan_);
1602  };
1603  phaseCalAmps_1 = new SgMatrix(numOfObs_, numOfChan_);
1604  phaseCalAmps_2 = new SgMatrix(numOfObs_, numOfChan_);
1605  phaseCalPhases_1 = new SgMatrix(numOfObs_, numOfChan_);
1606  phaseCalPhases_2 = new SgMatrix(numOfObs_, numOfChan_);
1607  if (pPhCalOffss)
1608  {
1609  phaseCalOffsets_1 = new SgMatrix(numOfObs_, numOfChan_);
1610  phaseCalOffsets_2 = new SgMatrix(numOfObs_, numOfChan_);
1611  };
1612  phaseCalRates_1 = new SgVector(numOfObs_);
1613  phaseCalRates_2 = new SgVector(numOfObs_);
1614  for (int i=0; i<numOfObs_; i++)
1615  {
1616  phaseCalRates_1->setElement(i, pPhCalRates[2*i ]);
1617  phaseCalRates_2->setElement(i, pPhCalRates[2*i + 1]);
1618  for (int j=0; j<numOfChan_; j++)
1619  {
1620  if (pPhCalFreqs)
1621  {
1622  phaseCalFreqs_1 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j ]);
1623  phaseCalFreqs_2 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j + 1]);
1624  };
1625  phaseCalAmps_1 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j ]);
1626  phaseCalAmps_2 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j + 1]);
1627  phaseCalPhases_1->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j ]);
1628  phaseCalPhases_2->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j + 1]);
1629  if (pPhCalOffss)
1630  {
1631  phaseCalOffsets_1->setElement(i,j, pPhCalOffss[2*numOfChan_*i + 2*j ]);
1632  phaseCalOffsets_2->setElement(i,j, pPhCalOffss[2*numOfChan_*i + 2*j + 1]);
1633  };
1634  };
1635  };
1636  //
1638  "::loadObsPhaseCalInfoMk4(): data loaded successfully from " + ncdf.getFileName());
1639  return true;
1640 };
1641 
1642 
1643 
1644 //
1645 bool SgVgosDb::loadObsCorrelatorInfo(const QString& band,
1646  QList<QString>& fourfitOutputFName,
1647  QList<QString>& fourfitErrorCodes,
1648  SgVector*& scanStartSec, SgVector*& scanStopSec
1649  )
1650 {
1651  bool isOk=false;
1652  //
1653  if (correlatorType_ == CT_Mk3 ||
1655  isOk = loadObsCorrelatorInfoMk3(band, fourfitOutputFName, fourfitErrorCodes,
1656  scanStartSec, scanStopSec);
1657  else if ( correlatorType_ == CT_CRL ||
1658  correlatorType_ == CT_GSI ||
1659  correlatorType_ == CT_S2 )
1660  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
1661  scanStartSec, scanStopSec);
1662  else if ( correlatorType_ == CT_Mk4 ||
1665  isOk = loadObsCorrelatorInfoMk4(band, fourfitOutputFName, fourfitErrorCodes,
1666  scanStartSec, scanStopSec);
1667  else
1668  {
1669  // Unknown, try each of types:
1671  "::loadObsCorrelatorInfo(): unknown correlator type, trying Mk4 data format");
1672  isOk = loadObsCorrelatorInfoMk4(band, fourfitOutputFName, fourfitErrorCodes,
1673  scanStartSec, scanStopSec);
1674  if (!isOk)
1675  {
1677  "::loadObsCorrelatorInfo(): unknown correlator type, trying S2 data format");
1678  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
1679  scanStartSec, scanStopSec);
1680  };
1681  if (!isOk)
1682  {
1684  "::loadObsCorrelatorInfo(): unknown correlator type, trying Mk3 data format");
1685  isOk = loadObsCorrelatorInfoMk3(band, fourfitOutputFName, fourfitErrorCodes,
1686  scanStartSec, scanStopSec);
1687  };
1688  };
1689  return isOk;
1690 };
1691 
1692 
1693 
1694 //
1695 bool SgVgosDb::loadObsCorrelatorInfoMk3(const QString& band,
1696  QList<QString>& fourfitOutputFName,
1697  QList<QString>& fourfitErrorCodes,
1698  SgVector*& scanStartSec, SgVector*& scanStopSec
1699  )
1700 {
1701  if (!bandDataByName_.contains(band))
1702  {
1704  "::loadObsCorrelatorInfoMk3(): the band \"" + band + "\" is not registered");
1705  return false;
1706  };
1707  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
1708  if (var.isEmpty())
1709  {
1711  "::loadObsCorrelatorInfoMk3(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
1712  return false;
1713  };
1714  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1715  ncdf.getData();
1716  if (!checkFormat(fcfCorrInfoInptMk3, ncdf))
1717  {
1719  "::loadObsCorrelatorInfoMk3(): format check failed");
1720  return false;
1721  };
1722  if (ncdf.lookupVar(fcVLB1FILE.name()))
1723  {
1724  const char *p=ncdf.lookupVar(fcVLB1FILE.name())->data2char();
1725  int l;
1726  //
1727  l = ncdf.lookupVar(fcVLB1FILE.name())->dimensions().at(1)->getN();
1728  //
1729  fourfitOutputFName.clear();
1730  for (int i=0; i<numOfObs_; i++)
1731  fourfitOutputFName.append(QString::fromLatin1(p + l*i, l));
1732  };
1733  if (ncdf.lookupVar(fcFRNGERR.name()))
1734  {
1735  const char *p=ncdf.lookupVar(fcFRNGERR.name())->data2char();
1736  //
1737  fourfitErrorCodes.clear();
1738  for (int i=0; i<numOfObs_; i++)
1739  fourfitErrorCodes.append(QString::fromLatin1(p + i, 1));
1740  };
1741  if (ncdf.lookupVar(fcStartSec.name()) && ncdf.lookupVar(fcStopSec.name()))
1742  {
1743  const double *pStart=ncdf.lookupVar(fcStartSec.name())->data2double();
1744  const double *pStop =ncdf.lookupVar(fcStopSec.name())->data2double();
1745  scanStartSec = new SgVector(numOfObs_);
1746  scanStopSec = new SgVector(numOfObs_);
1747  for (int i=0; i<numOfObs_; i++)
1748  {
1749  scanStartSec->setElement(i, pStart[i]);
1750  scanStopSec ->setElement(i, pStop [i]);
1751  };
1752  };
1754  "::loadObsCorrelatorInfoMk3(): data loaded successfully from " + ncdf.getFileName());
1755  return true;
1756 };
1757 
1758 
1759 
1760 //
1761 bool SgVgosDb::loadObsCorrelatorInfoCrl(const QString& band,
1762  QList<QString>& fourfitOutputFName,
1763  QList<QString>& fourfitErrorCodes,
1764  SgVector*& scanStartSec, SgVector*& scanStopSec
1765  )
1766 {
1767  if (!bandDataByName_.contains(band))
1768  {
1770  "::loadObsCorrelatorInfoCrl(): the band \"" + band + "\" is not registered");
1771  return false;
1772  };
1773  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
1774  if (var.isEmpty())
1775  {
1777  "::loadObsCorrelatorInfoCrl(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
1778  return false;
1779  };
1780  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1781  ncdf.getData();
1782  if (!checkFormat(fcfCorrInfoInptCRL, ncdf))
1783  {
1785  "::loadObsCorrelatorInfoCrl(): format check failed");
1786  return false;
1787  };
1788  /*
1789  if (ncdf.lookupVar(fcVLB1FILE.name()))
1790  {
1791  const char *p=ncdf.lookupVar(fcVLB1FILE.name())->data2char();
1792  int l;
1793  //
1794  l = ncdf.lookupVar(fcVLB1FILE.name())->dimensions().at(1)->getN();
1795  //
1796  fourfitOutputFName.clear();
1797  for (int i=0; i<numOfObs_; i++)
1798  fourfitOutputFName.append(QString::fromLatin1(p + l*i, l));
1799  };
1800  */
1801  if (ncdf.lookupVar(fcFOURFFIL.name()))
1802  {
1803  const char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())->data2char();
1804  int l;
1805  //
1806  l = ncdf.lookupVar(fcFOURFFIL.name())->dimensions().at(1)->getN();
1807  //
1808  fourfitOutputFName.clear();
1809  for (int i=0; i<numOfObs_; i++)
1810  fourfitOutputFName.append(QString::fromLatin1(pFOURFFIL + l*i, l));
1811  };
1812  if (ncdf.lookupVar(fcFRNGERR4S2.name()))
1813  {
1814  const short *p=ncdf.lookupVar(fcFRNGERR4S2.name())->data2short();
1815  //
1816  fourfitErrorCodes.clear();
1817  for (int i=0; i<numOfObs_; i++)
1818  fourfitErrorCodes.append(*p==0?" ":"Q");
1819  };
1820  if (ncdf.lookupVar(fcStartSec.name()) && ncdf.lookupVar(fcStopSec.name()))
1821  {
1822  const double *pStart=ncdf.lookupVar(fcStartSec.name())->data2double();
1823  const double *pStop =ncdf.lookupVar(fcStopSec.name())->data2double();
1824  scanStartSec = new SgVector(numOfObs_);
1825  scanStopSec = new SgVector(numOfObs_);
1826  for (int i=0; i<numOfObs_; i++)
1827  {
1828  scanStartSec->setElement(i, pStart[i]);
1829  scanStopSec ->setElement(i, pStop [i]);
1830  };
1831  };
1833  "::loadObsCorrelatorInfoCrl(): data loaded successfully from " + ncdf.getFileName());
1834  return true;
1835 };
1836 
1837 
1838 
1839 //
1840 bool SgVgosDb::loadObsCorrelatorInfoMk4(const QString& band,
1841  QList<QString>& fourfitOutputFName,
1842  QList<QString>& fourfitErrorCodes,
1843  SgVector*& scanStartSec, SgVector*& scanStopSec
1844  )
1845 {
1846  if (!bandDataByName_.contains(band))
1847  {
1849  "::loadObsCorrelatorInfoMk4(): the band \"" + band + "\" is not registered");
1850  return false;
1851  };
1852  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
1853  if (var.isEmpty())
1854  {
1856  "::loadObsCorrelatorInfoMk4(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
1857  return false;
1858  };
1859  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1860  ncdf.getData();
1861  if (!checkFormat(fcfCorrInfoInptMk4, ncdf))
1862  {
1864  "::loadObsCorrelatorInfoMk4(): format check failed");
1865  return false;
1866  };
1867  if (ncdf.lookupVar(fcFOURFFIL.name()))
1868  {
1869  const char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())->data2char();
1870  int l;
1871  //
1872  l = ncdf.lookupVar(fcFOURFFIL.name())->dimensions().at(1)->getN();
1873  //
1874  fourfitOutputFName.clear();
1875  for (int i=0; i<numOfObs_; i++)
1876  fourfitOutputFName.append(QString::fromLatin1(pFOURFFIL + l*i, l));
1877  };
1878  if (ncdf.lookupVar(fcFRNGERR.name()))
1879  {
1880  const char *p=ncdf.lookupVar(fcFRNGERR.name())->data2char();
1881  //
1882  fourfitErrorCodes.clear();
1883  for (int i=0; i<numOfObs_; i++)
1884  fourfitErrorCodes.append(QString::fromLatin1(p + i, 1));
1885  };
1886  if (ncdf.lookupVar(fcStartSec.name()) && ncdf.lookupVar(fcStopSec.name()))
1887  {
1888  const double *pStart=ncdf.lookupVar(fcStartSec.name())->data2double();
1889  const double *pStop =ncdf.lookupVar(fcStopSec.name())->data2double();
1890  scanStartSec = new SgVector(numOfObs_);
1891  scanStopSec = new SgVector(numOfObs_);
1892  for (int i=0; i<numOfObs_; i++)
1893  {
1894  scanStartSec->setElement(i, pStart[i]);
1895  scanStopSec ->setElement(i, pStop [i]);
1896  };
1897  };
1899  "::loadObsCorrelatorInfoMk4(): data loaded successfully from " + ncdf.getFileName());
1900  return true;
1901 };
1902 
1903 
1904 
1905 
1906 
1907 //
1908 // full input functions:
1909 //
1910 
1911 //
1912 bool SgVgosDb::loadObsCorrelatorInfo(const QString& band,
1913  QVector<QString>& fourfitOutputFName, // fcFOURFFIL
1914  QVector<QString>& fourfitErrorCodes, // fcFRNGERR
1915 //QVector<int>& corelVersions, // fcCORELVER
1916  QVector<int>& startOffsets, // fcStartOffset
1917  QVector< QVector<int> >& fourfitVersions, // fcFOURFVER
1918 //QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
1919  SgVector*&deltaEpochs, // fcDELTAEPO
1920  SgMatrix*&urvrs, // fcURVR
1921  SgMatrix*&instrDelays, // fcIDELAY
1922  SgMatrix*&starElev, // fcSTARELEV
1923  SgMatrix*&zenithDelays, // fcZDELAY
1924  SgMatrix*&searchParams, // fcSRCHPAR
1925  QVector<QString>& baselineCodes, // fcCORBASCD
1926  QVector<QString>& tapeQualityCodes, // fcTapeCode
1927  QVector<int>& stopOffsets, // fcStopOffset
1928  QVector<int>& hopsRevisionNumbers, // fcHopsRevNum
1929  SgVector*&sampleRate, // fcRECSETUP
1930  SgVector*&sbdResids, // fcSBRESID
1931  SgVector*&rateResids, // fcRATRESID
1932  SgVector*&effDurations, // fcEffectiveDuration
1933  SgVector*&startSeconds, // fcStartSec
1934  SgVector*&stopSeconds, // fcStopSec
1935  SgVector*&percentOfDiscards, // fcDISCARD
1936  SgVector*&uniformityFactors, // fcQBFACTOR
1937  SgVector*&geocenterPhaseResids, // fcGeocResidPhase
1938  SgVector*&geocenterPhaseTotals, // fcGeocPhase
1939  SgVector*&geocenterSbDelays, // fcGeocSBD
1940  SgVector*&geocenterGrDelays, // fcGeocMBD
1941  SgVector*&geocenterDelayRates, // fcGeocRate
1942  SgVector*&probOfFalses, // fcProbFalseDetection
1943  SgVector*&corrAprioriDelays, // fcABASDEL
1944  SgVector*&corrAprioriRates, // fcABASRATE
1945  SgVector*&corrAprioriAccs, // fcABASACCE
1946  SgVector*&incohAmps, // fcINCOHAMP
1947  SgVector*&incohAmps2, // fcINCOH2
1948  SgVector*&delayResids, // fcDELRESID
1949  QVector<QString>& vlb1FileNames, // fcVLB1FILE
1950  QVector<QString>& tapeIds_1, // fcTAPEID
1951  QVector<QString>& tapeIds_2, // fcTAPEID
1952  QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
1953  QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
1954  QVector< QVector<int> >& epochsOfFourfitings, // fcFOURFUTC
1955  QVector< QVector<int> >& epochsOfNominalScanTime, // fcUTCScan
1956  SgMatrix*&corrClocks, // fcCORCLOCK
1957  SgMatrix*&mDlys, // fcDLYEPOm1, fcDLYEPOCH, fcDLYEPOp1
1958  SgMatrix*&mAux // fcAPCLOFST, fcTOTPCENT, fcRATOBSVM,
1959  // fcUTCVLB2, fcDELOBSVM
1960 )
1961 {
1962  bool isOk=false;
1963  // reset the storages:
1964  fourfitOutputFName.clear();
1965  fourfitErrorCodes.clear();
1966 //corelVersions.clear();
1967  startOffsets.clear();
1968  fourfitVersions.clear();
1969 //dbeditVersion.clear();
1970  baselineCodes.clear();
1971  tapeQualityCodes.clear();
1972  stopOffsets.clear();
1973  hopsRevisionNumbers.clear();
1974  vlb1FileNames.clear();
1975  tapeIds_1.clear();
1976  tapeIds_2.clear();
1977  epochsOfCorrelations.clear();
1978  epochsOfCentrals.clear();
1979  epochsOfFourfitings.clear();
1980  epochsOfNominalScanTime.clear();
1981 
1982  QList<SgVector*> vecs2clear;
1983  QList<SgMatrix*> mats2clear;
1984 
1985  vecs2clear << deltaEpochs << sbdResids << rateResids << effDurations << startSeconds << stopSeconds
1986  << percentOfDiscards << uniformityFactors << geocenterPhaseResids << geocenterPhaseTotals
1987  << geocenterSbDelays << geocenterGrDelays << geocenterDelayRates << probOfFalses
1988  << corrAprioriDelays << corrAprioriRates << corrAprioriAccs << incohAmps << incohAmps2
1989  << delayResids << sampleRate;
1990  mats2clear << urvrs << instrDelays << searchParams << corrClocks << mDlys << mAux
1991  << starElev << zenithDelays;
1992 
1993  for (int i=0; i<vecs2clear.size(); i++)
1994  {
1995  SgVector *v=vecs2clear[i];
1996  if (v)
1997  {
1998  delete v;
1999  v = NULL;
2000  };
2001  };
2002  for (int i=0; i<mats2clear.size(); i++)
2003  {
2004  SgMatrix *m=mats2clear[i];
2005  if (m)
2006  {
2007  delete m;
2008  m = NULL;
2009  };
2010  };
2011  //
2012  //
2013  if (correlatorType_ == CT_Mk3 ||
2015  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
2016  deltaEpochs, searchParams, baselineCodes, tapeQualityCodes, sampleRate, sbdResids, rateResids,
2017  effDurations, startSeconds, stopSeconds, percentOfDiscards, geocenterPhaseResids,
2018  geocenterPhaseTotals, probOfFalses, corrAprioriDelays, corrAprioriRates, corrAprioriAccs,
2019  incohAmps, incohAmps2, delayResids, vlb1FileNames, epochsOfCorrelations, epochsOfCentrals,
2020  mDlys, mAux);
2021  else if ( correlatorType_ == CT_S2 )
2022  isOk = loadObsCorrelatorInfoS2(band, fourfitOutputFName, fourfitErrorCodes,
2023  deltaEpochs, searchParams, baselineCodes, tapeQualityCodes, sampleRate, sbdResids, rateResids,
2024  effDurations, startSeconds, stopSeconds, percentOfDiscards, geocenterPhaseResids,
2025  geocenterPhaseTotals, probOfFalses, corrAprioriDelays, corrAprioriRates, corrAprioriAccs,
2026  incohAmps, incohAmps2, delayResids, vlb1FileNames, epochsOfCorrelations, epochsOfCentrals,
2027  mDlys, mAux);
2028  else if ( correlatorType_ == CT_CRL ||
2029  correlatorType_ == CT_GSI )
2030  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
2031  deltaEpochs, searchParams, baselineCodes, tapeQualityCodes, sampleRate, sbdResids, rateResids,
2032  effDurations, startSeconds, stopSeconds, percentOfDiscards, geocenterPhaseResids,
2033  geocenterPhaseTotals, probOfFalses, corrAprioriDelays, corrAprioriRates, corrAprioriAccs,
2034  incohAmps, incohAmps2, delayResids, vlb1FileNames, epochsOfCorrelations, epochsOfCentrals,
2035  mDlys, mAux);
2036  else if ( correlatorType_ == CT_Mk4 ||
2039  isOk = loadObsCorrelatorInfoMk4(band, fourfitOutputFName, fourfitErrorCodes,
2040  startOffsets, fourfitVersions, deltaEpochs, urvrs, instrDelays, starElev, zenithDelays,
2041  searchParams, baselineCodes, tapeQualityCodes, stopOffsets, hopsRevisionNumbers,
2042  sbdResids, rateResids, effDurations, startSeconds, stopSeconds, percentOfDiscards,
2043  uniformityFactors, geocenterPhaseResids, geocenterPhaseTotals, geocenterSbDelays,
2044  geocenterGrDelays, geocenterDelayRates, probOfFalses, corrAprioriDelays, corrAprioriRates,
2045  corrAprioriAccs, incohAmps, incohAmps2, delayResids, tapeIds_1, tapeIds_2, epochsOfCorrelations,
2046  epochsOfCentrals, epochsOfFourfitings, epochsOfNominalScanTime, corrClocks);
2047  else
2048  {
2049  // Unknown, try each of types:
2051  "::loadObsCorrelatorInfo(): unknown correlator type, trying Mk4 data format");
2052 /*
2053  isOk = loadObsCorrelatorInfoMk4(band, fourfitOutputFName, fourfitErrorCodes,
2054  startSeconds, stopSeconds);
2055  if (!isOk)
2056  {
2057  logger->write(SgLogger::INF, SgLogger::IO_NCDF, className() +
2058  "::loadObsCorrelatorInfo(): unknown correlator type, trying S2 data format");
2059  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
2060  startSeconds, stopSeconds);
2061  };
2062  if (!isOk)
2063  {
2064  logger->write(SgLogger::INF, SgLogger::IO_NCDF, className() +
2065  "::loadObsCorrelatorInfo(): unknown correlator type, trying Mk3 data format");
2066  isOk = loadObsCorrelatorInfoMk3(band, fourfitOutputFName, fourfitErrorCodes,
2067  startSeconds, stopSeconds);
2068  };
2069 */
2070  };
2071  return isOk;
2072 };
2073 
2074 
2075 
2076 //
2077 bool SgVgosDb::loadObsCorrelatorInfoCrl(const QString& band,
2078  QVector<QString>& fourfitOutputFName, // fcFOURFFIL
2079  QVector<QString>& fourfitErrorCodes, // fcFRNGERR
2080 //QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
2081  SgVector*&deltaEpochs, // fcDELTAEPO
2082  SgMatrix*&searchParams, // fcSRCHPAR
2083  QVector<QString>& baselineCodes, // fcCORBASCD
2084  QVector<QString>& tapeQualityCodes, // fcTapeCode
2085  SgVector*&sampleRate, // fcRECSETUP
2086  SgVector*&sbdResids, // fcSBRESID
2087  SgVector*&rateResids, // fcRATRESID
2088  SgVector*&effDurations, // fcEffectiveDuration
2089  SgVector*&startSeconds, // fcStartSec
2090  SgVector*&stopSeconds, // fcStopSec
2091  SgVector*&percentOfDiscards, // fcDISCARD
2092  SgVector*&geocenterPhaseResids, // fcGeocResidPhase
2093  SgVector*&geocenterPhaseTotals, // fcGeocPhase
2094  SgVector*&probOfFalses, // fcProbFalseDetection
2095  SgVector*&corrAprioriDelays, // fcABASDEL
2096  SgVector*&corrAprioriRates, // fcABASRATE
2097  SgVector*&corrAprioriAccs, // fcABASACCE
2098  SgVector*&incohAmps, // fcINCOHAMP
2099  SgVector*&incohAmps2, // fcINCOH2
2100  SgVector*&delayResids, // fcDELRESID
2101  QVector<QString>& vlb1FileNames, // fcVLB1FILE
2102  QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
2103  QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
2104  SgMatrix*&mDlys, // fcDLYEPOm1, fcDLYEPOCH, fcDLYEPOp1
2105  SgMatrix*&mAux // fcAPCLOFST, fcTOTPCENT, fcRATOBSVM,
2106  // fcUTCVLB2, fcDELOBSVM
2107 )
2108 {
2109  if (!bandDataByName_.contains(band))
2110  {
2112  "::loadObsCorrelatorInfoCrl(): the band \"" + band + "\" is not registered");
2113  return false;
2114  };
2115  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
2116  if (var.isEmpty())
2117  {
2119  "::loadObsCorrelatorInfoCrl(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
2120  return false;
2121  };
2122  //
2123  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
2124  ncdf.getData();
2125  if (!checkFormat(fcfCorrInfoKomb, ncdf))
2126  {
2128  "::loadObsCorrelatorInfoCrl(): format check failed");
2129  return false;
2130  };
2131  //
2132  //
2133  // strings:
2134  const char *pCORBASCD=ncdf.lookupVar(fcCORBASCD.name())?
2135  ncdf.lookupVar(fcCORBASCD.name())->data2char():NULL;
2136  const char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())?
2137  ncdf.lookupVar(fcFOURFFIL.name())->data2char():NULL;
2138  const char *pTapeCode=ncdf.lookupVar(fcTapeCode.name())?
2139  ncdf.lookupVar(fcTapeCode.name())->data2char():NULL;
2140  const char *pVLB1FILE=ncdf.lookupVar(fcVLB1FILE.name())?
2141  ncdf.lookupVar(fcVLB1FILE.name())->data2char():NULL;
2142  //
2143  // shorts:
2144  const short *pUTCCorr=ncdf.lookupVar(fcUTCCorr.name())?
2145  ncdf.lookupVar(fcUTCCorr.name())->data2short():NULL;
2146  const short *pUTCMidObs=ncdf.lookupVar(fcUTCMidObs.name())->data2short();
2147 //const short *pDBEDITVE=ncdf.lookupVar(fcDBEDITVE.name())->data2short();
2148  // non-mandatory:
2149  const short *pFRNGERR4S2=NULL;
2150  const char *pFRNGERR =NULL;
2151  const short *pRECSETUP=ncdf.lookupVar(fcRECSETUP.name())?
2152  ncdf.lookupVar(fcRECSETUP.name())->data2short():NULL;
2153  //const short *pUTCVLB2=ncdf.lookupVar(fcUTCVLB2.name())?
2154  // ncdf.lookupVar(fcUTCVLB2.name())->data2short():NULL;
2155  //
2156  // non-mandatory:
2157  // doubles:
2158  const double *pSRCHPAR=ncdf.lookupVar(fcSRCHPAR.name())->data2double();
2159  const double *pEffectiveDuration=
2161  const double *pDISCARD=ncdf.lookupVar(fcDISCARD.name())->data2double();
2162  const double *pGeocResidPhase=ncdf.lookupVar(fcGeocResidPhase.name())->data2double();
2163  const double *pProbFalseDetection=
2165  const double *pABASRATE=ncdf.lookupVar(fcABASRATE.name())?
2166  ncdf.lookupVar(fcABASRATE.name())->data2double():NULL;
2167  const double *pABASDEL=ncdf.lookupVar(fcABASDEL.name())?
2168  ncdf.lookupVar(fcABASDEL.name())->data2double():NULL;
2169  const double *pABASACCE=ncdf.lookupVar(fcABASACCE.name())?
2170  ncdf.lookupVar(fcABASACCE.name())->data2double():NULL;
2171  const double *pGeocPhase=ncdf.lookupVar(fcGeocPhase.name())->data2double();
2172  const double *pINCOHAMP=ncdf.lookupVar(fcINCOHAMP.name())->data2double();
2173  const double *pINCOH2=ncdf.lookupVar(fcINCOH2.name())->data2double();
2174  const double *pDELRESID=ncdf.lookupVar(fcDELRESID.name())->data2double();
2175  // non-mandatory:
2176  const double *pDELTAEPO=ncdf.lookupVar(fcDELTAEPO.name())?
2177  ncdf.lookupVar(fcDELTAEPO.name())->data2double():NULL;
2178  const double *pSBRESID=ncdf.lookupVar(fcSBRESID.name())?
2179  ncdf.lookupVar(fcSBRESID.name())->data2double():NULL;
2180  const double *pRATRESID=ncdf.lookupVar(fcRATRESID.name())?
2181  ncdf.lookupVar(fcRATRESID.name())->data2double():NULL;
2182  const double *pStartSec=ncdf.lookupVar(fcStartSec.name())?
2183  ncdf.lookupVar(fcStartSec.name())->data2double():NULL;
2184  const double *pStopSec=ncdf.lookupVar(fcStopSec.name())?
2185  ncdf.lookupVar(fcStopSec.name())->data2double():NULL;
2186  const double *pDLYEPOp1=ncdf.lookupVar(fcDLYEPOp1.name())?
2187  ncdf.lookupVar(fcDLYEPOp1.name())->data2double():NULL;
2188  const double *pDLYEPOCH=ncdf.lookupVar(fcDLYEPOCH.name())?
2189  ncdf.lookupVar(fcDLYEPOCH.name())->data2double():NULL;
2190  const double *pDLYEPOm1=ncdf.lookupVar(fcDLYEPOm1.name())?
2191  ncdf.lookupVar(fcDLYEPOm1.name())->data2double():NULL;
2192  const double *pAPCLOFST=ncdf.lookupVar(fcAPCLOFST.name())?
2193  ncdf.lookupVar(fcAPCLOFST.name())->data2double():NULL;
2194  const double *pTOTPCENT=ncdf.lookupVar(fcTOTPCENT.name())?
2195  ncdf.lookupVar(fcTOTPCENT.name())->data2double():NULL;
2196  const double *pRATOBSVM=ncdf.lookupVar(fcRATOBSVM.name())?
2197  ncdf.lookupVar(fcRATOBSVM.name())->data2double():NULL;
2198  const double *pDELOBSVM=ncdf.lookupVar(fcDELOBSVM.name())?
2199  ncdf.lookupVar(fcDELOBSVM.name())->data2double():NULL;
2200  //
2201  //
2202  double d;
2203  //
2204  // adjust the sizes:
2205  if (pFOURFFIL)
2206  fourfitOutputFName.resize(numOfObs_);
2207 
2208  // can be either char or int:
2209  if (ncdf.lookupVar(fcFRNGERR4S2.name()) &&
2211  pFRNGERR4S2 = ncdf.lookupVar(fcFRNGERR4S2.name())->data2short();
2212  else if (ncdf.lookupVar(fcFRNGERR.name()) &&
2214  pFRNGERR = ncdf.lookupVar(fcFRNGERR.name())->data2char();
2215 
2216  if (pFRNGERR || pFRNGERR4S2)
2217  fourfitErrorCodes.resize(numOfObs_);
2218  if (pCORBASCD)
2219  baselineCodes.resize(numOfObs_);
2220  if (pTapeCode)
2221  tapeQualityCodes.resize(numOfObs_);
2222  if (pVLB1FILE)
2223  vlb1FileNames.resize(numOfObs_);
2224 //dbeditVersion.resize(numOfObs_);
2225 
2226  // ?mandatory:
2227  epochsOfCorrelations.resize(numOfObs_);
2228  epochsOfCentrals.resize(numOfObs_);
2229  for (int i=0; i<numOfObs_; i++)
2230  {
2231 // dbeditVersion[i].resize(3);
2232  epochsOfCorrelations[i].resize(6);
2233  epochsOfCentrals[i].resize(6);
2234  };
2235  //
2236  if (pDELTAEPO)
2237  deltaEpochs = new SgVector(numOfObs_);
2238  if (pSBRESID)
2239  sbdResids = new SgVector(numOfObs_);
2240  if (pRATRESID)
2241  rateResids = new SgVector(numOfObs_);
2242  if (pEffectiveDuration)
2243  effDurations = new SgVector(numOfObs_);
2244  if (pStartSec)
2245  startSeconds = new SgVector(numOfObs_);
2246  if (pStopSec)
2247  stopSeconds = new SgVector(numOfObs_);
2248  if (pDISCARD)
2249  percentOfDiscards = new SgVector(numOfObs_);
2250  if (pGeocResidPhase)
2251  geocenterPhaseResids = new SgVector(numOfObs_);
2252  if (pGeocPhase)
2253  geocenterPhaseTotals = new SgVector(numOfObs_);
2254  if (pProbFalseDetection)
2255  probOfFalses = new SgVector(numOfObs_);
2256  if (pABASDEL)
2257  corrAprioriDelays = new SgVector(numOfObs_);
2258  if (pABASRATE)
2259  corrAprioriRates = new SgVector(numOfObs_);
2260  if (pABASACCE)
2261  corrAprioriAccs = new SgVector(numOfObs_);
2262  if (pINCOHAMP)
2263  incohAmps = new SgVector(numOfObs_);
2264  if (pINCOH2)
2265  incohAmps2 = new SgVector(numOfObs_);
2266  if (pDELRESID)
2267  delayResids = new SgVector(numOfObs_);
2268  //
2269  searchParams = new SgMatrix(numOfObs_, 6);
2270  //
2271  if (pRECSETUP)
2272  sampleRate = new SgVector(numOfObs_);
2273  if (pDLYEPOm1 || pDLYEPOCH || pDLYEPOp1)
2274  mDlys = new SgMatrix(numOfObs_, 3);
2275  if (pAPCLOFST || pTOTPCENT || pRATOBSVM || pDELOBSVM)
2276  mAux = new SgMatrix(numOfObs_, 4);
2277 
2278 
2279 //int lCORBASCD, lFOURFFIL, lTapeCode, lVLB1FILE;
2280  int lCORBASCD, lFOURFFIL, lFRNGERR, lTapeCode, lVLB1FILE;
2281  lCORBASCD = pCORBASCD?ncdf.lookupVar(fcCORBASCD.name())->dimensions().at(1)->getN():0;
2282  lFOURFFIL = pFOURFFIL?ncdf.lookupVar(fcFOURFFIL.name())->dimensions().at(1)->getN():0;
2283  lTapeCode = pTapeCode?ncdf.lookupVar(fcTapeCode.name())->dimensions().at(1)->getN():0;
2284  lVLB1FILE = pVLB1FILE?ncdf.lookupVar(fcVLB1FILE.name())->dimensions().at(1)->getN():0;
2285  lFRNGERR = 1;
2286 
2287  for (int i=0; i<numOfObs_; i++)
2288  {
2289  //
2290  // strings:
2291  if (pCORBASCD)
2292  baselineCodes[i] = QString::fromLatin1(pCORBASCD + lCORBASCD*i, lCORBASCD);
2293  if (pFOURFFIL)
2294  fourfitOutputFName[i] = QString::fromLatin1(pFOURFFIL + lFOURFFIL*i, lFOURFFIL);
2295  if (pTapeCode)
2296  tapeQualityCodes[i] = QString::fromLatin1(pTapeCode + lTapeCode*i, lTapeCode);
2297  //
2298  // shorts:
2299  for (int j=0; j<6; j++)
2300  {
2301  if (pUTCCorr)
2302  epochsOfCorrelations[i][j] = pUTCCorr[6*i + j];
2303  if (pUTCMidObs)
2304  epochsOfCentrals[i][j] = pUTCMidObs[6*i + j];
2305  };
2306 // dbeditVersion[i][0] = pDBEDITVE[3*i ];
2307 // dbeditVersion[i][1] = pDBEDITVE[3*i+1];
2308 // dbeditVersion[i][2] = pDBEDITVE[3*i+2];
2309  if (pSBRESID)
2310  sbdResids->setElement(i, pSBRESID[i]);
2311  if (pRATRESID)
2312  rateResids->setElement(i, pRATRESID[i]);
2313  if (pStartSec)
2314  {
2315  if (40000.0 < (d=pStartSec[i]))
2316  {
2318  "::loadObsCorrelatorInfoCrl(): got unexpected value for start second: " +
2319  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2320  d = 0.0;
2321  };
2322  startSeconds->setElement(i, d);
2323  };
2324  if (pStopSec)
2325  {
2326  if (40000.0 < (d=pStopSec[i]))
2327  {
2329  "::loadObsCorrelatorInfoCrl(): got unexpected value for stop second: " +
2330  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2331  d = 0.0;
2332  };
2333  stopSeconds->setElement(i, d);
2334  };
2335  if (pDELTAEPO)
2336  deltaEpochs->setElement(i, pDELTAEPO[i]);
2337  //
2338  // doubles:
2339  if (pEffectiveDuration)
2340  effDurations->setElement(i, pEffectiveDuration[i]);
2341  if (pABASRATE)
2342  corrAprioriRates->setElement(i, pABASRATE[i]);
2343  if (pABASDEL)
2344  corrAprioriDelays->setElement(i, pABASDEL[i]);
2345  if (pABASACCE)
2346  corrAprioriAccs->setElement(i, pABASACCE[i]);
2347  if (pDISCARD)
2348  percentOfDiscards->setElement(i, pDISCARD[i]);
2349  if (pGeocResidPhase)
2350  geocenterPhaseResids->setElement(i, pGeocResidPhase[i]);
2351  if (pGeocPhase)
2352  geocenterPhaseTotals->setElement(i, pGeocPhase[i]);
2353  if (pProbFalseDetection)
2354  probOfFalses->setElement(i, pProbFalseDetection[i]);
2355  if (pINCOHAMP)
2356  incohAmps->setElement(i, pINCOHAMP[i]);
2357  if (pINCOH2)
2358  incohAmps2->setElement(i, pINCOH2[i]);
2359  if (pDELRESID)
2360  delayResids->setElement(i, pDELRESID[i]);
2361  for (int j=0; j<6; j++)
2362  searchParams->setElement(i,j, pSRCHPAR[6*i + j]);
2363  //
2364  // GSI-specific variables:
2365  if (pVLB1FILE)
2366  vlb1FileNames[i] = QString::fromLatin1(pVLB1FILE + lVLB1FILE*i, lVLB1FILE);
2367 
2368  if (pFRNGERR)
2369  fourfitErrorCodes[i] = QString::fromLatin1(pFRNGERR + lFRNGERR*i, lFRNGERR);
2370  else if (pFRNGERR4S2)
2371  fourfitErrorCodes[i] = pFRNGERR4S2[i]==0?" ":"F";
2372 
2373  if (pRECSETUP)
2374  sampleRate->setElement(i, pRECSETUP[3*i]*1.0e3);
2375  if (pDLYEPOm1)
2376  mDlys->setElement(i,0, pDLYEPOm1[i]);
2377  if (pDLYEPOCH)
2378  mDlys->setElement(i,1, pDLYEPOCH[i]);
2379  if (pDLYEPOp1)
2380  mDlys->setElement(i,2, pDLYEPOp1[i]);
2381  if (pAPCLOFST)
2382  mAux->setElement(i, 0, pAPCLOFST[i]);
2383  if (pTOTPCENT)
2384  mAux->setElement(i, 1, pTOTPCENT[i]);
2385  if (pRATOBSVM)
2386  mAux->setElement(i, 2, pRATOBSVM[i]);
2387  if (pDELOBSVM)
2388  mAux->setElement(i, 3, (pDELOBSVM[2*i] + pDELOBSVM[2*i + 1])*1.0e-6);
2389  };
2391  "::loadObsCorrelatorInfoCrl(): data loaded successfully from " + ncdf.getFileName());
2392  return true;
2393 };
2394 
2395 
2396 
2397 //
2398 bool SgVgosDb::loadObsCorrelatorInfoS2(const QString& band,
2399  QVector<QString>& fourfitOutputFName, // fcFOURFFIL
2400  QVector<QString>& fourfitErrorCodes, // fcFRNGERR
2401 //QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
2402  SgVector*&deltaEpochs, // fcDELTAEPO
2403  SgMatrix*&searchParams, // fcSRCHPAR
2404  QVector<QString>& baselineCodes, // fcCORBASCD
2405  QVector<QString>& tapeQualityCodes, // fcTapeCode
2406  SgVector*&sampleRate, // fcRECSETUP
2407  SgVector*&sbdResids, // fcSBRESID
2408  SgVector*&rateResids, // fcRATRESID
2409  SgVector*&effDurations, // fcEffectiveDuration
2410  SgVector*&startSeconds, // fcStartSec
2411  SgVector*&stopSeconds, // fcStopSec
2412  SgVector*&percentOfDiscards, // fcDISCARD
2413  SgVector*&geocenterPhaseResids, // fcGeocResidPhase
2414  SgVector*&geocenterPhaseTotals, // fcGeocPhase
2415  SgVector*&probOfFalses, // fcProbFalseDetection
2416  SgVector*&corrAprioriDelays, // fcABASDEL
2417  SgVector*&corrAprioriRates, // fcABASRATE
2418  SgVector*&corrAprioriAccs, // fcABASACCE
2419  SgVector*&incohAmps, // fcINCOHAMP
2420  SgVector*&incohAmps2, // fcINCOH2
2421  SgVector*&delayResids, // fcDELRESID
2422  QVector<QString>& vlb1FileNames, // fcVLB1FILE
2423  QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
2424  QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
2425  SgMatrix*&mDlys, // fcDLYEPOm1, fcDLYEPOCH, fcDLYEPOp1
2426  SgMatrix*&mAux // fcAPCLOFST, fcTOTPCENT, fcRATOBSVM,
2427  // fcUTCVLB2, fcDELOBSVM
2428 )
2429 {
2430  if (!bandDataByName_.contains(band))
2431  {
2433  "::loadObsCorrelatorInfoS2(): the band \"" + band + "\" is not registered");
2434  return false;
2435  };
2436  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
2437  if (var.isEmpty())
2438  {
2440  "::loadObsCorrelatorInfoS2(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
2441  return false;
2442  };
2443  //
2444  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
2445  ncdf.getData();
2446  if (!checkFormat(fcfCorrInfoInptS2, ncdf))
2447  {
2449  "::loadObsCorrelatorInfoS2(): format check failed");
2450  return false;
2451  };
2452  //
2453  //
2454  // strings:
2455  const char *pVLB1FILE=ncdf.lookupVar(fcVLB1FILE.name())?
2456  ncdf.lookupVar(fcVLB1FILE.name())->data2char():NULL;
2457  // doubles:
2458  const short *pRECSETUP=ncdf.lookupVar(fcRECSETUP.name())?
2459  ncdf.lookupVar(fcRECSETUP.name())->data2short():NULL;
2460  const double *pSBRESID=ncdf.lookupVar(fcSBRESID.name())?
2461  ncdf.lookupVar(fcSBRESID.name())->data2double():NULL;
2462  const double *pRATRESID=ncdf.lookupVar(fcRATRESID.name())?
2463  ncdf.lookupVar(fcRATRESID.name())->data2double():NULL;
2464  const double *pDELRESID=ncdf.lookupVar(fcDELRESID.name())?
2465  ncdf.lookupVar(fcDELRESID.name())->data2double():NULL;
2466  const double *pStartSec=ncdf.lookupVar(fcStartSec.name())?
2467  ncdf.lookupVar(fcStartSec.name())->data2double():NULL;
2468  const double *pStopSec=ncdf.lookupVar(fcStopSec.name())?
2469  ncdf.lookupVar(fcStopSec.name())->data2double():NULL;
2470  const double *pGeocPhase=ncdf.lookupVar(fcGeocPhase.name())?
2471  ncdf.lookupVar(fcGeocPhase.name())->data2double():NULL;
2472 
2473  const double *pUTCErr=ncdf.lookupVar(fcUTCErr.name())?
2474  ncdf.lookupVar(fcUTCErr.name())->data2double():NULL;
2475  const double *pVFDWELL=ncdf.lookupVar(fcVFDWELL.name())?
2476  ncdf.lookupVar(fcVFDWELL.name())->data2double():NULL;
2477  const double *pS2EFFREQ=ncdf.lookupVar(fcS2EFFREQ.name())?
2478  ncdf.lookupVar(fcS2EFFREQ.name())->data2double():NULL;
2479  const double *pS2REFREQ=ncdf.lookupVar(fcS2REFREQ.name())?
2480  ncdf.lookupVar(fcS2REFREQ.name())->data2double():NULL;
2481  const double *pS2PHEFRQ=ncdf.lookupVar(fcS2PHEFRQ.name())?
2482  ncdf.lookupVar(fcS2PHEFRQ.name())->data2double():NULL;
2483  const double *pTotalFringeErr=ncdf.lookupVar(fcTotalFringeErr.name())?
2484  ncdf.lookupVar(fcTotalFringeErr.name())->data2double():NULL;
2485  const double *pDURATION=ncdf.lookupVar(fcDURATION.name())?
2486  ncdf.lookupVar(fcDURATION.name())->data2double():NULL;
2487  const double *pTimeSinceStart=ncdf.lookupVar(fcTimeSinceStart.name())?
2488  ncdf.lookupVar(fcTimeSinceStart.name())->data2double():NULL;
2489  //
2490  //
2491  double d;
2492  //
2493  //
2494  // adjust the sizes:
2495  if (pVLB1FILE)
2496  vlb1FileNames.resize(numOfObs_);
2497 
2498  //
2499  if (pRECSETUP)
2500  sampleRate = new SgVector(numOfObs_);
2501  if (pSBRESID)
2502  sbdResids = new SgVector(numOfObs_);
2503  if (pRATRESID)
2504  rateResids = new SgVector(numOfObs_);
2505  if (pDELRESID)
2506  delayResids = new SgVector(numOfObs_);
2507  if (pStartSec)
2508  startSeconds = new SgVector(numOfObs_);
2509  if (pStopSec)
2510  stopSeconds = new SgVector(numOfObs_);
2511  if (pGeocPhase)
2512  geocenterPhaseTotals = new SgVector(numOfObs_);
2513  if (pDURATION)
2514  effDurations = new SgVector(numOfObs_);
2515 
2516 
2517  int lVLB1FILE;
2518  lVLB1FILE = pVLB1FILE?ncdf.lookupVar(fcVLB1FILE.name())->dimensions().at(1)->getN():0;
2519 
2520  for (int i=0; i<numOfObs_; i++)
2521  {
2522  //
2523  // strings:
2524  if (pVLB1FILE)
2525  vlb1FileNames[i] = QString::fromLatin1(pVLB1FILE + lVLB1FILE*i, lVLB1FILE);
2526  // doubles:
2527  if (pRECSETUP)
2528  sampleRate->setElement(i, pRECSETUP[3*i]*1.0e3);
2529  if (pSBRESID)
2530  sbdResids->setElement(i, pSBRESID[i]);
2531  if (pRATRESID)
2532  rateResids->setElement(i, pRATRESID[i]);
2533  if (pDELRESID)
2534  delayResids->setElement(i, pDELRESID[i]);
2535  if (pStartSec)
2536  {
2537  if (40000.0 < (d=pStartSec[i]))
2538  {
2540  "::loadObsCorrelatorInfoS2(): got unexpected value for start second: " +
2541  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2542  d = 0.0;
2543  };
2544  startSeconds->setElement(i, d);
2545  };
2546  if (pStopSec)
2547  {
2548  if (40000.0 < (d=pStopSec[i]))
2549  {
2551  "::loadObsCorrelatorInfoS2(): got unexpected value for stop second: " +
2552  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2553  d = 0.0;
2554  };
2555  stopSeconds->setElement(i, d);
2556  };
2557  if (pGeocPhase)
2558  geocenterPhaseTotals->setElement(i, pGeocPhase[i]);
2559 
2560  if (pDURATION)
2561  effDurations->setElement(i, pDURATION[i]);
2562 
2563  };
2565  "::loadObsCorrelatorInfoS2(): data loaded successfully from " + ncdf.getFileName());
2566  return true;
2567 };
2568 
2569 
2570 
2571 
2572 //
2573 bool SgVgosDb::loadObsCorrelatorInfoMk4(const QString& band,
2574  QVector<QString>& fourfitOutputFName, // fcFOURFFIL
2575  QVector<QString>& fourfitErrorCodes, // fcFRNGERR
2576 //QVector<int>& corelVersions, // fcCORELVER
2577  QVector<int>& startOffsets, // fcStartOffset
2578  QVector< QVector<int> >& fourfitVersions, // fcFOURFVER
2579 //QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
2580  SgVector*&deltaEpochs, // fcDELTAEPO
2581  SgMatrix*&urvrs, // fcURVR
2582  SgMatrix*&instrDelays, // fcIDELAY
2583  SgMatrix*&starElev, // fcSTARELEV
2584  SgMatrix*&zenithDelays, // fcZDELAY
2585  SgMatrix*&searchParams, // fcSRCHPAR
2586  QVector<QString>& baselineCodes, // fcCORBASCD
2587  QVector<QString>& tapeQualityCodes, // fcTapeCode
2588  QVector<int>& stopOffsets, // fcStopOffset
2589  QVector<int>& hopsRevisionNumbers, // fcHopsRevNum
2590  SgVector*&sbdResids, // fcSBRESID
2591  SgVector*&rateResids, // fcRATRESID
2592  SgVector*&effDurations, // fcEffectiveDuration
2593  SgVector*&startSeconds, // fcStartSec
2594  SgVector*&stopSeconds, // fcStopSec
2595  SgVector*&percentOfDiscards, // fcDISCARD
2596  SgVector*&uniformityFactors, // fcQBFACTOR
2597  SgVector*&geocenterPhaseResids, // fcGeocResidPhase
2598  SgVector*&geocenterPhaseTotals, // fcGeocPhase
2599  SgVector*&geocenterSbDelays, // fcGeocSBD
2600  SgVector*&geocenterGrDelays, // fcGeocMBD
2601  SgVector*&geocenterDelayRates, // fcGeocRate
2602  SgVector*&probOfFalses, // fcProbFalseDetection
2603  SgVector*&corrAprioriDelays, // fcABASDEL
2604  SgVector*&corrAprioriRates, // fcABASRATE
2605  SgVector*&corrAprioriAccs, // fcABASACCE
2606  SgVector*&incohAmps, // fcINCOHAMP
2607  SgVector*&incohAmps2, // fcINCOH2
2608  SgVector*&delayResids, // fcDELRESID
2609  QVector<QString>& tapeIds_1, // fcTAPEID
2610  QVector<QString>& tapeIds_2, // fcTAPEID
2611  QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
2612  QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
2613  QVector< QVector<int> >& epochsOfFourfitings, // fcFOURFUTC
2614  QVector< QVector<int> >& epochsOfNominalScanTime, // fcUTCScan
2615  SgMatrix*&corrClocks // fcCORCLOCK
2616  )
2617 {
2618  if (!bandDataByName_.contains(band))
2619  {
2621  "::loadObsCorrelatorInfoMk4(): the band \"" + band + "\" is not registered");
2622  return false;
2623  };
2624  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
2625  if (var.isEmpty())
2626  {
2628  "::loadObsCorrelatorInfoMk4(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
2629  return false;
2630  };
2631  //
2632  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
2633  ncdf.getData();
2634  if (!checkFormat(fcfCorrInfoMk4, ncdf))
2635  {
2637  "::loadObsCorrelatorInfoMk4(): format check failed");
2638  return false;
2639  };
2640  //
2641  //
2642 
2643  // strings:
2644  const char *pCORBASCD=ncdf.lookupVar(fcCORBASCD.name())?
2645  ncdf.lookupVar(fcCORBASCD.name())->data2char():NULL;
2646  const char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())?
2647  ncdf.lookupVar(fcFOURFFIL.name())->data2char():NULL;
2648  const char *pFRNGERR=ncdf.lookupVar(fcFRNGERR.name())?
2649  ncdf.lookupVar(fcFRNGERR.name())->data2char():NULL;
2650  const char *pTAPEID=ncdf.lookupVar(fcTAPEID.name())?
2651  ncdf.lookupVar(fcTAPEID.name())->data2char():NULL;
2652  const char *pTapeCode=ncdf.lookupVar(fcTapeCode.name())?
2653  ncdf.lookupVar(fcTapeCode.name())->data2char():NULL;
2654 
2655  // shorts:
2656  const short *pUTCCorr=ncdf.lookupVar(fcUTCCorr.name())?
2657  ncdf.lookupVar(fcUTCCorr.name())->data2short():NULL;
2658  const short *pUTCMidObs=ncdf.lookupVar(fcUTCMidObs.name())->data2short();
2659 //const short *pDBEDITVE=ncdf.lookupVar(fcDBEDITVE.name())->data2short();
2660  // non-mandatory:
2661 //const short *pCORELVER=ncdf.lookupVar(fcCORELVER.name())?
2662 // ncdf.lookupVar(fcCORELVER.name())->data2short():NULL;
2663  const short *pFOURFVER=ncdf.lookupVar(fcFOURFVER.name())?
2664  ncdf.lookupVar(fcFOURFVER.name())->data2short():NULL;
2665  const short *pStartOffset=ncdf.lookupVar(fcStartOffset.name())?
2666  ncdf.lookupVar(fcStartOffset.name())->data2short():NULL;
2667  const short *pStopOffset=ncdf.lookupVar(fcStopOffset.name())?
2668  ncdf.lookupVar(fcStopOffset.name())->data2short():NULL;
2669  const short *pHopsRevNum=ncdf.lookupVar(fcHopsRevNum.name())?
2670  ncdf.lookupVar(fcHopsRevNum.name())->data2short():NULL;
2671  const short *pFOURFUTC=ncdf.lookupVar(fcFOURFUTC.name())?
2672  ncdf.lookupVar(fcFOURFUTC.name())->data2short():NULL;
2673  const short *pUTCScan=ncdf.lookupVar(fcUTCScan.name())?
2674  ncdf.lookupVar(fcUTCScan.name())->data2short():NULL;
2675  // doubles:
2676  const double *pSRCHPAR=ncdf.lookupVar(fcSRCHPAR.name())->data2double();
2677  const double *pEffectiveDuration=
2679  const double *pDISCARD=ncdf.lookupVar(fcDISCARD.name())->data2double();
2680  const double *pGeocResidPhase=ncdf.lookupVar(fcGeocResidPhase.name())->data2double();
2681  const double *pProbFalseDetection=
2683  const double *pABASRATE=ncdf.lookupVar(fcABASRATE.name())?
2684  ncdf.lookupVar(fcABASRATE.name())->data2double():NULL;
2685  const double *pABASDEL=ncdf.lookupVar(fcABASDEL.name())?
2686  ncdf.lookupVar(fcABASDEL.name())->data2double():NULL;
2687  const double *pABASACCE=ncdf.lookupVar(fcABASACCE.name())?
2688  ncdf.lookupVar(fcABASACCE.name())->data2double():NULL;
2689  const double *pGeocPhase=ncdf.lookupVar(fcGeocPhase.name())->data2double();
2690  const double *pINCOHAMP=ncdf.lookupVar(fcINCOHAMP.name())->data2double();
2691  const double *pINCOH2=ncdf.lookupVar(fcINCOH2.name())->data2double();
2692  const double *pDELRESID=ncdf.lookupVar(fcDELRESID.name())->data2double();
2693  // non-mandatory:
2694  const double *pURVR=ncdf.lookupVar(fcURVR.name())?
2695  ncdf.lookupVar(fcURVR.name())->data2double():NULL;
2696  const double *pIDELAY=ncdf.lookupVar(fcIDELAY.name())?
2697  ncdf.lookupVar(fcIDELAY.name())->data2double():NULL;
2698  const double *pSTARELEV=ncdf.lookupVar(fcSTARELEV.name())?
2699  ncdf.lookupVar(fcSTARELEV.name())->data2double():NULL;
2700  const double *pZDELAY=ncdf.lookupVar(fcZDELAY.name())?
2701  ncdf.lookupVar(fcZDELAY.name())->data2double():NULL;
2702  const double *pQBFACTOR=ncdf.lookupVar(fcQBFACTOR.name())?
2703  ncdf.lookupVar(fcQBFACTOR.name())->data2double():NULL;
2704  const double *pGeocSBD=ncdf.lookupVar(fcGeocSBD.name())?
2705  ncdf.lookupVar(fcGeocSBD.name())->data2double():NULL;
2706  const double *pGeocRate=ncdf.lookupVar(fcGeocRate.name())?
2707  ncdf.lookupVar(fcGeocRate.name())->data2double():NULL;
2708  const double *pGeocMBD=ncdf.lookupVar(fcGeocMBD.name())?
2709  ncdf.lookupVar(fcGeocMBD.name())->data2double():NULL;
2710  const double *pCORCLOCK=ncdf.lookupVar(fcCORCLOCK.name())?
2711  ncdf.lookupVar(fcCORCLOCK.name())->data2double():NULL;
2712  const double *pDELTAEPO=ncdf.lookupVar(fcDELTAEPO.name())?
2713  ncdf.lookupVar(fcDELTAEPO.name())->data2double():NULL;
2714  const double *pSBRESID=ncdf.lookupVar(fcSBRESID.name())?
2715  ncdf.lookupVar(fcSBRESID.name())->data2double():NULL;
2716  const double *pRATRESID=ncdf.lookupVar(fcRATRESID.name())?
2717  ncdf.lookupVar(fcRATRESID.name())->data2double():NULL;
2718  const double *pStartSec=ncdf.lookupVar(fcStartSec.name())?
2719  ncdf.lookupVar(fcStartSec.name())->data2double():NULL;
2720  const double *pStopSec=ncdf.lookupVar(fcStopSec.name())?
2721  ncdf.lookupVar(fcStopSec.name())->data2double():NULL;
2722  //
2723  bool have2swapGeocMbdAndRate=false;
2724  double d;
2725  //
2726  // workaround for the bug of swapped geocentric MBD and rates:
2727  SgNcdfVariable *svcV;
2728  if ( (svcV=ncdf.lookupServiceVar(SgNetCdf::svcProgram)) )
2729  {
2730  const char *c=svcV->data2char();
2731  int l=svcV->dimensions().at(0)->getN();
2732  SgVersion v;
2733  if (v.parseString(QString::fromLatin1(c, l)))
2734  {
2735  if (v.getSoftwareName() == "vgosDbMake" &&
2736  v < SgVersion("", 0, 4, 4, "", tZero))
2737  {
2738  have2swapGeocMbdAndRate = true;
2740  "::loadObsCorrelatorInfoMk4(): found a file with the geocentric delay and rate swap bug; "
2741  "the bug has been corrected");
2742  };
2743  };
2744  };
2745 
2746  //
2747  // adjust the sizes:
2748  if (pFOURFFIL)
2749  fourfitOutputFName.resize(numOfObs_);
2750  if (pFRNGERR)
2751  fourfitErrorCodes.resize(numOfObs_);
2752  if (pCORBASCD)
2753  baselineCodes.resize(numOfObs_);
2754  if (pTapeCode)
2755  tapeQualityCodes.resize(numOfObs_);
2756  if (pTAPEID)
2757  {
2758  tapeIds_1.resize(numOfObs_);
2759  tapeIds_2.resize(numOfObs_);
2760  };
2761 //corelVersions.resize(numOfObs_);
2762  if (pStartOffset)
2763  startOffsets.resize(numOfObs_);
2764  if (pStopOffset)
2765  stopOffsets.resize(numOfObs_);
2766  if (pHopsRevNum)
2767  hopsRevisionNumbers.resize(numOfObs_);
2768  if (pFOURFVER)
2769  fourfitVersions.resize(numOfObs_);
2770 //dbeditVersion.resize(numOfObs_);
2771  epochsOfCorrelations.resize(numOfObs_);
2772  epochsOfCentrals.resize(numOfObs_);
2773  if (pFOURFUTC)
2774  epochsOfFourfitings.resize(numOfObs_);
2775  if (pUTCScan)
2776  epochsOfNominalScanTime.resize(numOfObs_);
2777  for (int i=0; i<numOfObs_; i++)
2778  {
2779  fourfitVersions[i].resize(2);
2780 // dbeditVersion[i].resize(3);
2781  epochsOfCorrelations[i].resize(6);
2782  epochsOfCentrals[i].resize(6);
2783  if (pFOURFUTC)
2784  epochsOfFourfitings[i].resize(6);
2785  if (pUTCScan)
2786  epochsOfNominalScanTime[i].resize(6);
2787  };
2788  //
2789  if (pDELTAEPO)
2790  deltaEpochs = new SgVector(numOfObs_);
2791  if (pSBRESID)
2792  sbdResids = new SgVector(numOfObs_);
2793  if (pRATRESID)
2794  rateResids = new SgVector(numOfObs_);
2795  effDurations = new SgVector(numOfObs_);
2796  if (pStartSec)
2797  startSeconds = new SgVector(numOfObs_);
2798  if (pStopSec)
2799  stopSeconds = new SgVector(numOfObs_);
2800  percentOfDiscards = new SgVector(numOfObs_);
2801  if (pQBFACTOR)
2802  uniformityFactors = new SgVector(numOfObs_);
2803  geocenterPhaseResids = new SgVector(numOfObs_);
2804  geocenterPhaseTotals = new SgVector(numOfObs_);
2805  if (pGeocSBD)
2806  geocenterSbDelays = new SgVector(numOfObs_);
2807  if (pGeocMBD)
2808  geocenterGrDelays = new SgVector(numOfObs_);
2809  if (pGeocRate)
2810  geocenterDelayRates = new SgVector(numOfObs_);
2811  probOfFalses = new SgVector(numOfObs_);
2812  corrAprioriDelays = new SgVector(numOfObs_);
2813  corrAprioriRates = new SgVector(numOfObs_);
2814  corrAprioriAccs = new SgVector(numOfObs_);
2815  incohAmps = new SgVector(numOfObs_);
2816  incohAmps2 = new SgVector(numOfObs_);
2817  delayResids = new SgVector(numOfObs_);
2818  if (pURVR)
2819  urvrs = new SgMatrix(numOfObs_, 2);
2820  if (pIDELAY)
2821  instrDelays = new SgMatrix(numOfObs_, 2);
2822  if (pSTARELEV)
2823  starElev = new SgMatrix(numOfObs_, 2);
2824  if (pZDELAY)
2825  zenithDelays = new SgMatrix(numOfObs_, 2);
2826  searchParams = new SgMatrix(numOfObs_, 6);
2827  if (pCORCLOCK)
2828  corrClocks = new SgMatrix(numOfObs_, 4);
2829  //
2830 //int lCORBASCD, lFOURFFIL, lFRNGERR, lTAPEID, lTapeCode;
2831  int lCORBASCD, lFOURFFIL, lFRNGERR, lTAPEID, lTapeCode;
2832  lCORBASCD = pCORBASCD?ncdf.lookupVar(fcCORBASCD.name())->dimensions().at(1)->getN():0;
2833  lFOURFFIL = pFOURFFIL?ncdf.lookupVar(fcFOURFFIL.name())->dimensions().at(1)->getN():0;
2834 //lFRNGERR = pFRNGERR ?ncdf.lookupVar(fcFRNGERR.name()) ->dimensions().at(1)->getN():0;
2835  lFRNGERR = 1;
2836  lTAPEID = pTAPEID ?ncdf.lookupVar(fcTAPEID.name()) ->dimensions().at(2)->getN():0;
2837  lTapeCode = pTapeCode?ncdf.lookupVar(fcTapeCode.name())->dimensions().at(1)->getN():0;
2838 
2839  for (int i=0; i<numOfObs_; i++)
2840  {
2841  //
2842  // strings:
2843  if (pCORBASCD)
2844  baselineCodes[i] = QString::fromLatin1(pCORBASCD + lCORBASCD*i, lCORBASCD);
2845  if (pFOURFFIL)
2846  fourfitOutputFName[i] = QString::fromLatin1(pFOURFFIL + lFOURFFIL*i, lFOURFFIL);
2847  if (pFRNGERR)
2848  fourfitErrorCodes[i] = QString::fromLatin1(pFRNGERR + lFRNGERR*i, lFRNGERR);
2849  if (pTAPEID)
2850  {
2851  tapeIds_1[i] = QString::fromLatin1(pTAPEID + lTAPEID*2*i, 2*lTAPEID);
2852  tapeIds_2[i] = QString::fromLatin1(pTAPEID + lTAPEID*(2*i + 1), 2*lTAPEID);
2853  };
2854  if (pTapeCode)
2855  tapeQualityCodes[i] = QString::fromLatin1(pTapeCode + lTapeCode*i, lTapeCode);
2856  //
2857  // shorts:
2858  for (int j=0; j<6; j++)
2859  {
2860  if (pUTCCorr)
2861  epochsOfCorrelations[i][j] = pUTCCorr[6*i + j];
2862  if (pUTCMidObs)
2863  epochsOfCentrals[i][j] = pUTCMidObs[6*i + j];
2864  if (pFOURFUTC)
2865  epochsOfFourfitings[i][j] = pFOURFUTC[6*i + j];
2866  if (pUTCScan)
2867  epochsOfNominalScanTime[i][j] = pUTCScan[6*i + j];
2868  };
2869 // dbeditVersion[i][0] = pDBEDITVE[3*i ];
2870 // dbeditVersion[i][1] = pDBEDITVE[3*i+1];
2871 // dbeditVersion[i][2] = pDBEDITVE[3*i+2];
2872 // if (pCORELVER)
2873 // corelVersions[i] = pCORELVER[i];
2874  if (pStartOffset)
2875  startOffsets[i] = pStartOffset[i];
2876  if (pStopOffset)
2877  stopOffsets[i] = pStopOffset[i];
2878  if (pHopsRevNum)
2879  hopsRevisionNumbers[i] = pHopsRevNum[i];
2880  if (pFOURFVER)
2881  {
2882  fourfitVersions[i][0] = pFOURFVER[2*i ];
2883  fourfitVersions[i][1] = pFOURFVER[2*i+1];
2884  };
2885  //
2886  // doubles:
2887  effDurations->setElement(i, pEffectiveDuration[i]);
2888  if (pABASRATE)
2889  corrAprioriRates->setElement(i, pABASRATE[i]);
2890  if (pABASDEL)
2891  corrAprioriDelays->setElement(i, pABASDEL[i]);
2892  if (pABASACCE)
2893  corrAprioriAccs->setElement(i, pABASACCE[i]);
2894  percentOfDiscards->setElement(i, pDISCARD[i]);
2895  geocenterPhaseResids->setElement(i, pGeocResidPhase[i]);
2896  geocenterPhaseTotals->setElement(i, pGeocPhase[i]);
2897  probOfFalses->setElement(i, pProbFalseDetection[i]);
2898  incohAmps->setElement(i, pINCOHAMP[i]);
2899  incohAmps2->setElement(i, pINCOH2[i]);
2900  delayResids->setElement(i, pDELRESID[i]);
2901  for (int j=0; j<6; j++)
2902  searchParams->setElement(i,j, pSRCHPAR[6*i + j]);
2903  //
2904  if (pSBRESID)
2905  sbdResids->setElement(i, pSBRESID[i]);
2906  if (pRATRESID)
2907  rateResids->setElement(i, pRATRESID[i]);
2908  if (pStartSec)
2909  {
2910  if (40000.0 < (d=pStartSec[i]))
2911  {
2913  "::loadObsCorrelatorInfoMk4(): got unexpected value for start second: " +
2914  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2915  d = 0.0;
2916  };
2917  startSeconds->setElement(i, d);
2918  };
2919  if (pStopSec)
2920  {
2921  if (40000.0 < (d=pStopSec[i]))
2922  {
2924  "::loadObsCorrelatorInfoMk4(): got unexpected value for stop second: " +
2925  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2926  d = 0.0;
2927  };
2928  stopSeconds->setElement(i, d);
2929  };
2930  if (pDELTAEPO)
2931  deltaEpochs->setElement(i, pDELTAEPO[i]);
2932  if (pGeocSBD)
2933  geocenterSbDelays->setElement(i, pGeocSBD[i]);
2934 
2935  if (have2swapGeocMbdAndRate)
2936  {
2937  if (pGeocMBD)
2938  geocenterGrDelays->setElement(i, pGeocRate[i]);
2939  if (pGeocRate)
2940  geocenterDelayRates->setElement(i, pGeocMBD[i]);
2941  }
2942  else
2943  {
2944  if (pGeocMBD)
2945  geocenterGrDelays->setElement(i, pGeocMBD[i]);
2946  if (pGeocRate)
2947  geocenterDelayRates->setElement(i, pGeocRate[i]);
2948  };
2949 
2950  if (pQBFACTOR)
2951  uniformityFactors->setElement(i, pQBFACTOR[i]);
2952 
2953  if (pURVR)
2954  {
2955  urvrs->setElement(i,0, pURVR[2*i ]);
2956  urvrs->setElement(i,1, pURVR[2*i+1]);
2957  };
2958  if (pIDELAY)
2959  {
2960  instrDelays->setElement(i,0, pIDELAY[2*i ]);
2961  instrDelays->setElement(i,1, pIDELAY[2*i+1]);
2962  };
2963  if (pSTARELEV)
2964  {
2965  starElev->setElement(i,0, pSTARELEV[2*i ]);
2966  starElev->setElement(i,1, pSTARELEV[2*i+1]);
2967  };
2968  if (pZDELAY)
2969  {
2970  zenithDelays->setElement(i,0, pZDELAY[2*i ]);
2971  zenithDelays->setElement(i,1, pZDELAY[2*i+1]);
2972  };
2973  if (pCORCLOCK)
2974  {
2975  corrClocks->setElement(i,0, pCORCLOCK[4*i ]);
2976  corrClocks->setElement(i,1, pCORCLOCK[4*i + 1]);
2977  corrClocks->setElement(i,2, pCORCLOCK[4*i + 2]);
2978  corrClocks->setElement(i,3, pCORCLOCK[4*i + 3]);
2979  };
2980  };
2982  "::loadObsCorrelatorInfoMk4(): data loaded successfully from " + ncdf.getFileName());
2983  return true;
2984 };
2985 
2986 
2987 
2988 
2989 //
2990 bool SgVgosDb::loadObsEditData(QVector<int>& delUFlag, QVector<int>& phsUFlag, QVector<int>& ratUFlag,
2991  QVector<int>& uAcSup)
2992 {
2993  if (vEdit_.isEmpty())
2994  {
2996  "::loadObsEditData(): the vgosDb variable Edit is empty");
2997  return false;
2998  };
2999  SgNetCdf ncdf(path2RootDir_ + "/" + vEdit_.getFileName());
3000  ncdf.getData();
3001  if (!checkFormat(*fcfEdit, ncdf))
3002  {
3004  "::loadObsEditData(): format check failed");
3005  return false;
3006  };
3007  const short *pDel=ncdf.lookupVar(fcDelayFlag.name())->data2short();
3008  const short *pRat=ncdf.lookupVar(fcRateFlag .name())->data2short();
3009  const short *pPha=ncdf.lookupVar(fcPhaseFlag.name())?
3010  ncdf.lookupVar(fcPhaseFlag.name())->data2short():NULL;
3011  const short *pUsS=ncdf.lookupVar(fcUserSup .name())?
3012  ncdf.lookupVar(fcUserSup .name())->data2short():NULL;
3013  delUFlag.resize(numOfObs_);
3014  phsUFlag.resize(numOfObs_);
3015  ratUFlag.resize(numOfObs_);
3016  if (inputFormatVersion_ == 1.001)
3017  uAcSup .resize(numOfObs_);
3018  for (int i=0; i<numOfObs_; i++)
3019  {
3020  delUFlag[i] = pDel[i];
3021  ratUFlag[i] = pRat[i];
3022  phsUFlag[i] = pPha?pPha[i]:0;
3023  if (inputFormatVersion_ == 1.001)
3024  uAcSup [i] = pUsS?pUsS[i]:-32768;
3025  };
3026  //
3027  if (1.002 <= inputFormatVersion_)
3028  loadObsUserSup(uAcSup);
3029  //
3031  "::loadObsEditData(): data loaded successfully from " + ncdf.getFileName());
3032  return true;
3033 };
3034 
3035 
3036 
3037 //
3038 bool SgVgosDb::loadObsUserSup(QVector<int>& uAcSup)
3039 {
3041  if (var.isEmpty())
3042  {
3044  "::loadObsUserSup(): the vgosDb variable UserSup is empty");
3045  return false;
3046  };
3047  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3048  ncdf.getData();
3049  if (!checkFormat(fcfUserSup, ncdf))
3050  {
3052  "::loadObsUserSup(): format check failed");
3053  return false;
3054  };
3055  const short *pUsS=ncdf.lookupVar(fcUserSup .name())?
3056  ncdf.lookupVar(fcUserSup .name())->data2short():NULL;
3057  if (!pUsS)
3058  {
3060  "::loadObsUserSup(): nothing to get");
3061  return false;
3062  }
3063  uAcSup .resize(numOfObs_);
3064  for (int i=0; i<numOfObs_; i++)
3065  uAcSup [i] = pUsS[i];
3067  "::loadObsUserSup(): data loaded successfully from " + ncdf.getFileName());
3068  return true;
3069 };
3070 
3071 
3072 
3073 //
3074 bool SgVgosDb::loadObsNumGroupAmbigs(const QString &band, QVector<int> &numAmbigs,
3075  QVector<int> &numSubAmbigs)
3076 {
3077  numAmbigs .clear();
3078  numSubAmbigs.clear();
3079 
3080  if (!bandDataByName_.contains(band))
3081  {
3083  "::loadObsNumGroupAmbigs(): the band \"" + band + "\" is not registered");
3084  return false;
3085  };
3086  SgVdbVariable &var=bandDataByName_[band].vNumGroupAmbig_;
3087  if (var.isEmpty())
3088  {
3090  "::loadObsNumGroupAmbigs(): the vgosDb variable NumGroupAmbig for the band [" + band + "] is empty");
3091  return false;
3092  };
3093  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3094  ncdf.getData();
3095  //
3096  if (checkFormat(fcfNumGroupAmbigE, ncdf))
3097  {
3098  const short *pN=ncdf.lookupVar(fcNumGroupAmbig.name())->data2short();
3099  const short *pS=ncdf.lookupVar(fcNumGroupSubAmbig.name())?
3100  ncdf.lookupVar(fcNumGroupSubAmbig.name())->data2short():NULL;
3101  numAmbigs .resize(numOfObs_);
3102  if (pS)
3103  numSubAmbigs.resize(numOfObs_);
3104  for (int i=0; i<numOfObs_; i++)
3105  {
3106  numAmbigs [i] = pN[i];
3107  if (pS)
3108  numSubAmbigs[i] = pS[i];
3109  };
3111  "::loadObsNumGroupAmbigs(): data " + (pS?"(E) ":"") +
3112  "were successfully loaded from " + ncdf.getFileName());
3113  return true;
3114  }
3115  else if (!checkFormat(fcfNumGroupAmbig, ncdf))
3116  {
3118  "::loadObsNumGroupAmbigs(): format (E) check failed");
3119  return false;
3120  };
3121  const short *p=ncdf.lookupVar(fcNumGroupAmbig.name())->data2short();
3122  numAmbigs.resize(numOfObs_);
3123  for (int i=0; i<numOfObs_; i++)
3124  numAmbigs[i] = p[i];
3126  "::loadObsNumGroupAmbigs(): data loaded successfully from " + ncdf.getFileName());
3127  return true;
3128 };
3129 
3130 
3131 
3132 //
3133 bool SgVgosDb::loadObsNumPhaseAmbigs(const QString &band, QVector<int> &numAmbigs)
3134 {
3135  numAmbigs .clear();
3136  //
3137  if (!bandDataByName_.contains(band))
3138  {
3140  "::loadObsNumPhaseAmbigs(): the band \"" + band + "\" is not registered");
3141  return false;
3142  };
3143  SgVdbVariable &var=bandDataByName_[band].vNumPhaseAmbig_;
3144  if (var.isEmpty())
3145  {
3147  "::loadObsNumPhaseAmbigs(): the vgosDb variable NumPhaseAmbig for the band [" + band + "] is empty");
3148  return false;
3149  };
3150  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3151  ncdf.getData();
3152  //
3153  if (!checkFormat(fcfNumPhaseAmbig, ncdf))
3154  {
3156  "::loadObsNumPhaseAmbigs(): format check failed");
3157  return false;
3158  };
3159  const int *p=ncdf.lookupVar(fcNumPhaseAmbig.name())->data2int();
3160  numAmbigs.resize(numOfObs_);
3161  for (int i=0; i<numOfObs_; i++)
3162  numAmbigs[i] = p[i];
3164  "::loadObsNumPhaseAmbigs(): data loaded successfully from " + ncdf.getFileName());
3165  return true;
3166 };
3167 
3168 
3169 
3170 //
3171 bool SgVgosDb::loadObsCalIonGroup(const QString& band, SgMatrix*& ionCals, SgMatrix*& ionSigmas,
3172  QVector<int> &ionDataFlag)
3173 {
3174  if (!bandDataByName_.contains(band))
3175  {
3177  "::loadObsCalIonGroup(): the band \"" + band + "\" is not registered");
3178  return false;
3179  };
3180  SgVdbVariable &var=bandDataByName_[band].vCal_SlantPathIonoGroup_;
3181  if (var.isEmpty())
3182  {
3184  "::loadObsCalIonGroup(): the vgosDb variable Cal_SlantPathIonoGroup for the band [" + band +
3185  "] is empty");
3186  return false;
3187  };
3188  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3189  ncdf.getData();
3191  {
3193  "::loadObsCalIonGroup(): format check failed");
3194  return false;
3195  };
3196  const double *pVal=ncdf.lookupVar(fcCalIonoGroup .name())->data2double();
3197  const double *pSig=ncdf.lookupVar(fcCalIonoGroupSigma .name())->data2double();
3198  const short *pFlg=ncdf.lookupVar(fcCalIonoGroupDataFlag.name())?
3200  ionCals = new SgMatrix(numOfObs_, 2);
3201  ionSigmas = new SgMatrix(numOfObs_, 2);
3202  ionDataFlag.resize(numOfObs_);
3203  for (int i=0; i<numOfObs_; i++)
3204  {
3205  ionCals->setElement (i, 0, pVal[2*i ]);
3206  ionCals->setElement (i, 1, pVal[2*i + 1]);
3207  ionSigmas->setElement(i, 0, pSig[2*i ]);
3208  ionSigmas->setElement(i, 1, pSig[2*i + 1]);
3209  ionDataFlag[i] = pFlg?pFlg[i]:0;
3210  };
3212  "::loadObsCalIonGroup(): data loaded successfully from " + ncdf.getFileName());
3213  return true;
3214 };
3215 
3216 
3217 
3218 //
3219 // Load of Calibrations:
3220 //
3221 //
3222 bool SgVgosDb::loadStdObsCalibration(SgMatrix*& cals, QString& origin,
3223  const QString& varName, const SgVdbVariable& odbV, const SgVgosDb::FmtChkVar& fc,
3224  const QList<SgVgosDb::FmtChkVar*>& fcf, bool isMandatory)
3225 {
3226  origin = "";
3227  if (odbV.isEmpty())
3228  {
3230  "::loadStdObsCalibration(): the vgosDb variable " + varName + " is empty");
3231  return false;
3232  };
3233  SgNetCdf ncdf(path2RootDir_ + "/" + odbV.getFileName());
3234  ncdf.getData();
3235  if (!checkFormat(fcf, ncdf))
3236  {
3238  "::loadStdObsCalibration(): format check failed");
3239  return false;
3240  };
3241  SgNcdfVariable *nV=ncdf.lookupVar(fc.name());
3242  if (!nV)
3243  {
3245  "::loadStdObsCalibration(): the variable " + fc.name() + " was not found in the file");
3246  return false;
3247  };
3248  int nRow=nV->dimensions().at(0)->getN();
3249  int nCol=nV->dimensions().size()==1?1:nV->dimensions().at(1)->getN();
3250  const double *p=nV->data2double();
3251  cals = new SgMatrix(nRow, nCol);
3252  for (int i=0; i<nRow; i++)
3253  for (int j=0; j<nCol; j++)
3254  cals->setElement(i, j, p[nCol*i + j]);
3255  //
3256  //
3257  SgNcdfVariable *svcV;
3258  if ( (svcV=ncdf.lookupServiceVar(SgNetCdf::svcDataOrigin)) )
3259  {
3260  const char *c=svcV->data2char();
3261  int l=svcV->dimensions().at(0)->getN();
3262  origin = QString::fromLatin1(c, l);
3263  }
3264  else
3266  "::loadStdObsCalibration(): cannot find service variable \"" + SgNetCdf::svcDataOrigin +
3267  "\" in " + ncdf.getFileName());
3268  //
3269  //
3271  "::loadStdObsCalibration(): data loaded successfully from " + ncdf.getFileName());
3272  return true;
3273 };
3274 
3275 
3276 
3277 //
3278 bool SgVgosDb::loadObsCalEarthTide(SgMatrix*& cals, QString &kind)
3279 {
3280  bool isOk;
3281  QString origin;
3282  kind = "";
3283  isOk = loadStdObsCalibration(cals, origin, "Cal-EarthTide",
3285  kind = vCal_EarthTide_.getKind();
3286  return isOk;
3287 };
3288 
3289 
3290 
3291 //
3293 {
3294  QString origin;
3295  return loadStdObsCalibration(cals, origin, "Cal-FeedCorrection",
3297 };
3298 
3299 
3300 
3301 //
3302 bool SgVgosDb::loadObsCalFeedCorr(const QString& band, SgMatrix*& contrib)
3303 {
3304  if (!bandDataByName_.contains(band))
3305  {
3307  "::loadObsCalFeedCorr(): the band \"" + band + "\" is not registered");
3308  return false;
3309  };
3310  SgVdbVariable &var=bandDataByName_[band].vCal_FeedCorrection_;
3311  if (var.isEmpty())
3312  {
3314  "::loadObsCalFeedCorr(): the vgosDb variable Cal_FeedCorrection for the band [" + band +
3315  "] is empty");
3316  return false;
3317  };
3318  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3319  ncdf.getData();
3320  if (!checkFormat(fcfCalFeedCorrection, ncdf))
3321  {
3323  "::loadObsCalFeedCorr(): format check failed");
3324  return false;
3325  };
3326  const double *p=ncdf.lookupVar(fcCalFeedCorrection.name())?
3328  if (!p)
3329  {
3331  "::loadObsCalFeedCorr(): cannot find the variable " + fcCalFeedCorrection.name() + " in the file");
3332  return false;
3333  };
3334  contrib = new SgMatrix(numOfObs_, 2);
3335  for (int i=0; i<numOfObs_; i++)
3336  {
3337  contrib->setElement(i,0, p[2*i ]);
3338  contrib->setElement(i,1, p[2*i + 1]);
3339  };
3341  "::loadObsCalFeedCorr(): data loaded successfully from " + ncdf.getFileName());
3342  return true;
3343 };
3344 
3345 
3346 
3347 //
3348 bool SgVgosDb::loadObsCalHiFyErp(SgMatrix*& calsUt, SgMatrix*& calsXY, QString &kind)
3349 {
3350  kind = "";
3351  if (vCal_HfErp_.isEmpty())
3352  {
3354  "::loadObsCalHiFyErp(): the vgosDb variable Cal_HfErp is empty");
3355  return false;
3356  };
3358  ncdf.getData();
3359  if (!checkFormat(fcfCalHiFyErp, ncdf))
3360  {
3362  "::loadObsCalHiFyErp(): format check failed");
3363  return false;
3364  };
3365  const double *pUt=ncdf.lookupVar(fcCalUt1Ortho.name())->data2double();
3366  const double *pPm=ncdf.lookupVar(fcCalWobOrtho.name())->data2double();
3367  calsUt = new SgMatrix(numOfObs_, 2);
3368  calsXY = new SgMatrix(numOfObs_, 2);
3369  for (int i=0; i<numOfObs_; i++)
3370  {
3371  calsUt->setElement(i,0, pUt[2*i]);
3372  calsUt->setElement(i,1, pUt[2*i + 1]);
3373  calsXY->setElement(i,0, pPm[2*i]);
3374  calsXY->setElement(i,1, pPm[2*i + 1]);
3375  };
3376  kind = vCal_HfErp_.getKind();
3378  "::loadObsCalHiFyErp(): data loaded successfully from " + ncdf.getFileName());
3379  return true;
3380 };
3381 
3382 
3383 
3384 //
3386 {
3387  QString origin;
3388  return loadStdObsCalibration(cals, origin, "Cal-OceanLoad",
3390 };
3391 
3392 
3393 
3394 //
3396 {
3397  QString origin;
3398  return loadStdObsCalibration(cals, origin, "Cal-OceanLoadOld", vCal_OceanLoadOld_, fcCalOceanLoadOld,
3399  fcfCalOceanLoadOld, false);
3400 };
3401 
3402 
3403 
3404 //
3406 {
3407  QString origin;
3408  return loadStdObsCalibration(cals, origin, "Cal-OceanPoleTideLoad", vCal_OceanPoleTideLoad_,
3410 };
3411 
3412 
3413 
3414 //
3415 bool SgVgosDb::loadObsCalPoleTide(SgMatrix*& cals, QString &kind)
3416 {
3417  bool isOk;
3418  QString origin;
3419  kind = "";
3420  isOk = loadStdObsCalibration(cals, origin, "Cal-PoleTide",
3422  kind = vCal_PoleTide_.getKind();
3423  return isOk;
3424 };
3425 
3426 
3427 
3428 //
3430 {
3431  QString origin;
3432  return loadStdObsCalibration(cals, origin, "Cal-PoleTideOldRestore",
3434 };
3435 
3436 
3437 
3438 //
3440 {
3441  QString origin;
3442  return loadStdObsCalibration(cals, origin, "Cal-TiltRemover",
3444 };
3445 
3446 
3447 
3448 //
3450 {
3452  if (var.isEmpty())
3453  {
3455  "::loadObsFractC(): the vgosDb variable FractC is empty");
3456  return false;
3457  };
3458  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3459  ncdf.getData();
3460  if (!checkFormat(fcfFractC, ncdf))
3461  {
3463  "::loadObsFractC(): format check failed");
3464  return false;
3465  };
3466  const double *p=ncdf.lookupVar(fcFractC.name())?
3467  ncdf.lookupVar(fcFractC.name())->data2double():NULL;
3468  if (!p)
3469  {
3471  "::loadObsFractC(): nothing to get");
3472  return false;
3473  }
3474  v = new SgVector(numOfObs_);
3475  for (int i=0; i<numOfObs_; i++)
3476  v->setElement(i, p[i]);
3478  "::loadObsFractC(): data loaded successfully from " + ncdf.getFileName());
3479  return true;
3480 };
3481 
3482 
3483 
3484 //
3485 bool SgVgosDb::loadObsCalUnphase(const QString& band, SgMatrix*& unPhaseCal_1, SgMatrix*& unPhaseCal_2)
3486 {
3487  if (!bandDataByName_.contains(band))
3488  {
3490  "::loadObsCalUnphase(): the band \"" + band + "\" is not registered");
3491  return false;
3492  };
3493  SgVdbVariable &var=bandDataByName_[band].vCal_Unphase_;
3494  if (var.isEmpty())
3495  {
3497  "::loadObsCalUnphase(): the vgosDb variable Cal_Unphase for the band [" + band + "] is empty");
3498  return false;
3499  };
3500  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3501  ncdf.getData();
3502  if (!checkFormat(fcfCalUnphase, ncdf))
3503  {
3505  "::loadObsCalUnphase(): format check failed");
3506  return false;
3507  };
3508  const double *p=ncdf.lookupVar(fcCalUnPhase.name())?
3509  ncdf.lookupVar(fcCalUnPhase.name())->data2double():NULL;
3510  if (!p)
3511  {
3513  "::loadObsCalUnphase(): cannot find the variable " + fcCalUnPhase.name() + " in the file");
3514  return false;
3515  };
3516  unPhaseCal_1 = new SgMatrix(numOfObs_, 2);
3517  unPhaseCal_2 = new SgMatrix(numOfObs_, 2);
3518  for (int i=0; i<numOfObs_; i++)
3519  {
3520  unPhaseCal_1->setElement(i,0, p[4*i ]);
3521  unPhaseCal_2->setElement(i,0, p[4*i + 1]);
3522  unPhaseCal_1->setElement(i,1, p[4*i + 2]);
3523  unPhaseCal_2->setElement(i,1, p[4*i + 3]);
3524  };
3526  "::loadObsCalUnphase(): data loaded successfully from " + ncdf.getFileName());
3527  return true;
3528 };
3529 
3530 
3531 
3532 //
3533 bool SgVgosDb::loadObsCalHiFyLibration(SgMatrix*& cals, QString &kind)
3534 {
3535  bool isOk;
3536  QString origin;
3537  kind = "";
3538  isOk = loadStdObsCalibration(cals, origin, "Cal-HiFreqLibration",
3540  kind = vCal_HfLibration_.getKind();
3541  return isOk;
3542 };
3543 
3544 
3545 
3546 
3547 //
3548 bool SgVgosDb::loadObsCalHiFyLibration(SgMatrix*& calsPm, SgMatrix*& calsUt, QString &kind)
3549 {
3550  kind = "";
3552  {
3554  "::loadObsCalHiFreqLibration(): the vgosDb variable Cal_HiFreqLibration is empty");
3555  return false;
3556  };
3558  ncdf.getData();
3559  if (!checkFormat(fcfCalHiFreqLibration, ncdf))
3560  {
3562  "::loadObsCalHiFreqLibration(): format check failed");
3563  return false;
3564  };
3565  const double *pUt=ncdf.lookupVar(fcCalHiFreqLibrationUt.name())?
3567  const double *pPm=ncdf.lookupVar(fcCalHiFreqLibrationPm.name())?
3569  if (pUt)
3570  calsUt = new SgMatrix(numOfObs_, 2);
3571  if (pPm)
3572  calsPm = new SgMatrix(numOfObs_, 2);
3573  for (int i=0; i<numOfObs_; i++)
3574  {
3575  if (pUt)
3576  {
3577  calsUt->setElement(i,0, pUt[2*i ]);
3578  calsUt->setElement(i,1, pUt[2*i + 1]);
3579  };
3580  if (pPm)
3581  {
3582  calsPm->setElement(i,0, pPm[2*i ]);
3583  calsPm->setElement(i,1, pPm[2*i + 1]);
3584  };
3585  };
3586  kind = vCal_HiFreqLibration_.getKind();
3588  "::loadObsCalHiFreqLibration(): data loaded successfully from " + ncdf.getFileName());
3589  return true;
3590 };
3591 
3592 
3593 
3594 //
3595 bool SgVgosDb::loadObsCalWobble(SgMatrix*& calsXwobble, SgMatrix*& calsYwobble)
3596 {
3597  if (vCal_Wobble_.isEmpty())
3598  {
3600  "::loadObsCalWobble(): the vgosDb variable Cal-Wobble is empty");
3601  return false;
3602  };
3604  ncdf.getData();
3605  if (!checkFormat(fcfCalWobble, ncdf))
3606  {
3608  "::loadObsCalWobble(): format check failed");
3609  return false;
3610  };
3611  const double *pX=ncdf.lookupVar(fcCalXwobble.name())->data2double();
3612  const double *pY=ncdf.lookupVar(fcCalYwobble.name())->data2double();
3613  calsXwobble = new SgMatrix(numOfObs_, 2);
3614  calsYwobble = new SgMatrix(numOfObs_, 2);
3615  for (int i=0; i<numOfObs_; i++)
3616  {
3617  calsXwobble->setElement(i,0, pX[2*i ]);
3618  calsXwobble->setElement(i,1, pX[2*i + 1]);
3619  calsYwobble->setElement(i,0, pY[2*i ]);
3620  calsYwobble->setElement(i,1, pY[2*i + 1]);
3621  };
3623  "::loadObsCalWobble(): data loaded successfully from " + ncdf.getFileName());
3624  return true;
3625 };
3626 
3627 
3628 
3629 //
3631 {
3632  QString origin;
3633  return loadStdObsCalibration(cals, origin, "Cal-Bend",
3634  vCal_Bend_, fcCalBend, fcfCalBend, false);
3635 };
3636 
3637 
3638 
3639 //
3641 {
3642  QString origin;
3643  return loadStdObsCalibration(cals, origin, "Cal-BendSun",
3645 };
3646 
3647 
3648 
3649 //
3651 {
3652  QString origin;
3653  return loadStdObsCalibration(cals, origin, "Cal-BendSunHigher",
3655 };
3656 
3657 
3658 
3659 //
3661 {
3662  QString origin;
3663  return loadStdObsCalibration(cals, origin, "Cal-Parallax",
3665 };
3666 
3667 
3668 
3669 //
3670 //
3671 // Load of Partials:
3672 //
3673 //
3675 {
3676  if (vPart_Bend_.isEmpty())
3677  {
3679  "::loadObsPartBend(): the vgosDb variable Part-Bend is empty");
3680  return false;
3681  };
3683  ncdf.getData();
3684  if (!checkFormat(fcfPart_Bend, ncdf))
3685  {
3687  "::loadObsPartBend(): format check failed");
3688  return false;
3689  };
3690  const double *p=ncdf.lookupVar(fcPartBend.name())->data2double();
3691  partBend = new SgMatrix(numOfObs_, 2);
3692  for (int i=0; i<numOfObs_; i++)
3693  {
3694  partBend->setElement(i, 0, p[2*i ]);
3695  partBend->setElement(i, 1, p[2*i + 1]);
3696  };
3698  "::loadObsPartBend(): data loaded successfully from " + ncdf.getFileName());
3699  return true;
3700 };
3701 
3702 
3703 
3704 //
3706 {
3708  if (var.isEmpty())
3709  {
3711  "::loadObsPartGamma(): the vgosDb variable \"" + var.getStub() + "\" is empty");
3712  return false;
3713  };
3714  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3715  ncdf.getData();
3716  if (!checkFormat(fcfPart_Gamma, ncdf))
3717  {
3719  "::loadObsPartGamma(): format check failed");
3720  return false;
3721  };
3722  const double *p=ncdf.lookupVar(fcPartGamma.name())->data2double();
3723  part = new SgMatrix(numOfObs_, 2);
3724  for (int i=0; i<numOfObs_; i++)
3725  {
3726  part->setElement(i, 0, p[2*i ]);
3727  part->setElement(i, 1, p[2*i + 1]);
3728  };
3730  "::loadObsPartGamma(): data loaded successfully from " + ncdf.getFileName());
3731  return true;
3732 };
3733 
3734 
3735 
3736 //
3738 {
3740  if (var.isEmpty())
3741  {
3743  "::loadObsPartParallax(): the vgosDb variable \"" + var.getStub() + "\" is empty");
3744  return false;
3745  };
3746  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3747  ncdf.getData();
3748  if (!checkFormat(fcfPart_Parallax, ncdf))
3749  {
3751  "::loadObsPartParallax(): format check failed");
3752  return false;
3753  };
3754  const double *p=ncdf.lookupVar(fcPartParallax.name())->data2double();
3755  part = new SgMatrix(numOfObs_, 2);
3756  for (int i=0; i<numOfObs_; i++)
3757  {
3758  part->setElement(i, 0, p[2*i ]);
3759  part->setElement(i, 1, p[2*i + 1]);
3760  };
3762  "::loadObsPartParallax(): data loaded successfully from " + ncdf.getFileName());
3763  return true;
3764 };
3765 
3766 
3767 
3768 //
3769 bool SgVgosDb::loadObsPartPoleTides(SgMatrix*& partX, SgMatrix*& partY, QString& kind)
3770 {
3772  kind = "";
3773  if (var.isEmpty())
3774  {
3776  "::loadObsPartPoleTides(): the vgosDb variable \"" + var.getStub() + "\" is empty");
3777  return false;
3778  };
3779  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3780  ncdf.getData();
3781  if (!checkFormat(fcfPart_PolarTide, ncdf))
3782  {
3784  "::loadObsPartPoleTides(): format check failed");
3785  return false;
3786  };
3787  const double *p=ncdf.lookupVar(fcPartPolarTide.name())->data2double();
3788  partX = new SgMatrix(numOfObs_, 2);
3789  partY = new SgMatrix(numOfObs_, 2);
3790  for (int i=0; i<numOfObs_; i++)
3791  {
3792  partX->setElement(i, 0, p[4*i ]);
3793  partY->setElement(i, 0, p[4*i + 1]);
3794  partX->setElement(i, 1, p[4*i + 2]);
3795  partY->setElement(i, 1, p[4*i + 3]);
3796  };
3797  kind = var.getKind();
3799  "::loadObsPartPoleTides(): data loaded successfully from " + ncdf.getFileName());
3800  return true;
3801 };
3802 
3803 
3804 
3805 //
3806 bool SgVgosDb::loadObsPartEOP(SgMatrix*& dV_dPx, SgMatrix*& dV_dPy, SgMatrix*& dV_dUT1)
3807 {
3808  if (vPart_Erp_.isEmpty())
3809  {
3811  "::loadObsPartEOP(): the vgosDb variable Part-Erp is empty");
3812  return false;
3813  };
3814  SgNetCdf ncdf(path2RootDir_ + "/" + vPart_Erp_.getFileName());
3815  ncdf.getData();
3816  if (!checkFormat(fcfPart_Erp, ncdf))
3817  {
3819  "::loadObsPartEOP(): format check failed");
3820  return false;
3821  };
3822  const double *pPm=ncdf.lookupVar(fcPartWobble.name())->data2double();
3823  const double *pUt=ncdf.lookupVar(fcPartUt1 .name())->data2double();
3824  dV_dPx = new SgMatrix(numOfObs_, 2);
3825  dV_dPy = new SgMatrix(numOfObs_, 2);
3826  dV_dUT1 = new SgMatrix(numOfObs_, 4);
3827  for (int i=0; i<numOfObs_; i++)
3828  {
3829  dV_dPx ->setElement(i, 0, pPm[4*i ]);
3830  dV_dPy ->setElement(i, 0, pPm[4*i + 1]);
3831  dV_dPx ->setElement(i, 1, pPm[4*i + 2]);
3832  dV_dPy ->setElement(i, 1, pPm[4*i + 3]);
3833 
3834  dV_dUT1->setElement(i, 0, pUt[4*i ]);
3835  dV_dUT1->setElement(i, 1, pUt[4*i + 1]);
3836  dV_dUT1->setElement(i, 2, pUt[4*i + 2]);
3837  dV_dUT1->setElement(i, 3, pUt[4*i + 3]);
3838  };
3840  "::loadObsPartEOP(): data loaded successfully from " + ncdf.getFileName());
3841  return true;
3842 };
3843 
3844 
3845 
3846 //
3847 bool SgVgosDb::loadObsPartNut2KXY(SgMatrix*& dV_dCipX, SgMatrix*& dV_dCipY, QString& kind)
3848 {
3849  kind = "";
3851  {
3853  "::loadObsPartNut2KXY(): the vgosDb variable Part-NutationNRO is empty");
3854  return false;
3855  };
3857  ncdf.getData();
3858  if (!checkFormat(fcfPart_NutationNro, ncdf))
3859  {
3861  "::loadObsPartNut2KXY(): format check failed");
3862  return false;
3863  };
3864  const double *p=ncdf.lookupVar(fcPartNutationNro.name())?
3865  ncdf.lookupVar(fcPartNutationNro.name())->data2double():NULL;
3866  if (!p)
3867  {
3869  "::loadObsPartNut2KXY(): cannot find variable " + fcPartNutationNro.name() + " in the file");
3870  return false;
3871  };
3872  dV_dCipX = new SgMatrix(numOfObs_, 2);
3873  dV_dCipY = new SgMatrix(numOfObs_, 2);
3874  for (int i=0; i<numOfObs_; i++)
3875  {
3876  dV_dCipX->setElement(i, 0, p[2*2*i ]);
3877  dV_dCipY->setElement(i, 0, p[2*2*i + 1]);
3878  dV_dCipX->setElement(i, 1, p[2*2*i + 2]);
3879  dV_dCipY->setElement(i, 1, p[2*2*i + 3]);
3880  };
3881  kind = vPart_NutationNro_.getKind();
3883  "::loadObsPartNut2KXY(): data loaded successfully from " + ncdf.getFileName());
3884  return true;
3885 };
3886 
3887 
3888 
3889 //
3891 {
3892  if (vPart_RaDec_.isEmpty())
3893  {
3895  "::loadObsPartRaDec(): the vgosDb variable Part-RaDec is empty");
3896  return false;
3897  };
3899  ncdf.getData();
3900  if (!checkFormat(fcfPart_RaDec, ncdf))
3901  {
3903  "::loadObsPartRaDec(): format check failed");
3904  return false;
3905  };
3906  const double *p=ncdf.lookupVar(fcPartRaDec.name())->data2double();
3907  dV_dRA = new SgMatrix(numOfObs_, 2);
3908  dV_dDN = new SgMatrix(numOfObs_, 2);
3909  for (int i=0; i<numOfObs_; i++)
3910  {
3911  dV_dRA->setElement(i, 0, p[2*2*i ]);
3912  dV_dDN->setElement(i, 0, p[2*2*i + 1]);
3913  dV_dRA->setElement(i, 1, p[2*2*i + 2]);
3914  dV_dDN->setElement(i, 1, p[2*2*i + 3]);
3915  };
3917  "::loadObsPartRaDec(): data loaded successfully from " + ncdf.getFileName());
3918  return true;
3919 };
3920 
3921 
3922 
3923 //
3924 bool SgVgosDb::loadObsPartXYZ(SgMatrix*& dTau_dR_1, SgMatrix*& dRat_dR_1)
3925 {
3926  if (vPart_Xyz_.isEmpty())
3927  {
3929  "::loadObsPartXYZ(): the vgosDb variable Part-XYZ is empty");
3930  return false;
3931  };
3932  SgNetCdf ncdf(path2RootDir_ + "/" + vPart_Xyz_.getFileName());
3933  ncdf.getData();
3934  if (!checkFormat(fcfPart_Xyz, ncdf))
3935  {
3937  "::loadObsPartXYZ(): format check failed");
3938  return false;
3939  };
3940  const double *p=ncdf.lookupVar(fcPartXyz.name())->data2double();
3941  dTau_dR_1 = new SgMatrix(numOfObs_, 3);
3942  dRat_dR_1 = new SgMatrix(numOfObs_, 3);
3943  for (int i=0; i<numOfObs_; i++)
3944  {
3945  dTau_dR_1->setElement(i, 0, p[2*3*i ]);
3946  dTau_dR_1->setElement(i, 1, p[2*3*i + 1]);
3947  dTau_dR_1->setElement(i, 2, p[2*3*i + 2]);
3948  dRat_dR_1->setElement(i, 0, p[2*3*i + 3 ]);
3949  dRat_dR_1->setElement(i, 1, p[2*3*i + 3 + 1]);
3950  dRat_dR_1->setElement(i, 2, p[2*3*i + 3 + 2]);
3951  };
3953  "::loadObsPartXYZ(): data loaded successfully from " + ncdf.getFileName());
3954  return true;
3955 };
3956 
3957 
3958 
3959 //
3960 bool SgVgosDb::loadObsUserCorrections(int idx, SgMatrix* m, QString& name)
3961 {
3962  if (idx<0 || obsUserCorrections_.size()-1<idx)
3963  {
3965  "::loadObsUserCorrections(): index " + QString("").setNum(idx) + " out of range");
3966  return false;
3967  };
3968  const SgVdbVariable *var=obsUserCorrections_.at(idx);
3969  if (!var)
3970  {
3972  "::loadObsUserCorrections(): the var #" + QString("").setNum(idx) + " is NULL");
3973  return false;
3974  };
3975  if (var->isEmpty())
3976  {
3978  "::loadObsUserCorrections(): the vgosDb variable " + var->getStub() + " is empty");
3979  return false;
3980  };
3981  //
3982  SgNetCdf ncdf(path2RootDir_ + "/" + var->getFileName());
3983  ncdf.getData();
3984  if (!checkFormat(fcfUserCorrections, ncdf))
3985  {
3987  "::loadObsUserCorrections(): format check failed");
3988  return false;
3989  };
3990  const double *p=ncdf.lookupVar(fcUserCorrections.name())->data2double();
3991  for (int i=0; i<numOfObs_; i++)
3992  {
3993  m->setElement(i, idx, p[i]);
3994  };
3995  name = var->getFileName4Output();
3997  "::loadObsUserCorrections(): data loaded successfully from " + ncdf.getFileName());
3998  return true;
3999 };
4000 
4001 
4002 
4003 
4004 /*=====================================================================================================*/
4005 
4006 
4007 
4008 
4009 
4010 /*=====================================================================================================*/
4011 //
4012 // Constants:
4013 //
4014 const QList<int>
4017 
4018 // Variable descriptions:
4020  fcBaseline ("Baseline", NC_CHAR, true, QList<int>() << SD_NumObs << 2 << 8,
4021  "BASELINE", "Ref and rem site names"),
4022  fcSource ("Source", NC_CHAR, true, QList<int>() << SD_NumObs << 8,
4023  "STAR ID ", "Radio source name"),
4024  fcObs2Baseline ("Obs2Baseline", NC_SHORT, true, QList<int>() << SD_NumObs << 2,
4025  "", "Cross reference from observation to baseline"),
4026  fcObs2Scan ("Obs2Scan", NC_INT, true, QList<int>() << SD_NumObs,
4027  "", "Cross reference from observation to scan"),
4028  fcCrossRefSourceList("CrossRefSourceList",NC_CHAR, true, QList<int>() << SD_NumSrc << 8,
4029  "", "A list of sources names"),
4030  fcScan2Source ("Scan2Source", NC_INT, true, QList<int>() << SD_NumScans,
4031  "", "Cross reference scan to source"),
4032  fcNumScansPerStation("NumScansPerStation",NC_INT, true, QList<int>() << SD_NumStn,
4033  "", "Number of scans per station."),
4035  ("CrossRefStationList",NC_CHAR, true, QList<int>() << SD_NumStn << 8,
4036  "", "Site names in alphabetical order"),
4037  fcStation2Scan ("Station2Scan", NC_INT, true, QList<int>() << SD_Any << SD_NumStn,
4038  "", "Cross reference station-scan to schedule-scan"),
4039  fcScan2Station ("Scan2Station", NC_INT, true, QList<int>() << SD_NumScans << SD_NumStn,
4040  "", "Cross reference scans to station"),
4041  fcSBDelay ("SBDelay", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4042  "SB DELAY", "Single band delay", "second", "?"),
4043  fcSBDelaySig ("SBDelaySig", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4044  "SB SIGMA", "Single band delay error", "second", "?"),
4045  fcGroupDelay ("GroupDelay", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4046  "DEL OBSV", "Delay observable produced by fringing", "second", "?"),
4047  fcGroupDelaySig ("GroupDelaySig", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4048  "DELSIGMA", "Delay Measurement Sigma", "second", "?"),
4049  fcGroupRate ("GroupRate", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4050  "RAT OBSV", "Rate Observable", "second/second", "?"),
4051  fcGroupRateSig ("GroupRateSig", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4052  "RATSIGMA", "Rate Measurement Sigma", "second/second", "?"),
4053  fcPhase ("Phase", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4054  "TOTPHASE", "Total phase", "radian", "?"),
4055  fcPhaseSig ("PhaseSig", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4056  "", "Total phase sigma", "radian", "?"),
4057  fcGroupDelayFull ("GroupDelayFull", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4058  "", "Delay Observable with ambiguities resolved and added.", "second", "?"),
4059  fcPhaseDelayFull ("PhaseDelayFull", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4060  "", "Phase Delay \"Observable\" with ambiguities resolved and added.", "second", "?"),
4061  fcPhaseDelaySigFull ("PhaseDelaySigFull", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4062  "", "Phase Delay Sigma", "second", "?"),
4063  fcRefFreq ("RefFreq", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4064  "REF FREQ", "Frequency to which phase is referenced", "MHz", "?"),
4065  fcFreqRateIon ("FreqRateIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4066  "", "Effective Group Rate Ionospheric Frequency", "MHz", "?"),
4067  fcFreqPhaseIon ("FreqPhaseIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4068  "PHIONFRQ", "Effective Phase Delay Ionospheric Frequency", "MHz", "?"),
4069  fcFreqGroupIon ("FreqGroupIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4070  "GRIONFRQ", "Effective Group Delay Ionospheric Frequency", "MHz", "?"),
4071  fcFreqRateIonEqWgts ("FreqRateIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4072  "", "Effective Group Rate Ionospheric Frequency. All channels equal wt.", "MHz", "?"),
4073  fcFreqPhaseIonEqWgts("FreqPhaseIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4074  "", "Effective Phase Delay Ionospheric Frequency. All channels equal wt.", "MHz", "?"),
4075  fcFreqGroupIonEqWgts("FreqGroupIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4076  "", "Effective Group Delay Ionospheric Frequency. All channels equal wt.", "MHz", "?"),
4077  fcDtec ("diffTec", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4078  "", "Difference of the total electron contents", "TEC units"),
4079  fcDtecStdErr ("diffTecStdDev", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4080  "", "Standard deviation of dTec estimation", "TEC units"),
4081  fcAmbigSize ("AmbigSize", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4082  "GPDLAMBG", "Group delay ambiguity spacing", "second", "?"),
4083  fcQualityCode ("QualityCode", NC_CHAR, true, QList<int>() << SD_NumObs,
4084  "QUALCODE", "FRNGE quality index 0 --> 9", "", "?"),
4085  fcCorrelation ("Correlation", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4086  "COHERCOR", "Corr coeff (0 --> 1)", "", "?"),
4087  fcSNR ("SNR", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4088  "SNRATIO ", "Signal to noise ratio", "", "?"),
4089  fcDelayDataFlag ("DelayDataFlag", NC_SHORT, true, QList<int>() << SD_NumObs ),
4090  fcDataFlag ("DataFlag", NC_SHORT, false,QList<int>() << SD_NumObs,
4091  "", "0=OK, -1=Missing, -2=bad,-3=sigma small, -4=sigma big", "", "?"),
4092  fcDelayTheoretical ("DelayTheoretical", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4093  "CONSNDEL", "Consensus theoretical delay", "second"),
4094  fcRateTheoretical ("RateTheoretical", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4095  "CONSNRAT", "Consensus theoretical rate", "second/second"),
4096  fcUVFperAsec ("UVFperAsec", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4097  "UVF/ASEC", "U V in FR per arcsec from CALC", "", "?"),
4098  //
4099  // begin of channel info:
4100  //
4101  fcChannelID ("ChannelID", NC_CHAR, false,QList<int>() << SD_NumObs << SD_2NumChans,
4102  "CHAN ID ", "One-letter Fourfit channel ID...", "", "?"),
4103  fcPolarization ("Polarization", NC_CHAR, false,QList<int>() << SD_NumObs << SD_NumChans
4104  << 4,
4105  "POLARIZ ", "Polarization per sta/chan R/L...", "", "?"),
4106  fcNumChannels ("NumChannels", NC_SHORT, true, QList<int>() << SD_NumObs,
4107  "#CHANELS", "No. of U-L pairs in integration.", "", "?"),
4108  fcNumAp ("NumAp", NC_SHORT, false,QList<int>() << SD_NumObs << SD_NumChans
4109  << 2,
4110  "NO.OF AP", "# of AP by sideband and channel.", "", "?"),
4111  fcNumAccum ("NumAccum", NC_SHORT, false,QList<int>() << SD_NumObs << 32,
4112  "VFRQ#APS", "No. of accum. periods in Channel (S2)", "", "?"),
4113  fcERRORATE ("ERRORATE", NC_SHORT, false,QList<int>() << SD_NumObs << SD_NumChans
4114  << 2 << 2,
4115  "ERRORATE", "Log err rate by sta, sb, channel", "", "?"),
4116  fcBITSAMPL ("BITSAMPL", NC_SHORT, false,QList<int>() << SD_NumObs,
4117  "BITSAMPL", "Number of bits per sample.......", "", "?"),
4118  fcBBCIndex ("BBCIndex", NC_SHORT, false,QList<int>() << SD_NumObs << SD_NumChans
4119  << 2,
4120  "BBC IND ", "Physical BBC number by channel..", "", "?"),
4121  fcINDEXNUM ("INDEXNUM", NC_SHORT, false,QList<int>() << SD_NumObs << SD_NumChans
4122  << 2,
4123  "INDEXNUM", "Corel index numbers by sb,freq..", "", "?"),
4124  fcChannelFreq ("ChannelFreq", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans,
4125  "RFREQ ", "RF freq by channel (MHz)........", "MHz", "?"),
4126  fcVIRTFREQ ("VIRTFREQ", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans,
4127  "VIRTFREQ", "Sky Frequencies", "MHz", "?"),
4128 
4129  fcLOFreq ("LOFreq", NC_DOUBLE, false,QList<int>() << SD_NumObs << SD_NumChans
4130  << 2,
4131  "LO FREQ ", "LO frequencies per cha/sta MHz", "MHz", "?"),
4132  fcChanAmpPhase ("ChanAmpPhase", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans
4133  << 2,
4134  "AMPBYFRQ", "Amp(0-1), phs(-180to180) by chan", "", "?"),
4135  fcVFRQAM ("VFRQAM", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans,
4136  "VFRQAM", "Normalized channel amplitude", "", "?"),
4137  fcVFRQPH ("VFRQPH", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans,
4138  "VFRQPH", "Channel Phase (degrees)", "", "?"),
4139 
4140 
4141 
4142  fcNumSamples ("NumSamples", NC_DOUBLE, false,QList<int>() << SD_NumObs << SD_NumChans
4143  << 2,
4144  "#SAMPLES", "# of samples by sideband and cha", "", "?"),
4145  fcSampleRate ("SampleRate", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4146  "SAMPLRAT", "Sample rate (Hz)", "Hz", "?"),
4147  //
4148  // begin of phase cal info:
4149  //
4150  fcPhaseCalRate ("PhaseCalRate", NC_DOUBLE, true, dim_Obs_x_Stn,
4151  "PHASECAL", "PC rate by sta ( us per s)......", "", "?"),
4152  fcPhaseCalFreq ("PhaseCalFreq", NC_SHORT, false, dim_Obs_x_Chan_x_Stn,
4153  "", "PhaseCalFreq by channel, Station", "", "?"),
4154  fcPhaseCalOffset ("PhaseCalOffset", NC_SHORT, false, dim_Obs_x_Chan_x_Stn,
4155  "PHCALOFF", "Phase cal offset (-18000/18000).", "centidegrees", "?"),
4156  fcPhaseCalPhase ("PhaseCalPhase", NC_SHORT, true, dim_Obs_x_Chan_x_Stn,
4157  "", "PhaseCalPhase by channel, Station(-18000 to 18000)", "centidegrees", "?"),
4158  fcPhaseCalAmp ("PhaseCalAmp", NC_SHORT, true, dim_Obs_x_Chan_x_Stn,
4159  "", "PhaseCalAmp by channel, Station", "", "?"),
4160  // phase cal data from S2:
4161  fcPhaseCalFreqS2 ("PhaseCalFreqS2", NC_DOUBLE, false, dim_Obs_x_Chan_x_Stn,
4162  "VFRQPCFR", "Phase cal tone Frequencies", "", "?"),
4163  fcPhaseCalPhaseS2 ("PhaseCalPhaseS2", NC_DOUBLE, true, dim_Obs_x_Chan_x_Stn,
4164  "VFRQPCPH", "PhaseCalPhase by channel, Station(-18000 to 18000)", "centidegrees", "?"),
4165  fcPhaseCalAmpS2 ("PhaseCalAmpS2", NC_DOUBLE, true, dim_Obs_x_Chan_x_Stn,
4166  "VFRQPCAM", "Phase cal tone Amplitudes", "", "?"),
4167  //
4168  // begin of correlator info:
4169  //
4170  fcFOURFFIL ("FOURFFIL", NC_CHAR, false,QList<int>() << SD_NumObs << 16,
4171  "FOURFFIL", "Fourfit output filename", "", "?"),
4172  fcFRNGERR ("FRNGERR", NC_CHAR, false,QList<int>() << SD_NumObs,
4173  "FRNGERR ", "Fourfit error flag blank=OK.....", "", "?"),
4174  fcFRNGERR4S2 ("FRNGERR", NC_SHORT, false,QList<int>() << SD_NumObs,
4175  "FRNGERR ", "Fourfit error flag blank=OK.", "", "?"),
4176  fcFRQGROUP ("FRQGROUP", NC_CHAR, true, QList<int>() << SD_NumObs << 2,
4177  "FRQGROUP", "Frequency group code............", "", "?"),
4178  fcCORELVER ("CORELVER", NC_SHORT, false,QList<int>() << SD_NumObs,
4179  "CORELVER", "Correlator software version numb", "", "?"),
4180  fcFOURFVER ("FOURFVER", NC_SHORT, false,QList<int>() << SD_NumObs << 2,
4181  "FOURFVER", "Fourfit version number..........", "", "?"),
4182  fcDBEDITVE ("DBEDITVE", NC_SHORT, false,QList<int>() << SD_NumObs << 3,
4183  "DBEDITVE", "Dbedit revision date YYYY MM DD", "", "?"),
4184  fcREFCLKER ("REFCLKER", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4185  "REFCLKER", "Ref sta clock epoch microsec....", "", "?"),
4186  fcStartOffset ("StartOffset", NC_SHORT, false,QList<int>() << SD_NumObs,
4187  "STARTOFF", "Offset nominal start time (sec).", "", "?"),
4188  fcDELTAEPO ("DELTAEPO", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4189  "DELTAEPO", "Offset from center of scan (sec)", "", "?"),
4190  fcStopOffset ("StopOffset", NC_SHORT, false,QList<int>() << SD_NumObs,
4191  "STOP OFF", "Offset nominal stop time (sec)..", "", "?"),
4192  fcHopsRevNum ("HopsRevisionNumber",NC_SHORT, false,QList<int>() << SD_NumObs,
4193  "", "HOPS software revision number", "", "?"),
4194  fcURVR ("URVR", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4195  "URVR ", "Rate derivatives mHz per asec...", "", "?"),
4196  fcIDELAY ("IDELAY", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4197  "IDELAY ", "Corel instrumental delay (sec)..", "", "?"),
4198  fcSTARELEV ("STARELEV", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4199  "STARELEV", "Elev angles calc by COREL.......", "", "?"),
4200  fcZDELAY ("ZDELAY", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4201  "ZDELAY ", "Corel zenith atmos. delay (sec).", "", "?"),
4202  fcSRCHPAR ("SRCHPAR", NC_DOUBLE, true, QList<int>() << SD_NumObs << 6,
4203  "SRCHPAR ", "FRNGE/Fourfit search parameters.", "", "?"),
4204  //
4205  fcCORBASCD ("CORBASCD", NC_CHAR, false,QList<int>() << SD_NumObs << 2,
4206  "CORBASCD", "Correlator baseline code (2 ch).", "", "?"),
4207  fcTapeCode ("TapeCode", NC_CHAR, false,QList<int>() << SD_NumObs << 6,
4208  "TAPQCODE", "Tape quality code...............", "", "?"),
4209  fcSBRESID ("SBRESID", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4210  "SBRESID ", "Single band delay residual......", "", "?"),
4211  fcRATRESID ("RATRESID", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4212  "RATRESID", "Rate resid (sec per sec)........", "", "?"),
4213  fcEffectiveDuration ("EffectiveDuration", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4214  "EFF.DURA", "Effective run duration sec......", "", "?"),
4215  fcStartSec ("StartSec", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4216  "STARTSEC", "Start time in sec past hour.....", "", "?"),
4217  fcStopSec ("StopSec", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4218  "STOP SEC", "Stop time in sec past hour.....", "", "?"),
4219  fcDISCARD ("DISCARD", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4220  "DISCARD ", "Percent data discarded by FRNGE.", "", "?"),
4221  fcQBFACTOR ("QBFACTOR", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4222  "QBFACTOR", "Measure of uniformity of data...", "", "?"),
4223  fcGeocResidPhase ("GeocResidPhase", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4224  "GCRESPHS", "Resid phs corrected to cen of E.", "", "?"),
4225  fcGeocSBD ("GeocSBD", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4226  "GC SBD ", "Tot geocenter sbd delay (sec)...", "", "?"),
4227  fcGeocRate ("GeocRate", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4228  "GC RATE ", "Tot geocenter delay rate (s/s)..", "", "?"),
4229  fcGeocMBD ("GeocMBD", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4230  "GC MBD ", "Tot geocenter group delay (sec).", "second", "?"),
4231  fcProbFalseDetection("ProbFalseDetection",NC_DOUBLE, true, QList<int>() << SD_NumObs,
4232  "FALSEDET", "Prob of false det from FRNGE....", "", "?"),
4233  fcABASRATE ("ABASRATE", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4234  "ABASRATE", "Corel bas/apr delay rate (s/s)..", "", "?"),
4235  fcABASDEL ("ABASDEL", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4236  "ABASDEL ", "Corel bas/apr delay (sec).......", "", "?"),
4237  fcABASACCE ("ABASACCE", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4238  "ABASACCE", "Corel bas/apr accel (1/sec**2)..", "", "?"),
4239  fcGeocPhase ("GeocPhase", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4240  "GC PHASE", "Tot phase ref to cen of Earth...", "", "?"),
4241  fcINCOHAMP ("INCOHAMP", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4242  "INCOHAMP", "Fr. amp from incoh int of chan..", "", "?"),
4243  fcINCOH2 ("INCOH2", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4244  "INCOH2 ", "Incoh amp from FRNGE plot segs..", "", "?"),
4245  fcDELRESID ("DELRESID", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4246  "DELRESID", "Delay residual (sec)............", "", "?"),
4247 
4248  fcUTCCorr ("UTCCorr", NC_SHORT, false,QList<int>() << SD_NumObs << 6,
4249  "CORR UTC", "UTC time tag of correlation.....", "", "?"),
4250  fcUTCMidObs ("UTCMidObs", NC_SHORT, true, QList<int>() << SD_NumObs << 6,
4251  "UTCM TAG", "UTC at central epoch YMDHMS.....", "", "?"),
4252  fcFOURFUTC ("FOURFUTC", NC_SHORT, false,QList<int>() << SD_NumObs << 6,
4253  "FOURFUTC", "Fourfit processing time YMDHMS..", "", "?"),
4254  fcUTCScan ("UTCScan", NC_SHORT, false,QList<int>() << SD_NumObs << 6,
4255  "SCAN UTC", "Nominal scan time YMDHMS........", "", "?"),
4256  fcTAPEID ("TAPEID", NC_CHAR, false,QList<int>() << SD_NumObs << 2 << 8,
4257  "TAPEID ", "Raw data tape ID for ref and rem", "", "?"),
4258  fcCORCLOCK ("CORCLOCK", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2 << 2,
4259  "CORCLOCK", "Clock offset(sec)/rate(sec/sec).", "", "?"),
4260  //
4261  // FmtChkVar(const char* name, nc_type type, bool isMandatory, const QList<int> l,
4262  // const QString& attLCode="", const QString& attDefinition="", const QString& attUnits="",
4263  // const QString& attBand="")
4264  // extension from GSI(/Mk3?):
4265  fcRECSETUP ("RECSETUP", NC_SHORT, false,QList<int>() << SD_NumObs << 3,
4266  "RECSETUP", "SAMP rate(KHz),FRAMES/PP,PP/AP..", "", "?"),
4267  fcVLB1FILE ("VLB1FILE", NC_CHAR, false,QList<int>() << SD_NumObs << 6,
4268  "VLB1FILE", "Correlator file name ...........", "", "?"),
4269  fcDLYEPOp1 ("DLYEPO+1", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4270  "DLYEPO+1", "Phase delay at epoch+1 usec ....", "", "?"),
4271  fcDLYEPOCH ("DLYEPOCH", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4272  "DLYEPOCH", "Phase delay at epoch usec ....", "", "?"),
4273  fcDLYEPOm1 ("DLYEPO-1", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4274  "DLYEPO-1", "Phase delay at epoch-1 usec ....", "", "?"),
4275  fcAPCLOFST ("APCLOFST", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4276  "APCLOFST", "Apriori clock offset microsec ..", "", "?"),
4277  fcTOTPCENT ("TOTPCENT", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4278  "TOTPCENT", "TOT phase at central epoch .....", "", "?"),
4279  fcRATOBSVM ("RATOBSVM", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4280  "RATOBSVM", "OBS rate at central epoch ......", "", "?"),
4281  fcUTCVLB2 ("UTCVLB2", NC_SHORT, false,QList<int>() << SD_NumObs << 6,
4282  "VLB2 UTC", "UTC of frnge PROC YMDHMS........", "", "?"),
4283  fcDELOBSVM ("DELOBSVM", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4284  "DELOBSVM", "OBS delay at central epoch uS ..", "", "?"),
4285  //
4286  // S2 artefacts:
4287  fcUTCErr ("UTCErr", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4288  "UTC ERR ", "A priori UTC error site 1 (sec)", "", "?"),
4289  fcVFDWELL ("VFDWELL", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4290  "VFDWELL ", "Dwell time in each channel (sec)", "", "?"),
4291  fcS2EFFREQ ("S2EFFREQ", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4292  "S2EFFREQ", "Effective group freq for ion.", "", "?"),
4293  fcS2REFREQ ("S2REFREQ", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4294  "S2REFREQ", "Effective frequency for rate", "", "?"),
4295  fcS2PHEFRQ ("S2PHEFRQ", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4296  "S2PHEFRQ", "Effective phase frequency", "", "?"),
4297  fcTotalFringeErr ("TotalFringeErr", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4298  "TPHA ERR", "Total fringe phase error (deg)", "", "?"),
4299  fcDURATION ("DURATION", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4300  "TPHA ERR", "Scan duration (sec).", "", "?"),
4301  fcTimeSinceStart ("TimeSinceStart", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4302  "STR TIME", "Interval since start time (sec).", "", "?"),
4303 
4304 
4305 
4306  //
4307  // end of correlator info
4308  //
4309  fcCalEarthTide ("Cal-EarthTide", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4310  "ETD CONT", "Earth tide contributions def."),
4311  fcCalFeedCorrection ("Cal-FeedCorrection",NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4312  "FEED.COR", "Feedhorn corr. in CORFIL scheme"),
4313  fcCalUt1Ortho ("Cal-UT1Ortho", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4314  "UT1ORTHO", "ORTHO_EOP Tidal UT1 contribution"),
4315  fcCalWobOrtho ("Cal-WobOrtho", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4316  "WOBORTHO", "ORTHO_EOP tidal wobble contribtn"),
4317  fcCalOceanLoad ("Cal-OceanLoad", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4318  "OCE CONT", "Obs dependent ocean loading"),
4319  fcCalOceanLoadOld ("Cal-OceanLoadOld", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4320  "OCE_OLD ", "Add to Cal-OceanLoad to get Cal10 OceanLoading"),
4321  fcCalOceanPoleTideLoad ("Cal-OceanPoleTideLoad",
4322  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4323  "OPTLCONT", "Ocean Pole Tide Load Contribution"),
4324  fcCalPoleTide ("Cal-PoleTide", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4325  "PTD CONT", "Pole tide contributions def."),
4326  fcCalPoleTideOldRestore("Cal-PoleTideOldRestore",
4327  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4328  "PTOLDCON", "Old Pole Tide Restorer Contrib."),
4329  fcCalTiltRemover ("Cal-TiltRemover", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4330  "TILTRMVR", "Axis Tilt Contribution Remover"),
4331  fcCalUnPhase ("Cal-UnPhase", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2 << 2,
4332  "UNPHASCL", "UnPhaseCal effect - group&rate"),
4333  fcCalHfLibration ("Cal-HiFreqLibrationPM",
4334  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4335  "", ""),
4337  ("Cal-HiFreqLibrationPM",
4338  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4339  "WOBLIBRA", "Hi Freq Wobble Libration Contribution"),
4341  ("Cal-HiFreqLibrationUT1",
4342  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4343  "UT1LIBRA", "Hi Freq UT1 Libration Contribution"),
4344  fcCalXwobble ("Cal-Xwobble", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4345  "WOBXCONT", "X Wobble contribution definition"),
4346  fcCalYwobble ("Cal-Ywobble", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4347  "WOBYCONT", "Y Wobble contribution definition"),
4348  fcCalBend ("Cal-Bend", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4349  "CON CONT", "Consensus bending contrib. (sec)"),
4350  fcCalBendSun ("Cal-BendSun", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4351  "SUN CONT", "Consensus bending contrib. (sec)"),
4352  fcCalBendSunHigher ("Cal-BendSunHigher", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4353  "SUN2CONT", "High order bending contrib.(sec)"),
4354  fcCalParallax ("Cal-Parallax", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4355  "PLX1PSEC", "Parallax partial/contr 1 parsec"),
4356 
4357  //
4358  //
4359  fcPartBend ("Part-Bend", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4360  "BENDPART", "Grav. bend. partial w.r.t. Gamma"),
4361  fcPartWobble ("Part-Wobble", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 2,
4362  "WOB PART", "Wobble partial derivatives def."),
4363  fcPartUt1 ("Part-UT1", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 2,
4364  "UT1 PART", "UT1 partial derivatives def."),
4365  fcPartGamma ("Part-Gamma", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4366  "CONSPART", "Consensus partial w.r.t. Gamma"),
4367  fcPartNutationNro ("Part-NutationNRO", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2 << 2,
4368  "NUT06XYP", "2000/2006 Nut/Prec X,Y Partials"),
4369  fcPartRaDec ("Part-RaDec", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 2,
4370  "STR PART", "Star partial derivatives def."),
4371  fcPartXyz ("Part-XYZ", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 3,
4372  "SIT PART", "Site partials: dtau/dr_1=-dtau/dr_2"),
4373  fcPartParallax ("Part-Parallax", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4374  "PLX PART", "Parallax partial deriv. def."),
4375  fcPartPolarTide ("Part-PoleTide", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 2,
4376  "PTDXYPAR", "Pole Tide Partials w.r.t. X & Y"),
4377  fcFractC ("FractC", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4378  "CT SITE1", "Coordinate time at site 1", "day"),
4379  //
4380  fcUserCorrections ("Corrections", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4381  "", "")
4382  ;
4383 
4384 
4385 
4386 
4387 // netCDF files:
4407  << &fcFreqGroupIon,
4422  //
4423  // channel info (what we expect to read):
4424  //
4425  //
4429  fcfChannelInfoInptVLBA // == fcfChannelInfoInptMk3
4432  fcfChannelInfoInptCRL // == fcfChannelInfoInptMk3
4435  fcfChannelInfoInptGSI // == fcfChannelInfoInptMk3
4441  << &fcNumAccum << &fcVIRTFREQ,
4445  fcfChannelInfoInptHaystack // == fcfChannelInfoInptMk4
4448  fcfChannelInfoInptDifx // == fcfChannelInfoInptMk4
4451  //
4452  // what to do with these:
4453  // cannot find the variable "NumAp" in the file 2002/02OCT09XG/Observables/ChannelInfo_bX.nc
4454  // cannot find the variable "NumAp" in the file 2002/02SEP11XG/Observables/ChannelInfo_bX.nc
4455  //
4456  // short NumAccum(NumObs, Dim000032) ;
4457  // NumAccum:LCODE = "VFRQ#APS" ;
4458  // NumAccum:CreateTime = "2002/12/09 14:10:54 " ;
4459  // NumAccum:Band = "X" ;
4460  // NumAccum:Definition = "No. of accum. periods in Channel (S2)" ;
4461  //
4462  //
4463  // Channel info for MK4 type of correlator output:
4467  << &fcSampleRate,
4468  // Channel info for KOMB type of correlator output:
4471  //??<< &fcERRORATE
4472  ,
4473  //
4474  // ------------------------------------------------------------------
4475  //
4478 
4483  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk3
4486  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk3
4489  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk3
4498  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk4
4501  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk4
4503  //
4504  // ------------------------------------------------------------------
4505  //
4506  // correlator info (what we expect to read):
4509  << &fcStartSec << &fcStopSec,
4510  fcfCorrInfoInptVLBA //==fcfCorrInfoMk3
4512  << &fcStartSec << &fcStopSec,
4515  << &fcStartSec << &fcStopSec,
4516  fcfCorrInfoInptGSI // ==fcfCorrInfoInptCRL
4518  << &fcStartSec << &fcStopSec,
4521  << &fcStartSec << &fcStopSec,
4522  fcfCorrInfoInptHaystack //==fcfCorrInfoMk4
4524  << &fcStartSec << &fcStopSec,
4525  fcfCorrInfoInptDifx //==fcfCorrInfoMk4
4527  << &fcStartSec << &fcStopSec,
4528  //
4529  // Info for MK4 type of correlator:
4531  << &fcFOURFFIL << &fcFRNGERR << &fcFRQGROUP
4533  << &fcURVR << &fcIDELAY << &fcSTARELEV << &fcZDELAY << &fcSRCHPAR << &fcCORBASCD << &fcStopOffset
4538  << &fcTAPEID << &fcCORCLOCK,
4539  //
4540  // Info for KOMB type of correlator:
4548  //
4549  // S2:
4554 
4555 // << &fcFRNGERR4S2
4556 
4557 
4558  ,
4559 
4560 
4561  //
4562  //
4588 
4602  ;
4603 
4604 
4605 /*=====================================================================================================*/
4606 
@ SD_NumChans
Definition: SgIoDriver.h:55
@ SD_NumStn
Definition: SgIoDriver.h:58
@ SD_2NumChans
Definition: SgIoDriver.h:59
@ SD_NumObs
Definition: SgIoDriver.h:53
@ SD_NumScans
Definition: SgIoDriver.h:54
@ SD_Any
Definition: SgIoDriver.h:62
@ SD_NumSrc
Definition: SgIoDriver.h:57
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
SgVgosDb::FmtChkVar fcGeocResidPhase("GeocResidPhase", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "GCRESPHS", "Resid phs corrected to cen of E.", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfGroupRate
SgVgosDb::FmtChkVar fcVFRQAM("VFRQAM", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< SD_NumChans, "VFRQAM", "Normalized channel amplitude", "", "?")
SgVgosDb::FmtChkVar fcDelayTheoretical("DelayTheoretical", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "CONSNDEL", "Consensus theoretical delay", "second")
SgVgosDb::FmtChkVar fcVFDWELL("VFDWELL", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "VFDWELL ", "Dwell time in each channel (sec)", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoInptS2
SgVgosDb::FmtChkVar fcFOURFVER("FOURFVER", NC_SHORT, false, QList< int >()<< SD_NumObs<< 2, "FOURFVER", "Fourfit version number..........", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoInptCRL
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoMk3
SgVgosDb::FmtChkVar fcNumAccum("NumAccum", NC_SHORT, false, QList< int >()<< SD_NumObs<< 32, "VFRQ#APS", "No. of accum. periods in Channel (S2)", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCalHiFreqLibration
SgVgosDb::FmtChkVar fcTimeSinceStart("TimeSinceStart", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "STR TIME", "Interval since start time (sec).", "", "?")
SgVgosDb::FmtChkVar fcPhaseCalFreq("PhaseCalFreq", NC_SHORT, false, dim_Obs_x_Chan_x_Stn, "", "PhaseCalFreq by channel, Station", "", "?")
SgVgosDb::FmtChkVar fcSource("Source", NC_CHAR, true, QList< int >()<< SD_NumObs<< 8, "STAR ID ", "Radio source name")
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoInptDifx
SgVgosDb::FmtChkVar fcDISCARD("DISCARD", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "DISCARD ", "Percent data discarded by FRNGE.", "", "?")
SgVgosDb::FmtChkVar fcCalBend("Cal-Bend", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "CON CONT", "Consensus bending contrib. (sec)")
SgVgosDb::FmtChkVar fcPhase("Phase", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "TOTPHASE", "Total phase", "radian", "?")
SgVgosDb::FmtChkVar fcINDEXNUM("INDEXNUM", NC_SHORT, false, QList< int >()<< SD_NumObs<< SD_NumChans<< 2, "INDEXNUM", "Corel index numbers by sb,freq..", "", "?")
SgVgosDb::FmtChkVar fcSTARELEV("STARELEV", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "STARELEV", "Elev angles calc by COREL.......", "", "?")
SgVgosDb::FmtChkVar fcNumSamples("NumSamples", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< SD_NumChans<< 2, "#SAMPLES", "# of samples by sideband and cha", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoCRL
SgVgosDb::FmtChkVar fcABASACCE("ABASACCE", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "ABASACCE", "Corel bas/apr accel (1/sec**2)..", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCalFeedCorrection
SgVgosDb::FmtChkVar fcFRNGERR("FRNGERR", NC_CHAR, false, QList< int >()<< SD_NumObs, "FRNGERR ", "Fourfit error flag blank=OK.....", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoInptS2
QList< SgVgosDb::FmtChkVar * > fcfObsCrossRef
SgVgosDb::FmtChkVar fcURVR("URVR", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "URVR ", "Rate derivatives mHz per asec...", "", "?")
SgVgosDb::FmtChkVar fcFreqRateIonEqWgts("FreqRateIono", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "", "Effective Group Rate Ionospheric Frequency. All channels equal wt.", "MHz", "?")
SgVgosDb::FmtChkVar fcS2REFREQ("S2REFREQ", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "S2REFREQ", "Effective frequency for rate", "", "?")
SgVgosDb::FmtChkVar fcPartPolarTide("Part-PoleTide", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2<< 2, "PTDXYPAR", "Pole Tide Partials w.r.t. X & Y")
QList< SgVgosDb::FmtChkVar * > fcfPart_Parallax
SgVgosDb::FmtChkVar fcPartXyz("Part-XYZ", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2<< 3, "SIT PART", "Site partials: dtau/dr_1=-dtau/dr_2")
SgVgosDb::FmtChkVar fcFreqRateIon("FreqRateIono", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "", "Effective Group Rate Ionospheric Frequency", "MHz", "?")
SgVgosDb::FmtChkVar fcFreqPhaseIonEqWgts("FreqPhaseIono", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "", "Effective Phase Delay Ionospheric Frequency. All channels equal wt.", "MHz", "?")
SgVgosDb::FmtChkVar fcCalOceanPoleTideLoad("Cal-OceanPoleTideLoad", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "OPTLCONT", "Ocean Pole Tide Load Contribution")
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoInptMk3
SgVgosDb::FmtChkVar fcChannelID("ChannelID", NC_CHAR, false, QList< int >()<< SD_NumObs<< SD_2NumChans, "CHAN ID ", "One-letter Fourfit channel ID...", "", "?")
SgVgosDb::FmtChkVar fcSBDelaySig("SBDelaySig", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "SB SIGMA", "Single band delay error", "second", "?")
QList< SgVgosDb::FmtChkVar * > fcfPart_Erp
SgVgosDb::FmtChkVar fcCalUt1Ortho("Cal-UT1Ortho", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "UT1ORTHO", "ORTHO_EOP Tidal UT1 contribution")
QList< SgVgosDb::FmtChkVar * > fcfCalOceanLoadOld
SgVgosDb::FmtChkVar fcUTCErr("UTCErr", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "UTC ERR ", "A priori UTC error site 1 (sec)", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfBaseline
SgVgosDb::FmtChkVar fcPhaseCalPhase("PhaseCalPhase", NC_SHORT, true, dim_Obs_x_Chan_x_Stn, "", "PhaseCalPhase by channel, Station(-18000 to 18000)", "centidegrees", "?")
SgVgosDb::FmtChkVar fcDLYEPOm1("DLYEPO-1", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "DLYEPO-1", "Phase delay at epoch-1 usec ....", "", "?")
SgVgosDb::FmtChkVar fcStopSec("StopSec", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "STOP SEC", "Stop time in sec past hour.....", "", "?")
SgVgosDb::FmtChkVar fcVFRQPH("VFRQPH", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< SD_NumChans, "VFRQPH", "Channel Phase (degrees)", "", "?")
SgVgosDb::FmtChkVar fcCalBendSun("Cal-BendSun", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "SUN CONT", "Consensus bending contrib. (sec)")
SgVgosDb::FmtChkVar fcHopsRevNum("HopsRevisionNumber", NC_SHORT, false, QList< int >()<< SD_NumObs, "", "HOPS software revision number", "", "?")
SgVgosDb::FmtChkVar fcSRCHPAR("SRCHPAR", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 6, "SRCHPAR ", "FRNGE/Fourfit search parameters.", "", "?")
SgVgosDb::FmtChkVar fcGeocMBD("GeocMBD", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "GC MBD ", "Tot geocenter group delay (sec).", "second", "?")
SgVgosDb::FmtChkVar fcObs2Baseline("Obs2Baseline", NC_SHORT, true, QList< int >()<< SD_NumObs<< 2, "", "Cross reference from observation to baseline")
SgVgosDb::FmtChkVar fcPolarization("Polarization", NC_CHAR, false, QList< int >()<< SD_NumObs<< SD_NumChans<< 4, "POLARIZ ", "Polarization per sta/chan R/L...", "", "?")
SgVgosDb::FmtChkVar fcFRNGERR4S2("FRNGERR", NC_SHORT, false, QList< int >()<< SD_NumObs, "FRNGERR ", "Fourfit error flag blank=OK.", "", "?")
SgVgosDb::FmtChkVar fcDtecStdErr("diffTecStdDev", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "", "Standard deviation of dTec estimation", "TEC units")
QList< SgVgosDb::FmtChkVar * > fcfDelayDataFlag
QList< SgVgosDb::FmtChkVar * > fcfSNR
SgVgosDb::FmtChkVar fcCorrelation("Correlation", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "COHERCOR", "Corr coeff (0 --> 1)", "", "?")
SgVgosDb::FmtChkVar fcFractC("FractC", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "CT SITE1", "Coordinate time at site 1", "day")
SgVgosDb::FmtChkVar fcCalYwobble("Cal-Ywobble", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "WOBYCONT", "Y Wobble contribution definition")
SgVgosDb::FmtChkVar fcPartGamma("Part-Gamma", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "CONSPART", "Consensus partial w.r.t. Gamma")
QList< SgVgosDb::FmtChkVar * > fcfUVFperAsec
QList< SgVgosDb::FmtChkVar * > fcfAmbigSize
SgVgosDb::FmtChkVar fcTapeCode("TapeCode", NC_CHAR, false, QList< int >()<< SD_NumObs<< 6, "TAPQCODE", "Tape quality code...............", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPart_RaDec
SgVgosDb::FmtChkVar fcPhaseCalFreqS2("PhaseCalFreqS2", NC_DOUBLE, false, dim_Obs_x_Chan_x_Stn, "VFRQPCFR", "Phase cal tone Frequencies", "", "?")
SgVgosDb::FmtChkVar fcQBFACTOR("QBFACTOR", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "QBFACTOR", "Measure of uniformity of data...", "", "?")
SgVgosDb::FmtChkVar fcRefFreq("RefFreq", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "REF FREQ", "Frequency to which phase is referenced", "MHz", "?")
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoInptMk3
SgVgosDb::FmtChkVar fcBBCIndex("BBCIndex", NC_SHORT, false, QList< int >()<< SD_NumObs<< SD_NumChans<< 2, "BBC IND ", "Physical BBC number by channel..", "", "?")
SgVgosDb::FmtChkVar fcS2EFFREQ("S2EFFREQ", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "S2EFFREQ", "Effective group freq for ion.", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfFractC
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoInptCRL
SgVgosDb::FmtChkVar fcFOURFFIL("FOURFFIL", NC_CHAR, false, QList< int >()<< SD_NumObs<< 16, "FOURFFIL", "Fourfit output filename", "", "?")
SgVgosDb::FmtChkVar fcUTCCorr("UTCCorr", NC_SHORT, false, QList< int >()<< SD_NumObs<< 6, "CORR UTC", "UTC time tag of correlation.....", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoS2
SgVgosDb::FmtChkVar fcABASRATE("ABASRATE", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "ABASRATE", "Corel bas/apr delay rate (s/s)..", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPart_Gamma
SgVgosDb::FmtChkVar fcPartUt1("Part-UT1", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2<< 2, "UT1 PART", "UT1 partial derivatives def.")
SgVgosDb::FmtChkVar fcNumAp("NumAp", NC_SHORT, false, QList< int >()<< SD_NumObs<< SD_NumChans<< 2, "NO.OF AP", "# of AP by sideband and channel.", "", "?")
SgVgosDb::FmtChkVar fcCORBASCD("CORBASCD", NC_CHAR, false, QList< int >()<< SD_NumObs<< 2, "CORBASCD", "Correlator baseline code (2 ch).", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCalParallax
SgVgosDb::FmtChkVar fcPhaseDelaySigFull("PhaseDelaySigFull", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "", "Phase Delay Sigma", "second", "?")
SgVgosDb::FmtChkVar fcCalPoleTide("Cal-PoleTide", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "PTD CONT", "Pole tide contributions def.")
SgVgosDb::FmtChkVar fcERRORATE("ERRORATE", NC_SHORT, false, QList< int >()<< SD_NumObs<< SD_NumChans<< 2<< 2, "ERRORATE", "Log err rate by sta, sb, channel", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoKomb
SgVgosDb::FmtChkVar fcProbFalseDetection("ProbFalseDetection", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "FALSEDET", "Prob of false det from FRNGE....", "", "?")
SgVgosDb::FmtChkVar fcCalOceanLoadOld("Cal-OceanLoadOld", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "OCE_OLD ", "Add to Cal-OceanLoad to get Cal10 OceanLoading")
SgVgosDb::FmtChkVar fcChanAmpPhase("ChanAmpPhase", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< SD_NumChans<< 2, "AMPBYFRQ", "Amp(0-1), phs(-180to180) by chan", "", "?")
SgVgosDb::FmtChkVar fcGeocRate("GeocRate", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "GC RATE ", "Tot geocenter delay rate (s/s)..", "", "?")
SgVgosDb::FmtChkVar fcFRQGROUP("FRQGROUP", NC_CHAR, true, QList< int >()<< SD_NumObs<< 2, "FRQGROUP", "Frequency group code............", "", "?")
SgVgosDb::FmtChkVar fcCalEarthTide("Cal-EarthTide", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "ETD CONT", "Earth tide contributions def.")
SgVgosDb::FmtChkVar fcCalUnPhase("Cal-UnPhase", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2<< 2, "UNPHASCL", "UnPhaseCal effect - group&rate")
SgVgosDb::FmtChkVar fcCalTiltRemover("Cal-TiltRemover", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "TILTRMVR", "Axis Tilt Contribution Remover")
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoInptVLBA
SgVgosDb::FmtChkVar fcCalWobOrtho("Cal-WobOrtho", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "WOBORTHO", "ORTHO_EOP tidal wobble contribtn")
QList< SgVgosDb::FmtChkVar * > fcfCalBendSun
const QList< int > dim_Obs_x_Stn(QList< int >()<< SD_NumObs<< 2)
SgVgosDb::FmtChkVar fcGeocPhase("GeocPhase", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "GC PHASE", "Tot phase ref to cen of Earth...", "", "?")
SgVgosDb::FmtChkVar fcTOTPCENT("TOTPCENT", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "TOTPCENT", "TOT phase at central epoch .....", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfRateTheoretical
SgVgosDb::FmtChkVar fcGeocSBD("GeocSBD", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "GC SBD ", "Tot geocenter sbd delay (sec)...", "", "?")
SgVgosDb::FmtChkVar fcRATRESID("RATRESID", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "RATRESID", "Rate resid (sec per sec)........", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoHaystack
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoMk4
SgVgosDb::FmtChkVar fcGroupRateSig("GroupRateSig", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "RATSIGMA", "Rate Measurement Sigma", "second/second", "?")
SgVgosDb::FmtChkVar fcBITSAMPL("BITSAMPL", NC_SHORT, false, QList< int >()<< SD_NumObs, "BITSAMPL", "Number of bits per sample.......", "", "?")
SgVgosDb::FmtChkVar fcLOFreq("LOFreq", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< SD_NumChans<< 2, "LO FREQ ", "LO frequencies per cha/sta MHz", "MHz", "?")
SgVgosDb::FmtChkVar fcVLB1FILE("VLB1FILE", NC_CHAR, false, QList< int >()<< SD_NumObs<< 6, "VLB1FILE", "Correlator file name ...........", "", "?")
SgVgosDb::FmtChkVar fcPhaseCalOffset("PhaseCalOffset", NC_SHORT, false, dim_Obs_x_Chan_x_Stn, "PHCALOFF", "Phase cal offset (-18000/18000).", "centidegrees", "?")
SgVgosDb::FmtChkVar fcPartWobble("Part-Wobble", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2<< 2, "WOB PART", "Wobble partial derivatives def.")
QList< SgVgosDb::FmtChkVar * > fcfCalBendSunHigher
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoInptMk4
SgVgosDb::FmtChkVar fcUTCMidObs("UTCMidObs", NC_SHORT, true, QList< int >()<< SD_NumObs<< 6, "UTCM TAG", "UTC at central epoch YMDHMS.....", "", "?")
SgVgosDb::FmtChkVar fcCalBendSunHigher("Cal-BendSunHigher", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "SUN2CONT", "High order bending contrib.(sec)")
QList< SgVgosDb::FmtChkVar * > fcfCalOceanLoad
SgVgosDb::FmtChkVar fcStartSec("StartSec", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "STARTSEC", "Start time in sec past hour.....", "", "?")
SgVgosDb::FmtChkVar fcStartOffset("StartOffset", NC_SHORT, false, QList< int >()<< SD_NumObs, "STARTOFF", "Offset nominal start time (sec).", "", "?")
SgVgosDb::FmtChkVar fcINCOHAMP("INCOHAMP", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "INCOHAMP", "Fr. amp from incoh int of chan..", "", "?")
SgVgosDb::FmtChkVar fcGroupDelaySig("GroupDelaySig", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "DELSIGMA", "Delay Measurement Sigma", "second", "?")
SgVgosDb::FmtChkVar fcUTCScan("UTCScan", NC_SHORT, false, QList< int >()<< SD_NumObs<< 6, "SCAN UTC", "Nominal scan time YMDHMS........", "", "?")
SgVgosDb::FmtChkVar fcCalHiFreqLibrationPm("Cal-HiFreqLibrationPM", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "WOBLIBRA", "Hi Freq Wobble Libration Contribution")
SgVgosDb::FmtChkVar fcFreqGroupIon("FreqGroupIono", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "GRIONFRQ", "Effective Group Delay Ionospheric Frequency", "MHz", "?")
QList< SgVgosDb::FmtChkVar * > fcfGroupDelay
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoInptMk4
SgVgosDb::FmtChkVar fcTAPEID("TAPEID", NC_CHAR, false, QList< int >()<< SD_NumObs<< 2<< 8, "TAPEID ", "Raw data tape ID for ref and rem", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfRefFreq
SgVgosDb::FmtChkVar fcDELOBSVM("DELOBSVM", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "DELOBSVM", "OBS delay at central epoch uS ..", "", "?")
SgVgosDb::FmtChkVar fcScan2Station("Scan2Station", NC_INT, true, QList< int >()<< SD_NumScans<< SD_NumStn, "", "Cross reference scans to station")
QList< SgVgosDb::FmtChkVar * > fcfCalBend
SgVgosDb::FmtChkVar fcSampleRate("SampleRate", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "SAMPLRAT", "Sample rate (Hz)", "Hz", "?")
QList< SgVgosDb::FmtChkVar * > fcfPhase
QList< SgVgosDb::FmtChkVar * > fcfCalHiFyErp
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoMk4
SgVgosDb::FmtChkVar fcABASDEL("ABASDEL", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "ABASDEL ", "Corel bas/apr delay (sec).......", "", "?")
SgVgosDb::FmtChkVar fcRateTheoretical("RateTheoretical", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "CONSNRAT", "Consensus theoretical rate", "second/second")
SgVgosDb::FmtChkVar fcCORELVER("CORELVER", NC_SHORT, false, QList< int >()<< SD_NumObs, "CORELVER", "Correlator software version numb", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPart_PolarTide
SgVgosDb::FmtChkVar fcChannelFreq("ChannelFreq", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< SD_NumChans, "RFREQ ", "RF freq by channel (MHz)........", "MHz", "?")
SgVgosDb::FmtChkVar fcDBEDITVE("DBEDITVE", NC_SHORT, false, QList< int >()<< SD_NumObs<< 3, "DBEDITVE", "Dbedit revision date YYYY MM DD", "", "?")
SgVgosDb::FmtChkVar fcIDELAY("IDELAY", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "IDELAY ", "Corel instrumental delay (sec)..", "", "?")
SgVgosDb::FmtChkVar fcCalPoleTideOldRestore("Cal-PoleTideOldRestore", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "PTOLDCON", "Old Pole Tide Restorer Contrib.")
QList< SgVgosDb::FmtChkVar * > fcfCalHfLibration
SgVgosDb::FmtChkVar fcDataFlag("DataFlag", NC_SHORT, false, QList< int >()<< SD_NumObs, "", "0=OK, -1=Missing, -2=bad,-3=sigma small, -4=sigma big", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPhaseDelayFull
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoInptHaystack
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoInptDifx
SgVgosDb::FmtChkVar fcUVFperAsec("UVFperAsec", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "UVF/ASEC", "U V in FR per arcsec from CALC", "", "?")
SgVgosDb::FmtChkVar fcBaseline("Baseline", NC_CHAR, true, QList< int >()<< SD_NumObs<< 2<< 8, "BASELINE", "Ref and rem site names")
SgVgosDb::FmtChkVar fcVIRTFREQ("VIRTFREQ", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< SD_NumChans, "VIRTFREQ", "Sky Frequencies", "MHz", "?")
SgVgosDb::FmtChkVar fcCalFeedCorrection("Cal-FeedCorrection", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "FEED.COR", "Feedhorn corr. in CORFIL scheme")
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoInptHaystack
SgVgosDb::FmtChkVar fcPhaseCalPhaseS2("PhaseCalPhaseS2", NC_DOUBLE, true, dim_Obs_x_Chan_x_Stn, "VFRQPCPH", "PhaseCalPhase by channel, Station(-18000 to 18000)", "centidegrees", "?")
SgVgosDb::FmtChkVar fcPartParallax("Part-Parallax", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "PLX PART", "Parallax partial deriv. def.")
SgVgosDb::FmtChkVar fcDLYEPOCH("DLYEPOCH", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "DLYEPOCH", "Phase delay at epoch usec ....", "", "?")
SgVgosDb::FmtChkVar fcGroupRate("GroupRate", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "RAT OBSV", "Rate Observable", "second/second", "?")
SgVgosDb::FmtChkVar fcSBRESID("SBRESID", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "SBRESID ", "Single band delay residual......", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoInptVLBA
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoInptGSI
SgVgosDb::FmtChkVar fcPhaseCalAmp("PhaseCalAmp", NC_SHORT, true, dim_Obs_x_Chan_x_Stn, "", "PhaseCalAmp by channel, Station", "", "?")
SgVgosDb::FmtChkVar fcCalParallax("Cal-Parallax", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "PLX1PSEC", "Parallax partial/contr 1 parsec")
SgVgosDb::FmtChkVar fcFreqPhaseIon("FreqPhaseIono", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "PHIONFRQ", "Effective Phase Delay Ionospheric Frequency", "MHz", "?")
SgVgosDb::FmtChkVar fcRATOBSVM("RATOBSVM", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "RATOBSVM", "OBS rate at central epoch ......", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfQualityCode
QList< SgVgosDb::FmtChkVar * > fcfGroupDelayFull
SgVgosDb::FmtChkVar fcNumChannels("NumChannels", NC_SHORT, true, QList< int >()<< SD_NumObs, "#CHANELS", "No. of U-L pairs in integration.", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCalPoleTide
SgVgosDb::FmtChkVar fcDELRESID("DELRESID", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "DELRESID", "Delay residual (sec)............", "", "?")
SgVgosDb::FmtChkVar fcPartNutationNro("Part-NutationNRO", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2<< 2, "NUT06XYP", "2000/2006 Nut/Prec X,Y Partials")
QList< SgVgosDb::FmtChkVar * > fcfSBDelay
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoMk4
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoDifx
QList< SgVgosDb::FmtChkVar * > fcfCalTiltRemover
SgVgosDb::FmtChkVar fcS2PHEFRQ("S2PHEFRQ", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "S2PHEFRQ", "Effective phase frequency", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfEffFreq
QList< SgVgosDb::FmtChkVar * > fcfDelayTheoretical
QList< SgVgosDb::FmtChkVar * > fcfStationCrossRef
SgVgosDb::FmtChkVar fcCrossRefStationList("CrossRefStationList", NC_CHAR, true, QList< int >()<< SD_NumStn<< 8, "", "Site names in alphabetical order")
SgVgosDb::FmtChkVar fcDELTAEPO("DELTAEPO", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "DELTAEPO", "Offset from center of scan (sec)", "", "?")
const QList< int > dim_Obs_x_Chan_x_Stn(QList< int >()<< SD_NumObs<< SD_NumChans<< 2)
SgVgosDb::FmtChkVar fcStopOffset("StopOffset", NC_SHORT, false, QList< int >()<< SD_NumObs, "STOP OFF", "Offset nominal stop time (sec)..", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfo
SgVgosDb::FmtChkVar fcUTCVLB2("UTCVLB2", NC_SHORT, false, QList< int >()<< SD_NumObs<< 6, "VLB2 UTC", "UTC of frnge PROC YMDHMS........", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoKomb
SgVgosDb::FmtChkVar fcScan2Source("Scan2Source", NC_INT, true, QList< int >()<< SD_NumScans, "", "Cross reference scan to source")
SgVgosDb::FmtChkVar fcREFCLKER("REFCLKER", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "REFCLKER", "Ref sta clock epoch microsec....", "", "?")
SgVgosDb::FmtChkVar fcSBDelay("SBDelay", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "SB DELAY", "Single band delay", "second", "?")
SgVgosDb::FmtChkVar fcDtec("diffTec", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "", "Difference of the total electron contents", "TEC units")
SgVgosDb::FmtChkVar fcCalHfLibration("Cal-HiFreqLibrationPM", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "", "")
SgVgosDb::FmtChkVar fcCalXwobble("Cal-Xwobble", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "WOBXCONT", "X Wobble contribution definition")
SgVgosDb::FmtChkVar fcCalOceanLoad("Cal-OceanLoad", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "OCE CONT", "Obs dependent ocean loading")
SgVgosDb::FmtChkVar fcPartBend("Part-Bend", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "BENDPART", "Grav. bend. partial w.r.t. Gamma")
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoVLBA
SgVgosDb::FmtChkVar fcEffectiveDuration("EffectiveDuration", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "EFF.DURA", "Effective run duration sec......", "", "?")
SgVgosDb::FmtChkVar fcPartRaDec("Part-RaDec", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2<< 2, "STR PART", "Star partial derivatives def.")
SgVgosDb::FmtChkVar fcFreqGroupIonEqWgts("FreqGroupIono", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "", "Effective Group Delay Ionospheric Frequency. All channels equal wt.", "MHz", "?")
QList< SgVgosDb::FmtChkVar * > fcfPart_NutationNro
SgVgosDb::FmtChkVar fcGroupDelayFull("GroupDelayFull", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "", "Delay Observable with ambiguities resolved and added.", "second", "?")
QList< SgVgosDb::FmtChkVar * > fcfCalEarthTide
SgVgosDb::FmtChkVar fcQualityCode("QualityCode", NC_CHAR, true, QList< int >()<< SD_NumObs, "QUALCODE", "FRNGE quality index 0 --> 9", "", "?")
SgVgosDb::FmtChkVar fcPhaseCalAmpS2("PhaseCalAmpS2", NC_DOUBLE, true, dim_Obs_x_Chan_x_Stn, "VFRQPCAM", "Phase cal tone Amplitudes", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCalOceanPoleTideLoad
QList< SgVgosDb::FmtChkVar * > fcfSource
SgVgosDb::FmtChkVar fcCORCLOCK("CORCLOCK", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2<< 2, "CORCLOCK", "Clock offset(sec)/rate(sec/sec).", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCalUnphase
SgVgosDb::FmtChkVar fcRECSETUP("RECSETUP", NC_SHORT, false, QList< int >()<< SD_NumObs<< 3, "RECSETUP", "SAMP rate(KHz),FRAMES/PP,PP/AP..", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfSourceCrossRef
SgVgosDb::FmtChkVar fcPhaseSig("PhaseSig", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "", "Total phase sigma", "radian", "?")
SgVgosDb::FmtChkVar fcZDELAY("ZDELAY", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "ZDELAY ", "Corel zenith atmos. delay (sec).", "", "?")
SgVgosDb::FmtChkVar fcDLYEPOp1("DLYEPO+1", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "DLYEPO+1", "Phase delay at epoch+1 usec ....", "", "?")
SgVgosDb::FmtChkVar fcTotalFringeErr("TotalFringeErr", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "TPHA ERR", "Total fringe phase error (deg)", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfPart_Bend
SgVgosDb::FmtChkVar fcINCOH2("INCOH2", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "INCOH2 ", "Incoh amp from FRNGE plot segs..", "", "?")
SgVgosDb::FmtChkVar fcFOURFUTC("FOURFUTC", NC_SHORT, false, QList< int >()<< SD_NumObs<< 6, "FOURFUTC", "Fourfit processing time YMDHMS..", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfCalPoleTideOldRestore
SgVgosDb::FmtChkVar fcAPCLOFST("APCLOFST", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "APCLOFST", "Apriori clock offset microsec ..", "", "?")
SgVgosDb::FmtChkVar fcCrossRefSourceList("CrossRefSourceList", NC_CHAR, true, QList< int >()<< SD_NumSrc<< 8, "", "A list of sources names")
QList< SgVgosDb::FmtChkVar * > fcfUserCorrections
QList< SgVgosDb::FmtChkVar * > fcfDataFlag
SgVgosDb::FmtChkVar fcGroupDelay("GroupDelay", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "DEL OBSV", "Delay observable produced by fringing", "second", "?")
SgVgosDb::FmtChkVar fcObs2Scan("Obs2Scan", NC_INT, true, QList< int >()<< SD_NumObs, "", "Cross reference from observation to scan")
SgVgosDb::FmtChkVar fcStation2Scan("Station2Scan", NC_INT, true, QList< int >()<< SD_Any<< SD_NumStn, "", "Cross reference station-scan to schedule-scan")
SgVgosDb::FmtChkVar fcDURATION("DURATION", NC_DOUBLE, false, QList< int >()<< SD_NumObs, "TPHA ERR", "Scan duration (sec).", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfDTec
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoGSI
QList< SgVgosDb::FmtChkVar * > fcfEffFreqEqWgts
SgVgosDb::FmtChkVar fcAmbigSize("AmbigSize", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "GPDLAMBG", "Group delay ambiguity spacing", "second", "?")
QList< SgVgosDb::FmtChkVar * > fcfCorrelation
SgVgosDb::FmtChkVar fcPhaseCalRate("PhaseCalRate", NC_DOUBLE, true, dim_Obs_x_Stn, "PHASECAL", "PC rate by sta ( us per s)......", "", "?")
SgVgosDb::FmtChkVar fcPhaseDelayFull("PhaseDelayFull", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "", "Phase Delay \"Observable\" with ambiguities resolved and added.", "second", "?")
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoInptGSI
SgVgosDb::FmtChkVar fcSNR("SNR", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "SNRATIO ", "Signal to noise ratio", "", "?")
SgVgosDb::FmtChkVar fcCalHiFreqLibrationUt("Cal-HiFreqLibrationUT1", NC_DOUBLE, false, QList< int >()<< SD_NumObs<< 2, "UT1LIBRA", "Hi Freq UT1 Libration Contribution")
SgVgosDb::FmtChkVar fcNumScansPerStation("NumScansPerStation", NC_INT, true, QList< int >()<< SD_NumStn, "", "Number of scans per station.")
SgVgosDb::FmtChkVar fcDelayDataFlag("DelayDataFlag", NC_SHORT, true, QList< int >()<< SD_NumObs)
SgVgosDb::FmtChkVar fcUserCorrections("Corrections", NC_DOUBLE, true, QList< int >()<< SD_NumObs, "", "")
QList< SgVgosDb::FmtChkVar * > fcfCalWobble
QList< SgVgosDb::FmtChkVar * > fcfPart_Xyz
SgVgosDb::FmtChkVar fcPhaseFlag("PhaseFlag", NC_SHORT, false, QList< int >()<< SD_NumObs, "PHSUFLAG", "")
QList< SgVgosDb::FmtChkVar * > fcfNumGroupAmbig
Definition: SgVgosDb.cpp:2669
QList< SgVgosDb::FmtChkVar * > fcfCalSlantPathIonoGroup
Definition: SgVgosDb.cpp:2657
SgVgosDb::FmtChkVar fcSecond("Second", NC_DOUBLE, true, QList< int >()<< SD_Any, "SEC TAG ", "Seconds part of UTC TAG.........", "second")
QList< SgVgosDb::FmtChkVar * > * fcfEdit
Definition: SgVgosDb.cpp:2663
SgVgosDb::FmtChkVar fcYmdhm("YMDHM", NC_SHORT, true, QList< int >()<< SD_Any<< 5, "UTC TAG ", "Epoch UTC YMDHM.................")
QList< SgVgosDb::FmtChkVar * > fcfNumPhaseAmbig
Definition: SgVgosDb.cpp:2671
QList< SgVgosDb::FmtChkVar * > fcfNumGroupAmbigE
Definition: SgVgosDb.cpp:2670
SgVgosDb::FmtChkVar fcRateFlag("RateFlag", NC_SHORT, true, QList< int >()<< SD_NumObs, "RATUFLAG", "Delay rate unweight flag........")
SgVgosDb::FmtChkVar fcNumGroupAmbig("NumGroupAmbig", NC_SHORT, true, QList< int >()<< SD_NumObs, "# AMBIG ", "Number of group delay ambiguities", "", "?")
SgVgosDb::FmtChkVar fcCalIonoGroupSigma("Cal-SlantPathIonoGroupSigma", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "IONRMS ", "Ion correction to sigma. sec", "second", "?")
QList< SgVgosDb::FmtChkVar * > fcfTimeUTC
Definition: SgVgosDb.cpp:2655
QList< SgVgosDb::FmtChkVar * > fcfUserSup
Definition: SgVgosDb.cpp:2667
SgVgosDb::FmtChkVar fcNumPhaseAmbig("NumPhaseAmbig", NC_INT, true, QList< int >()<< SD_NumObs, "#PAMBIG ", "Number of phase delay ambiguities", "", "?")
SgVgosDb::FmtChkVar fcDelayFlag("DelayFlag", NC_SHORT, true, QList< int >()<< SD_NumObs, "DELUFLAG", "Delay unweight flag")
SgVgosDb::FmtChkVar fcCalIonoGroupDataFlag("Cal-SlantPathIonoGroupDataFlag", NC_SHORT, false, QList< int >()<< SD_NumObs, "", "0=OK, -1=Missing, -2=bad", "", "?")
SgVgosDb::FmtChkVar fcNumGroupSubAmbig("NumGroupSubAmbig", NC_SHORT, false, QList< int >()<< SD_NumObs, "N/A ", "Number of group delay subambiguities (test purposes)", "", "?")
SgVgosDb::FmtChkVar fcCalIonoGroup("Cal-SlantPathIonoGroup", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "ION CORR", "Ion correction. Add to theo. sec", "second", "?")
SgVgosDb::FmtChkVar fcUserSup("UserSup", NC_SHORT, false, QList< int >()<< SD_NumObs, "UACSUP ", "User action for suppression")
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_NCDF
Definition: SgLogger.h:66
Definition: SgMJD.h:59
void setElement(unsigned int i, unsigned int j, double d)
Definition: SgMatrix.h:402
nc_type getTypeOfData() const
Definition: SgNetCdf.h:222
const char * data2char() const
Definition: SgNetCdf.cpp:459
const int * data2int() const
Definition: SgNetCdf.cpp:503
const short * data2short() const
Definition: SgNetCdf.cpp:481
const QList< SgNcdfDimension * > & dimensions() const
Definition: SgNetCdf.h:247
const double * data2double() const
Definition: SgNetCdf.cpp:525
void setFileName(const QString &)
Definition: SgNetCdf.h:505
SgNcdfVariable * lookupVar(const QString &name) const
Definition: SgNetCdf.h:395
void reset()
Definition: SgNetCdf.cpp:1031
static const QString svcDataOrigin
Definition: SgNetCdf.h:334
static const QString svcProgram
Definition: SgNetCdf.h:331
const QString & getFileName() const
Definition: SgNetCdf.h:497
SgNcdfVariable * lookupServiceVar(const QString &name) const
Definition: SgNetCdf.h:391
bool getData()
Definition: SgNetCdf.cpp:1053
bool isEmpty() const
Definition: SgVgosDb.cpp:159
const QString & getKind() const
Definition: SgVgosDb.h:94
const QString & getStub() const
Definition: SgVgosDb.h:93
const QString & getFileName() const
Definition: SgVgosDb.h:100
const QString & getFileName4Output() const
Definition: SgVgosDb.h:101
void setElement(unsigned int i, double d)
Definition: SgVector.h:348
const QString & getSoftwareName() const
Definition: SgVersion.h:254
bool parseString(const QString &str)
Definition: SgVersion.cpp:140
const QList< int > & dims() const
Definition: SgVgosDb.h:217
const QString & name() const
Definition: SgVgosDb.h:213
nc_type typeOfData() const
Definition: SgVgosDb.h:214
bool loadObsSNR(const QString &band, SgVector *&snrs)
bool loadObsCrossRefs(QVector< int > &obs2Scan)
SgVdbVariable vDiffTec_
Definition: SgVgosDb.h:1473
SgVdbVariable vCal_EarthTide_
Definition: SgVgosDb.h:1478
bool loadObsPhaseCalInfoMk4(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 loadObsAmbigSpacing(const QString &band, SgVector *&)
bool loadObsChannelInfoMk3(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 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 *&)
static const QString className()
Definition: SgVgosDb.cpp:251
bool loadObsCalTiltRmvr(SgMatrix *&cals)
SgVdbVariable vCal_Wobble_
Definition: SgVgosDb.h:1488
SgVdbVariable vPart_Erp_
Definition: SgVgosDb.h:1509
bool loadObsEffFreqs(const QString &band, SgMatrix *&)
bool loadObsCorrelatorInfoS2(const QString &band, QVector< QString > &fourfitOutputFName, QVector< QString > &fourfitErrorCodes, SgVector *&deltaEpochs, SgMatrix *&searchParams, QVector< QString > &baselineCodes, QVector< QString > &tapeQualityCodes, SgVector *&sampleRate, SgVector *&sbdResids, SgVector *&rateResids, SgVector *&effDurations, SgVector *&startSeconds, SgVector *&stopSeconds, SgVector *&percentOfDiscards, SgVector *&geocenterPhaseResids, SgVector *&geocenterPhaseTotals, SgVector *&probOfFalses, SgVector *&corrAprioriDelays, SgVector *&corrAprioriRates, SgVector *&corrAprioriAccs, SgVector *&incohAmps, SgVector *&incohAmps2, SgVector *&delayResids, QVector< QString > &vlb1FileNames, QVector< QVector< int > > &epochsOfCorrelations, QVector< QVector< int > > &epochsOfCentrals, SgMatrix *&mDlys, SgMatrix *&mAux)
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 checkFormat(const QList< FmtChkVar * > &, const SgNetCdf &, bool ok2fail=false)
Definition: SgVgosDb.cpp:2159
bool loadObsCalBendSunHigher(SgMatrix *&cals)
bool loadObsUserCorrections(int idx, SgMatrix *m, QString &name)
bool loadObsCalOceanOld(SgMatrix *&)
SgVdbVariable vPart_NutationNro_
Definition: SgVgosDb.h:1511
bool loadObsGroupDelays(const QString &band, SgMatrix *&)
bool loadObsCalFeedCorr(SgMatrix *&)
double inputFormatVersion_
Definition: SgVgosDb.h:1398
SgVdbVariable vSource_
Definition: SgVgosDb.h:1467
SgVdbVariable vBaseline_
Definition: SgVgosDb.h:1466
@ CT_VLBA
Definition: SgVgosDb.h:190
@ CT_Difx
Definition: SgVgosDb.h:196
@ CT_GSI
Definition: SgVgosDb.h:192
@ CT_Mk3
Definition: SgVgosDb.h:189
@ CT_Mk4
Definition: SgVgosDb.h:194
@ CT_Haystack
Definition: SgVgosDb.h:195
@ CT_CRL
Definition: SgVgosDb.h:191
bool loadObsCalOceanPoleTideLoad(SgMatrix *&)
SgVdbVariable vCal_PoleTideOldRestore_
Definition: SgVgosDb.h:1486
bool loadObsPartBend(SgMatrix *&partBend)
SgVdbVariable vCal_BendSun_
Definition: SgVgosDb.h:1476
SgVdbVariable vPart_Parallax_
Definition: SgVgosDb.h:1512
bool loadObsPartParallax(SgMatrix *&part)
bool loadObsCalHiFyErp(SgMatrix *&, SgMatrix *&, QString &kind)
bool loadObsDelayDataFlag(const QString &band, QVector< int > &delUFlag)
bool loadObsCalBend(SgMatrix *&cals)
bool loadObsDtec(SgVector *&dTec, SgVector *&dTecStdDev)
CorrelatorType correlatorType_
Definition: SgVgosDb.h:1391
bool loadObsPartRaDec(SgMatrix *&dV_dRA, SgMatrix *&dV_dDN)
SgVdbVariable vPart_PoleTide_
Definition: SgVgosDb.h:1513
bool loadObsCalWobble(SgMatrix *&, SgMatrix *&)
SgVdbVariable vCal_BendSunHigher_
Definition: SgVgosDb.h:1477
bool loadObsCalPoleTide(SgMatrix *&, QString &kind)
bool loadObsCorrelation(const QString &band, SgVector *&correlations)
SgVdbVariable vPart_Xyz_
Definition: SgVgosDb.h:1516
bool loadObsDataFlag(const QString &band, QVector< int > &delUFlag)
bool loadObsPhase(const QString &band, SgMatrix *&)
bool loadObsCalParallax(SgMatrix *&cals)
int numOfChan_
Definition: SgVgosDb.h:1387
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 loadObsPartEOP(SgMatrix *&dV_dPx, SgMatrix *&dV_dPy, SgMatrix *&dV_dUT1)
bool loadObsPhaseCalInfoMk3(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)
SgVdbVariable vCal_HiFreqLibration_
Definition: SgVgosDb.h:1490
bool loadObsFractC(SgVector *&v)
SgVdbVariable vObsCrossRef_
Definition: SgVgosDb.h:1497
SgVdbVariable vEdit_
Definition: SgVgosDb.h:1493
SgVdbVariable vCal_OceanLoad_
Definition: SgVgosDb.h:1481
SgVdbVariable vPart_Bend_
Definition: SgVgosDb.h:1507
bool loadObsCorrelatorInfoMk3(const QString &band, QList< QString > &fourfitOutputFName, QList< QString > &fourfitErrorCodes, SgVector *&scanStartSec, SgVector *&scanStopSec)
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)
SgVdbVariable vCal_HfErp_
Definition: SgVgosDb.h:1480
bool loadObsEditData(QVector< int > &delUFlag, QVector< int > &phsUFlag, QVector< int > &ratUFlag, QVector< int > &uAcSup)
bool loadObsChannelInfoS2(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)
SgVdbVariable vCal_PoleTide_
Definition: SgVgosDb.h:1485
SgVdbVariable vCal_OceanPoleTideLoad_
Definition: SgVgosDb.h:1483
QMap< QString, BandData > bandDataByName_
Definition: SgVgosDb.h:1470
bool loadObsUserSup(QVector< int > &uAcSup)
SgVdbVariable vCal_Bend_
Definition: SgVgosDb.h:1475
SgVdbVariable vCal_FeedCorrection_
Definition: SgVgosDb.h:1479
bool loadObsPhaseCalInfoS2(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 loadObsCalOcean(SgMatrix *&)
bool loadObsChannelInfoMk4(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)
SgVdbVariable vCal_HfLibration_
Definition: SgVgosDb.h:1489
bool loadObsCalIonGroup(const QString &band, SgMatrix *&ionCals, SgMatrix *&ionSigmas, QVector< int > &ionDataFlag)
QList< SgVdbVariable * > obsUserCorrections_
Definition: SgVgosDb.h:1520
bool loadObsCalPoleTideOldRestore(SgMatrix *&cals)
SgVdbVariable vPart_Gamma_
Definition: SgVgosDb.h:1508
bool loadObsUVFperAsec(const QString &band, SgMatrix *&uvfPerAsec)
bool loadObsCalBendSun(SgMatrix *&cals)
bool loadObsRates(const QString &band, SgMatrix *&)
ProgramSolveDescriptor progSolveDescriptor_
Definition: SgVgosDb.h:1524
SgVdbVariable vRateTheoretical_
Definition: SgVgosDb.h:1504
int numOfObs_
Definition: SgVgosDb.h:1385
SgVdbVariable vCal_OceanLoadOld_
Definition: SgVgosDb.h:1482
bool loadObsCorrelatorInfoMk4(const QString &band, QList< QString > &fourfitOutputFName, QList< QString > &fourfitErrorCodes, SgVector *&scanStartSec, SgVector *&scanStopSec)
QString path2RootDir_
Definition: SgVgosDb.h:1394
SgVdbVariable vObservationTimeUTC_
Definition: SgVgosDb.h:1465
bool loadEpochs4Obs(QList< SgMJD > &)
bool loadObsQualityCodes(const QString &band, QVector< QString > &qualityCodes)
SgVdbVariable vPart_RaDec_
Definition: SgVgosDb.h:1515
bool loadObsPartPoleTides(SgMatrix *&partX, SgMatrix *&partY, QString &kind)
bool loadObsPartXYZ(SgMatrix *&dTau_dR_1, SgMatrix *&dRat_dR_1)
bool loadObsCorrelatorInfoCrl(const QString &band, QList< QString > &fourfitOutputFName, QList< QString > &fourfitErrorCodes, SgVector *&scanStartSec, SgVector *&scanStopSec)
bool loadObsCalEarthTide(SgMatrix *&, QString &kind)
bool loadObsTheoreticals(SgVector *&delays, SgVector *&rates)
SgVdbVariable vCal_TiltRemover_
Definition: SgVgosDb.h:1487
bool loadObsObjectNames(QList< QString > &, QList< QString > &, QList< QString > &)
bool loadStdObsCalibration(SgMatrix *&cals, QString &origin, const QString &varName, const SgVdbVariable &odbV, const FmtChkVar &fc, const QList< FmtChkVar * > &fcf, bool=true)
SgVdbVariable vCal_Parallax_
Definition: SgVgosDb.h:1484
SgVdbVariable vDelayTheoretical_
Definition: SgVgosDb.h:1503