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  // numOfChan_ = ncdf.lookupVar(fcNumAp.name())->dimensions().at(1)->getN();
1087  //
1088  if (pNumChannels)
1089  numOfChannels.resize(numOfObs_);
1090  if (pNumAp || pNumAccum)
1091  {
1092  numOfAccPeriodsByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
1093  numOfAccPeriodsByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
1094  };
1095  if (pSampleRate)
1096  sampleRate = new SgVector(numOfObs_);
1097  if (pChannelFreq)
1098  refFreqByChan = new SgMatrix(numOfObs_, numOfChan_);
1099  if (pChanAmp)
1100  residFringeAmplByChan = new SgMatrix(numOfObs_, numOfChan_);
1101  if (pChanPhs)
1102  residFringePhseByChan = new SgMatrix(numOfObs_, numOfChan_);
1103  if (false) //??
1104  {
1105  numOfSamplesByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
1106  numOfSamplesByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
1107  };
1108 
1109  for (int i=0; i<numOfObs_; i++)
1110  {
1111  if (pNumChannels)
1112  numOfChannels[i] = pNumChannels[i];
1113  if (pSampleRate)
1114  sampleRate->setElement(i, pSampleRate[i]);
1115  for (int j=0; j<numOfChan_; j++)
1116  {
1117  if (pNumAp)
1118  {
1119  numOfAccPeriodsByChan_USB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j ]);
1120  numOfAccPeriodsByChan_LSB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j + 1]);
1121  }
1122  else if (pNumAccum) //??
1123  {
1124  numOfAccPeriodsByChan_USB->setElement(i,j, pNumAccum[numOfChan_*i + j]);
1125  numOfAccPeriodsByChan_LSB->setElement(i,j, pNumAccum[numOfChan_*i + j]);
1126  };
1127  if (pChannelFreq)
1128  refFreqByChan->setElement(i,j, pChannelFreq[numOfChan_*i + j]);
1129  if (pChanAmp)
1130  residFringeAmplByChan->setElement(i,j, pChanAmp[numOfChan_*i + j]);
1131  if (pChanPhs)
1132  residFringePhseByChan->setElement(i,j, pChanPhs[numOfChan_*i + j]);
1133  };
1134  };
1135  //
1137  ":loadObsChannelInfoS2(): data loaded successfully from " + ncdf.getFileName());
1138  return true;
1139 };
1140 
1141 
1142 
1143 //
1144 //bool SgVgosDb::loadObsChannelInfoMk4(const QString& band, QVector<int>& numOfChannels,
1145 // SgVector*& sampleRate, SgMatrix*& numOfAccPeriodsByChan_USB, SgMatrix*& numOfAccPeriodsByChan_LSB,
1146 // SgMatrix*& refFreqByChan, SgMatrix*& numOfSamplesByChan_USB, SgMatrix*& numOfSamplesByChan_LSB,
1147 // SgMatrix*& fringeAmplitudeByChan)
1148 bool SgVgosDb::loadObsChannelInfoMk4(const QString& band,
1149  QVector<QString>& channelIds, // CHAN ID
1150  QVector<QString>& polarizations, // POLARIZ
1151  QVector<int>& numOfChannels, // #CHANELS
1152  QVector<int>& bitsPerSamples, // BITSAMPL
1153  QVector< QVector<int> >& errorRates_1, // ERRORATE @1, phasecal data
1154  QVector< QVector<int> >& errorRates_2, // ERRORATE @2, phasecal data
1155  QVector< QVector<int> >& bbcIdxs_1, // BBC IND @1
1156  QVector< QVector<int> >& bbcIdxs_2, // BBC IND @2
1157  QVector< QVector<int> >& corelIdxNumbersUsb, // INDEXNUM usb
1158  QVector< QVector<int> >& corelIdxNumbersLsb, // INDEXNUM lsb
1159  SgVector*&sampleRate, // SAMPLRAT
1160  SgMatrix*&residFringeAmplByChan, // AMPBYFRQ Amp
1161  SgMatrix*&residFringePhseByChan, // AMPBYFRQ Phs
1162  SgMatrix*&refFreqByChan, // RFREQ
1163  SgMatrix*&numOfSamplesByChan_USB, // #SAMPLES usb
1164  SgMatrix*&numOfSamplesByChan_LSB, // #SAMPLES lsb
1165  SgMatrix*&numOfAccPeriodsByChan_USB, // NO.OF AP usb
1166  SgMatrix*&numOfAccPeriodsByChan_LSB, // NO.OF AP lsb
1167  SgMatrix*&loFreqs_1, // LO FREQ @1
1168  SgMatrix*&loFreqs_2 // LO FREQ @2
1169  )
1170 {
1171  if (!bandDataByName_.contains(band))
1172  {
1174  "::loadObsChannelInfoMk4(): the band \"" + band + "\" is not registered");
1175  return false;
1176  };
1177  SgVdbVariable &var=bandDataByName_[band].vChannelInfo_;
1178  if (var.isEmpty())
1179  {
1181  "::loadObsChannelInfoMk4(): the vgosDb variable ChannelInfo for the band [" + band + "] is empty");
1182  return false;
1183  };
1184  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1185  ncdf.getData();
1186  if (!checkFormat(fcfChannelInfoInptMk4, ncdf))
1187  {
1189  "::loadObsChannelInfoMk4(): format check failed");
1190  return false;
1191  };
1192 
1193  const char *pChannelID=ncdf.lookupVar(fcChannelID.name())?
1194  ncdf.lookupVar(fcChannelID.name())->data2char():NULL;
1195  const char *pPolarization=ncdf.lookupVar(fcPolarization.name())?
1196  ncdf.lookupVar(fcPolarization.name())->data2char():NULL;
1197  const short *pNumChannels=ncdf.lookupVar(fcNumChannels.name())->data2short();
1198 
1199  const short *pBITSAMPL=ncdf.lookupVar(fcBITSAMPL.name())?
1200  ncdf.lookupVar(fcBITSAMPL.name())->data2short():NULL;
1201  const short *pERRORATE=ncdf.lookupVar(fcERRORATE.name())?
1202  ncdf.lookupVar(fcERRORATE.name())->data2short():NULL;
1203  const short *pBBCIndex=ncdf.lookupVar(fcBBCIndex.name())?
1204  ncdf.lookupVar(fcBBCIndex.name())->data2short():NULL;
1205  const short *pINDEXNUM=ncdf.lookupVar(fcINDEXNUM.name())?
1206  ncdf.lookupVar(fcINDEXNUM.name())->data2short():NULL;
1207 
1208  const double *pSampleRate=ncdf.lookupVar(fcSampleRate.name())->data2double();
1209  const double *pChannelFreq=ncdf.lookupVar(fcChannelFreq.name())->data2double();
1210  const short *pNumAp=ncdf.lookupVar(fcNumAp.name())->data2short();
1211  const double *pChanAmpPhase=ncdf.lookupVar(fcChanAmpPhase.name())->data2double();
1212  const double *pNumSamples=ncdf.lookupVar(fcNumSamples.name())?
1213  ncdf.lookupVar(fcNumSamples.name())->data2double():NULL;
1214 
1215  const double *pLOFreq=ncdf.lookupVar(fcLOFreq.name())?
1216  ncdf.lookupVar(fcLOFreq.name())->data2double():NULL;
1217  int lChannelID, lPolarization;
1218  //
1219  numOfChan_ = ncdf.lookupVar(fcNumAp.name())->dimensions().at(1)->getN();
1220  //
1221  if (pChannelID)
1222  channelIds.resize(numOfObs_);
1223  if (pPolarization)
1224  polarizations.resize(numOfObs_);
1225  numOfChannels.resize(numOfObs_);
1226  if (pBITSAMPL)
1227  bitsPerSamples.resize(numOfObs_);
1228  //
1229  if (pERRORATE)
1230  {
1231  errorRates_1.resize(numOfObs_);
1232  errorRates_2.resize(numOfObs_);
1233  };
1234  bbcIdxs_1.resize(numOfObs_);
1235  bbcIdxs_2.resize(numOfObs_);
1236  corelIdxNumbersUsb.resize(numOfObs_);
1237  corelIdxNumbersLsb.resize(numOfObs_);
1238  for (int i=0; i<numOfObs_; i++)
1239  {
1240  if (pERRORATE)
1241  {
1242  errorRates_1[i].resize(numOfChan_);
1243  errorRates_2[i].resize(numOfChan_);
1244  };
1245  bbcIdxs_1[i].resize(numOfChan_);
1246  bbcIdxs_2[i].resize(numOfChan_);
1247  corelIdxNumbersUsb[i].resize(numOfChan_);
1248  corelIdxNumbersLsb[i].resize(numOfChan_);
1249  };
1250 
1251  //
1252  numOfAccPeriodsByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
1253  numOfAccPeriodsByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
1254  sampleRate = new SgVector(numOfObs_);
1255  refFreqByChan = new SgMatrix(numOfObs_, numOfChan_);
1256  if (pNumSamples)
1257  {
1258  numOfSamplesByChan_USB = new SgMatrix(numOfObs_, numOfChan_);
1259  numOfSamplesByChan_LSB = new SgMatrix(numOfObs_, numOfChan_);
1260  };
1261  if (pChanAmpPhase)
1262  {
1263  residFringeAmplByChan = new SgMatrix(numOfObs_, numOfChan_);
1264  residFringePhseByChan = new SgMatrix(numOfObs_, numOfChan_);
1265  };
1266  loFreqs_1 = new SgMatrix(numOfObs_, numOfChan_);
1267  loFreqs_2 = new SgMatrix(numOfObs_, numOfChan_);
1268  //
1269  //
1270  //
1271  lChannelID = pChannelID?ncdf.lookupVar(fcChannelID.name())->dimensions().at(1)->getN():0;
1272  lPolarization = pPolarization?
1273  ncdf.lookupVar(fcPolarization.name())->dimensions().at(1)->getN()*
1274  ncdf.lookupVar(fcPolarization.name())->dimensions().at(2)->getN():0;
1275 
1276  for (int i=0; i<numOfObs_; i++)
1277  {
1278  if (pChannelID)
1279  channelIds[i] = QString::fromLatin1(pChannelID + i*lChannelID, lChannelID);
1280  if (pPolarization)
1281  polarizations[i] = QString::fromLatin1(pPolarization + i*lPolarization, lPolarization);
1282 
1283  numOfChannels[i] = pNumChannels[i];
1284  if (pBITSAMPL)
1285  bitsPerSamples[i] = pBITSAMPL[i];
1286 
1287  sampleRate->setElement(i, pSampleRate[i]);
1288  for (int j=0; j<numOfChan_; j++)
1289  {
1290  numOfAccPeriodsByChan_USB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j ]);
1291  numOfAccPeriodsByChan_LSB->setElement(i,j, pNumAp[2*numOfChan_*i + 2*j + 1]);
1292  refFreqByChan->setElement(i,j, pChannelFreq[numOfChan_*i + j]);
1293  if (pNumSamples)
1294  {
1295  numOfSamplesByChan_USB->setElement(i,j, pNumSamples[2*numOfChan_*i + 2*j ]);
1296  numOfSamplesByChan_LSB->setElement(i,j, pNumSamples[2*numOfChan_*i + 2*j + 1]);
1297  };
1298  if (pChanAmpPhase)
1299  {
1300  residFringeAmplByChan->setElement(i,j, pChanAmpPhase[numOfChan_*2*i + 2*j + 0]);
1301  residFringePhseByChan->setElement(i,j, pChanAmpPhase[numOfChan_*2*i + 2*j + 1]);
1302  };
1303  if (pERRORATE)
1304  {
1305  errorRates_1[i][j] = pERRORATE[4*numOfChan_*i + 4*j ];
1306  errorRates_2[i][j] = pERRORATE[4*numOfChan_*i + 4*j + 1];
1307  };
1308  //
1309  if (pBBCIndex)
1310  {
1311  bbcIdxs_1[i][j] = pBBCIndex[2*numOfChan_*i + 2*j ];
1312  bbcIdxs_2[i][j] = pBBCIndex[2*numOfChan_*i + 2*j + 1];
1313  }
1314  else
1315  {
1316  bbcIdxs_1[i][j] = 0;
1317  bbcIdxs_2[i][j] = 0;
1318  };
1319  //
1320  if (pINDEXNUM)
1321  {
1322  corelIdxNumbersUsb[i][j] = pINDEXNUM[2*numOfChan_*i + 2*j ];
1323  corelIdxNumbersLsb[i][j] = pINDEXNUM[2*numOfChan_*i + 2*j + 1];
1324  }
1325  else
1326  {
1327  corelIdxNumbersUsb[i][j] = 0;
1328  corelIdxNumbersLsb[i][j] = 0;
1329  };
1330  //
1331  if (pLOFreq)
1332  {
1333  loFreqs_1->setElement(i,j, pLOFreq[2*numOfChan_*i + 2*j ]);
1334  loFreqs_2->setElement(i,j, pLOFreq[2*numOfChan_*i + 2*j + 1]);
1335  }
1336  else
1337  {
1338  loFreqs_1->setElement(i,j, 0.0);
1339  loFreqs_2->setElement(i,j, 0.0);
1340  };
1341  };
1342  };
1343  //
1345  "::loadObsChannelInfoMk4(): data loaded successfully from " + ncdf.getFileName());
1346  return true;
1347 };
1348 
1349 
1350 
1351 //
1352 bool SgVgosDb::loadObsPhaseCalInfo(const QString& band,
1353  SgMatrix*& phaseCalFreqs_1, SgMatrix*& phaseCalAmps_1, SgMatrix*& phaseCalPhases_1,
1354  SgMatrix*& phaseCalOffsets_1, SgVector*& phaseCalRates_1,
1355  SgMatrix*& phaseCalFreqs_2, SgMatrix*& phaseCalAmps_2, SgMatrix*& phaseCalPhases_2,
1356  SgMatrix*& phaseCalOffsets_2, SgVector*& phaseCalRates_2
1357  )
1358 {
1359  bool isOk=false;
1360  if (!bandDataByName_.contains(band))
1361  {
1363  "::loadObsPhaseCalInfo(): the band \"" + band + "\" is not registered");
1364  return false;
1365  };
1366  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1367  if (var.isEmpty())
1368  {
1370  "::loadObsPhaseCalInfo(): the vgosDb variable PhaseCalInfo for the band [" + band + "] is empty");
1371  return false;
1372  };
1373  //
1374  if (correlatorType_ == CT_Mk3 ||
1375  correlatorType_ == CT_VLBA ||
1376  correlatorType_ == CT_CRL ||
1377  correlatorType_ == CT_GSI )
1378  isOk = loadObsPhaseCalInfoMk3(band,
1379  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1380  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1381  else if (correlatorType_ == CT_S2 )
1382  isOk = loadObsPhaseCalInfoS2(band,
1383  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1384  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1385  else if ( correlatorType_ == CT_Mk4 ||
1388  isOk = loadObsPhaseCalInfoMk4(band,
1389  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1390  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1391  else
1392  {
1393  // Unknown, try each of types:
1395  "::loadObsPhaseCalInfo(): unknown correlator type, trying Mk4 data format");
1396  isOk = loadObsPhaseCalInfoMk4(band,
1397  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1398  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1399  if (!isOk)
1400  {
1402  "::loadObsPhaseCalInfo(): unknown correlator type, trying S2 data format");
1403  isOk = loadObsPhaseCalInfoS2(band,
1404  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1405  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1406  };
1407  if (!isOk)
1408  {
1410  "::loadObsPhaseCalInfo(): unknown correlator type, trying Mk3 data format");
1411  isOk = loadObsPhaseCalInfoMk3(band,
1412  phaseCalFreqs_1, phaseCalAmps_1, phaseCalPhases_1, phaseCalOffsets_1, phaseCalRates_1,
1413  phaseCalFreqs_2, phaseCalAmps_2, phaseCalPhases_2, phaseCalOffsets_2, phaseCalRates_2);
1414  };
1415  };
1416  return isOk;
1417 };
1418 
1419 
1420 
1421 //
1422 bool SgVgosDb::loadObsPhaseCalInfoMk3(const QString& band,
1423  SgMatrix*& phaseCalFreqs_1, SgMatrix*& phaseCalAmps_1, SgMatrix*& phaseCalPhases_1,
1424  SgMatrix*& phaseCalOffsets_1, SgVector*& phaseCalRates_1,
1425  SgMatrix*& phaseCalFreqs_2, SgMatrix*& phaseCalAmps_2, SgMatrix*& phaseCalPhases_2,
1426  SgMatrix*& phaseCalOffsets_2, SgVector*& phaseCalRates_2
1427  )
1428 {
1429  if (!bandDataByName_.contains(band))
1430  {
1432  "::loadObsPhaseCalInfoMk3(): the band \"" + band + "\" is not registered");
1433  return false;
1434  };
1435  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1436  if (var.isEmpty())
1437  {
1439  "::loadObsPhaseCalInfoMk3(): the vgosDb variable PhaseCalInfo for the band [" + band + "] is empty");
1440  return false;
1441  };
1442  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1443  ncdf.getData();
1444  if (!checkFormat(fcfPhaseCalInfoMk3, ncdf))
1445  {
1447  "::loadObsPhaseCalInfoMk3(): format check failed");
1448  return false;
1449  };
1450  const short *pPhCalFreqs=ncdf.lookupVar(fcPhaseCalFreq.name())->data2short();
1451  const short *pPhCalAmps =ncdf.lookupVar(fcPhaseCalAmp.name())->data2short();
1452  const short *pPhCalPhass=ncdf.lookupVar(fcPhaseCalPhase.name())->data2short();
1453  const double *pPhCalRates=ncdf.lookupVar(fcPhaseCalRate.name())->data2double();
1454  //
1455  phaseCalFreqs_1 = new SgMatrix(numOfObs_, numOfChan_);
1456  phaseCalAmps_1 = new SgMatrix(numOfObs_, numOfChan_);
1457  phaseCalPhases_1 = new SgMatrix(numOfObs_, numOfChan_);
1458  phaseCalOffsets_1 = new SgMatrix(numOfObs_, numOfChan_);
1459  phaseCalRates_1 = new SgVector(numOfObs_);
1460  phaseCalFreqs_2 = new SgMatrix(numOfObs_, numOfChan_);
1461  phaseCalAmps_2 = new SgMatrix(numOfObs_, numOfChan_);
1462  phaseCalPhases_2 = new SgMatrix(numOfObs_, numOfChan_);
1463  phaseCalOffsets_2 = new SgMatrix(numOfObs_, numOfChan_);
1464  phaseCalRates_2 = new SgVector(numOfObs_);
1465  for (int i=0; i<numOfObs_; i++)
1466  {
1467  phaseCalRates_1->setElement(i, pPhCalRates[2*i ]);
1468  phaseCalRates_2->setElement(i, pPhCalRates[2*i + 1]);
1469  for (int j=0; j<numOfChan_; j++)
1470  {
1471  phaseCalFreqs_1 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j ]);
1472  phaseCalFreqs_2 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j + 1]);
1473  phaseCalAmps_1 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j ]);
1474  phaseCalAmps_2 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j + 1]);
1475  phaseCalPhases_1->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j ]);
1476  phaseCalPhases_2->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j + 1]);
1477  };
1478  };
1479  //
1481  "::loadObsPhaseCalInfoMk3(): data loaded successfully from " + ncdf.getFileName());
1482  return true;
1483 };
1484 
1485 
1486 
1487 //
1488 bool SgVgosDb::loadObsPhaseCalInfoS2(const QString& band,
1489  SgMatrix*& phaseCalFreqs_1, SgMatrix*& phaseCalAmps_1, SgMatrix*& phaseCalPhases_1,
1490  SgMatrix*& phaseCalOffsets_1, SgVector*& phaseCalRates_1,
1491  SgMatrix*& phaseCalFreqs_2, SgMatrix*& phaseCalAmps_2, SgMatrix*& phaseCalPhases_2,
1492  SgMatrix*& phaseCalOffsets_2, SgVector*& phaseCalRates_2
1493  )
1494 {
1495  if (!bandDataByName_.contains(band))
1496  {
1498  "::loadObsPhaseCalInfoS2(): the band \"" + band + "\" is not registered");
1499  return false;
1500  };
1501  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1502  if (var.isEmpty())
1503  {
1505  "::loadObsPhaseCalInfoS2(): the vgosDb variable PhaseCalInfo for the band [" + band + "] is empty");
1506  return false;
1507  };
1508  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1509  ncdf.getData();
1510  if (!checkFormat(fcfPhaseCalInfoS2, ncdf))
1511  {
1513  "::loadObsPhaseCalInfoS2(): format check failed");
1514  return false;
1515  };
1516  const double *pPhCalFreqs=ncdf.lookupVar(fcPhaseCalFreqS2.name())?
1517  ncdf.lookupVar(fcPhaseCalFreqS2.name())->data2double():NULL;
1518  const double *pPhCalAmps =ncdf.lookupVar(fcPhaseCalAmpS2.name())->data2double();
1519  const double *pPhCalPhass=ncdf.lookupVar(fcPhaseCalPhaseS2.name())->data2double();
1520  const double *pPhCalRates=ncdf.lookupVar(fcPhaseCalRate.name())->data2double();
1521  //
1522  if (pPhCalFreqs)
1523  {
1524  phaseCalFreqs_1 = new SgMatrix(numOfObs_, numOfChan_);
1525  phaseCalFreqs_2 = new SgMatrix(numOfObs_, numOfChan_);
1526  };
1527  phaseCalAmps_1 = new SgMatrix(numOfObs_, numOfChan_);
1528  phaseCalAmps_2 = new SgMatrix(numOfObs_, numOfChan_);
1529  phaseCalPhases_1 = new SgMatrix(numOfObs_, numOfChan_);
1530  phaseCalPhases_2 = new SgMatrix(numOfObs_, numOfChan_);
1531  phaseCalOffsets_1 = new SgMatrix(numOfObs_, numOfChan_);
1532  phaseCalOffsets_2 = new SgMatrix(numOfObs_, numOfChan_);
1533  phaseCalRates_1 = new SgVector(numOfObs_);
1534  phaseCalRates_2 = new SgVector(numOfObs_);
1535  for (int i=0; i<numOfObs_; i++)
1536  {
1537  phaseCalRates_1->setElement(i, pPhCalRates[2*i ]);
1538  phaseCalRates_2->setElement(i, pPhCalRates[2*i + 1]);
1539  for (int j=0; j<numOfChan_; j++)
1540  {
1541  if (pPhCalFreqs)
1542  {
1543  phaseCalFreqs_1 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j ]);
1544  phaseCalFreqs_2 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j + 1]);
1545  };
1546  phaseCalAmps_1 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j ]);
1547  phaseCalAmps_2 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j + 1]);
1548  phaseCalPhases_1->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j ]);
1549  phaseCalPhases_2->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j + 1]);
1550  };
1551  };
1552  //
1554  "::loadObsPhaseCalInfoS2(): data loaded successfully from " + ncdf.getFileName());
1555  return true;
1556 };
1557 
1558 
1559 
1560 //
1561 bool SgVgosDb::loadObsPhaseCalInfoMk4(const QString& band,
1562  SgMatrix*& phaseCalFreqs_1, SgMatrix*& phaseCalAmps_1, SgMatrix*& phaseCalPhases_1,
1563  SgMatrix*& phaseCalOffsets_1, SgVector*& phaseCalRates_1,
1564  SgMatrix*& phaseCalFreqs_2, SgMatrix*& phaseCalAmps_2, SgMatrix*& phaseCalPhases_2,
1565  SgMatrix*& phaseCalOffsets_2, SgVector*& phaseCalRates_2
1566  )
1567 {
1568  if (!bandDataByName_.contains(band))
1569  {
1571  "::loadObsPhaseCalInfoMk4(): the band \"" + band + "\" is not registered");
1572  return false;
1573  };
1574  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1575  if (var.isEmpty())
1576  {
1578  "::loadObsPhaseCalInfoMk4(): the vgosDb variable PhaseCalInfo for the band [" + band + "] is empty");
1579  return false;
1580  };
1581  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1582  ncdf.getData();
1583  if (!checkFormat(fcfPhaseCalInfoMk4, ncdf))
1584  {
1586  "::loadObsPhaseCalInfoMk4(): format check failed");
1587  return false;
1588  };
1589  const short *pPhCalFreqs=ncdf.lookupVar(fcPhaseCalFreq.name())?
1590  ncdf.lookupVar(fcPhaseCalFreq.name())->data2short():NULL;
1591  const short *pPhCalAmps =ncdf.lookupVar(fcPhaseCalAmp.name())->data2short();
1592  const short *pPhCalPhass=ncdf.lookupVar(fcPhaseCalPhase.name())->data2short();
1593  const short *pPhCalOffss=ncdf.lookupVar(fcPhaseCalOffset.name())?
1594  ncdf.lookupVar(fcPhaseCalOffset.name())->data2short():NULL;
1595  const double *pPhCalRates=ncdf.lookupVar(fcPhaseCalRate.name())->data2double();
1596  //
1597  if (pPhCalFreqs)
1598  {
1599  phaseCalFreqs_1 = new SgMatrix(numOfObs_, numOfChan_);
1600  phaseCalFreqs_2 = new SgMatrix(numOfObs_, numOfChan_);
1601  };
1602  phaseCalAmps_1 = new SgMatrix(numOfObs_, numOfChan_);
1603  phaseCalAmps_2 = new SgMatrix(numOfObs_, numOfChan_);
1604  phaseCalPhases_1 = new SgMatrix(numOfObs_, numOfChan_);
1605  phaseCalPhases_2 = new SgMatrix(numOfObs_, numOfChan_);
1606  if (pPhCalOffss)
1607  {
1608  phaseCalOffsets_1 = new SgMatrix(numOfObs_, numOfChan_);
1609  phaseCalOffsets_2 = new SgMatrix(numOfObs_, numOfChan_);
1610  };
1611  phaseCalRates_1 = new SgVector(numOfObs_);
1612  phaseCalRates_2 = new SgVector(numOfObs_);
1613  for (int i=0; i<numOfObs_; i++)
1614  {
1615  phaseCalRates_1->setElement(i, pPhCalRates[2*i ]);
1616  phaseCalRates_2->setElement(i, pPhCalRates[2*i + 1]);
1617  for (int j=0; j<numOfChan_; j++)
1618  {
1619  if (pPhCalFreqs)
1620  {
1621  phaseCalFreqs_1 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j ]);
1622  phaseCalFreqs_2 ->setElement(i,j, pPhCalFreqs[2*numOfChan_*i + 2*j + 1]);
1623  };
1624  phaseCalAmps_1 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j ]);
1625  phaseCalAmps_2 ->setElement(i,j, pPhCalAmps [2*numOfChan_*i + 2*j + 1]);
1626  phaseCalPhases_1->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j ]);
1627  phaseCalPhases_2->setElement(i,j, pPhCalPhass[2*numOfChan_*i + 2*j + 1]);
1628  if (pPhCalOffss)
1629  {
1630  phaseCalOffsets_1->setElement(i,j, pPhCalOffss[2*numOfChan_*i + 2*j ]);
1631  phaseCalOffsets_2->setElement(i,j, pPhCalOffss[2*numOfChan_*i + 2*j + 1]);
1632  };
1633  };
1634  };
1635  //
1637  "::loadObsPhaseCalInfoMk4(): data loaded successfully from " + ncdf.getFileName());
1638  return true;
1639 };
1640 
1641 
1642 
1643 //
1644 bool SgVgosDb::loadObsCorrelatorInfo(const QString& band,
1645  QList<QString>& fourfitOutputFName,
1646  QList<QString>& fourfitErrorCodes,
1647  SgVector*& scanStartSec, SgVector*& scanStopSec
1648  )
1649 {
1650  bool isOk=false;
1651  //
1652  if (correlatorType_ == CT_Mk3 ||
1654  isOk = loadObsCorrelatorInfoMk3(band, fourfitOutputFName, fourfitErrorCodes,
1655  scanStartSec, scanStopSec);
1656  else if ( correlatorType_ == CT_CRL ||
1657  correlatorType_ == CT_GSI ||
1658  correlatorType_ == CT_S2 )
1659  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
1660  scanStartSec, scanStopSec);
1661  else if ( correlatorType_ == CT_Mk4 ||
1664  isOk = loadObsCorrelatorInfoMk4(band, fourfitOutputFName, fourfitErrorCodes,
1665  scanStartSec, scanStopSec);
1666  else
1667  {
1668  // Unknown, try each of types:
1670  "::loadObsCorrelatorInfo(): unknown correlator type, trying Mk4 data format");
1671  isOk = loadObsCorrelatorInfoMk4(band, fourfitOutputFName, fourfitErrorCodes,
1672  scanStartSec, scanStopSec);
1673  if (!isOk)
1674  {
1676  "::loadObsCorrelatorInfo(): unknown correlator type, trying S2 data format");
1677  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
1678  scanStartSec, scanStopSec);
1679  };
1680  if (!isOk)
1681  {
1683  "::loadObsCorrelatorInfo(): unknown correlator type, trying Mk3 data format");
1684  isOk = loadObsCorrelatorInfoMk3(band, fourfitOutputFName, fourfitErrorCodes,
1685  scanStartSec, scanStopSec);
1686  };
1687  };
1688  return isOk;
1689 };
1690 
1691 
1692 
1693 //
1694 bool SgVgosDb::loadObsCorrelatorInfoMk3(const QString& band,
1695  QList<QString>& fourfitOutputFName,
1696  QList<QString>& fourfitErrorCodes,
1697  SgVector*& scanStartSec, SgVector*& scanStopSec
1698  )
1699 {
1700  if (!bandDataByName_.contains(band))
1701  {
1703  "::loadObsCorrelatorInfoMk3(): the band \"" + band + "\" is not registered");
1704  return false;
1705  };
1706  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
1707  if (var.isEmpty())
1708  {
1710  "::loadObsCorrelatorInfoMk3(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
1711  return false;
1712  };
1713  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1714  ncdf.getData();
1715  if (!checkFormat(fcfCorrInfoInptMk3, ncdf))
1716  {
1718  "::loadObsCorrelatorInfoMk3(): format check failed");
1719  return false;
1720  };
1721  if (ncdf.lookupVar(fcVLB1FILE.name()))
1722  {
1723  const char *p=ncdf.lookupVar(fcVLB1FILE.name())->data2char();
1724  int l;
1725  //
1726  l = ncdf.lookupVar(fcVLB1FILE.name())->dimensions().at(1)->getN();
1727  //
1728  fourfitOutputFName.clear();
1729  for (int i=0; i<numOfObs_; i++)
1730  fourfitOutputFName.append(QString::fromLatin1(p + l*i, l));
1731  };
1732  if (ncdf.lookupVar(fcFRNGERR.name()))
1733  {
1734  const char *p=ncdf.lookupVar(fcFRNGERR.name())->data2char();
1735  //
1736  fourfitErrorCodes.clear();
1737  for (int i=0; i<numOfObs_; i++)
1738  fourfitErrorCodes.append(QString::fromLatin1(p + i, 1));
1739  };
1740  if (ncdf.lookupVar(fcStartSec.name()) && ncdf.lookupVar(fcStopSec.name()))
1741  {
1742  const double *pStart=ncdf.lookupVar(fcStartSec.name())->data2double();
1743  const double *pStop =ncdf.lookupVar(fcStopSec.name())->data2double();
1744  scanStartSec = new SgVector(numOfObs_);
1745  scanStopSec = new SgVector(numOfObs_);
1746  for (int i=0; i<numOfObs_; i++)
1747  {
1748  scanStartSec->setElement(i, pStart[i]);
1749  scanStopSec ->setElement(i, pStop [i]);
1750  };
1751  };
1753  "::loadObsCorrelatorInfoMk3(): data loaded successfully from " + ncdf.getFileName());
1754  return true;
1755 };
1756 
1757 
1758 
1759 //
1760 bool SgVgosDb::loadObsCorrelatorInfoCrl(const QString& band,
1761  QList<QString>& fourfitOutputFName,
1762  QList<QString>& fourfitErrorCodes,
1763  SgVector*& scanStartSec, SgVector*& scanStopSec
1764  )
1765 {
1766  if (!bandDataByName_.contains(band))
1767  {
1769  "::loadObsCorrelatorInfoCrl(): the band \"" + band + "\" is not registered");
1770  return false;
1771  };
1772  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
1773  if (var.isEmpty())
1774  {
1776  "::loadObsCorrelatorInfoCrl(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
1777  return false;
1778  };
1779  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1780  ncdf.getData();
1781  if (!checkFormat(fcfCorrInfoInptCRL, ncdf))
1782  {
1784  "::loadObsCorrelatorInfoCrl(): format check failed");
1785  return false;
1786  };
1787  /*
1788  if (ncdf.lookupVar(fcVLB1FILE.name()))
1789  {
1790  const char *p=ncdf.lookupVar(fcVLB1FILE.name())->data2char();
1791  int l;
1792  //
1793  l = ncdf.lookupVar(fcVLB1FILE.name())->dimensions().at(1)->getN();
1794  //
1795  fourfitOutputFName.clear();
1796  for (int i=0; i<numOfObs_; i++)
1797  fourfitOutputFName.append(QString::fromLatin1(p + l*i, l));
1798  };
1799  */
1800  if (ncdf.lookupVar(fcFOURFFIL.name()))
1801  {
1802  const char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())->data2char();
1803  int l;
1804  //
1805  l = ncdf.lookupVar(fcFOURFFIL.name())->dimensions().at(1)->getN();
1806  //
1807  fourfitOutputFName.clear();
1808  for (int i=0; i<numOfObs_; i++)
1809  fourfitOutputFName.append(QString::fromLatin1(pFOURFFIL + l*i, l));
1810  };
1811  if (ncdf.lookupVar(fcFRNGERR4S2.name()))
1812  {
1813  const short *p=ncdf.lookupVar(fcFRNGERR4S2.name())->data2short();
1814  //
1815  fourfitErrorCodes.clear();
1816  for (int i=0; i<numOfObs_; i++)
1817  fourfitErrorCodes.append(*p==0?" ":"Q");
1818  };
1819  if (ncdf.lookupVar(fcStartSec.name()) && ncdf.lookupVar(fcStopSec.name()))
1820  {
1821  const double *pStart=ncdf.lookupVar(fcStartSec.name())->data2double();
1822  const double *pStop =ncdf.lookupVar(fcStopSec.name())->data2double();
1823  scanStartSec = new SgVector(numOfObs_);
1824  scanStopSec = new SgVector(numOfObs_);
1825  for (int i=0; i<numOfObs_; i++)
1826  {
1827  scanStartSec->setElement(i, pStart[i]);
1828  scanStopSec ->setElement(i, pStop [i]);
1829  };
1830  };
1832  "::loadObsCorrelatorInfoCrl(): data loaded successfully from " + ncdf.getFileName());
1833  return true;
1834 };
1835 
1836 
1837 
1838 //
1839 bool SgVgosDb::loadObsCorrelatorInfoMk4(const QString& band,
1840  QList<QString>& fourfitOutputFName,
1841  QList<QString>& fourfitErrorCodes,
1842  SgVector*& scanStartSec, SgVector*& scanStopSec
1843  )
1844 {
1845  if (!bandDataByName_.contains(band))
1846  {
1848  "::loadObsCorrelatorInfoMk4(): the band \"" + band + "\" is not registered");
1849  return false;
1850  };
1851  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
1852  if (var.isEmpty())
1853  {
1855  "::loadObsCorrelatorInfoMk4(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
1856  return false;
1857  };
1858  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
1859  ncdf.getData();
1860  if (!checkFormat(fcfCorrInfoInptMk4, ncdf))
1861  {
1863  "::loadObsCorrelatorInfoMk4(): format check failed");
1864  return false;
1865  };
1866  if (ncdf.lookupVar(fcFOURFFIL.name()))
1867  {
1868  const char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())->data2char();
1869  int l;
1870  //
1871  l = ncdf.lookupVar(fcFOURFFIL.name())->dimensions().at(1)->getN();
1872  //
1873  fourfitOutputFName.clear();
1874  for (int i=0; i<numOfObs_; i++)
1875  fourfitOutputFName.append(QString::fromLatin1(pFOURFFIL + l*i, l));
1876  };
1877  if (ncdf.lookupVar(fcFRNGERR.name()))
1878  {
1879  const char *p=ncdf.lookupVar(fcFRNGERR.name())->data2char();
1880  //
1881  fourfitErrorCodes.clear();
1882  for (int i=0; i<numOfObs_; i++)
1883  fourfitErrorCodes.append(QString::fromLatin1(p + i, 1));
1884  };
1885  if (ncdf.lookupVar(fcStartSec.name()) && ncdf.lookupVar(fcStopSec.name()))
1886  {
1887  const double *pStart=ncdf.lookupVar(fcStartSec.name())->data2double();
1888  const double *pStop =ncdf.lookupVar(fcStopSec.name())->data2double();
1889  scanStartSec = new SgVector(numOfObs_);
1890  scanStopSec = new SgVector(numOfObs_);
1891  for (int i=0; i<numOfObs_; i++)
1892  {
1893  scanStartSec->setElement(i, pStart[i]);
1894  scanStopSec ->setElement(i, pStop [i]);
1895  };
1896  };
1898  "::loadObsCorrelatorInfoMk4(): data loaded successfully from " + ncdf.getFileName());
1899  return true;
1900 };
1901 
1902 
1903 
1904 
1905 
1906 //
1907 // full input functions:
1908 //
1909 
1910 //
1911 bool SgVgosDb::loadObsCorrelatorInfo(const QString& band,
1912  QVector<QString>& fourfitOutputFName, // fcFOURFFIL
1913  QVector<QString>& fourfitErrorCodes, // fcFRNGERR
1914 //QVector<int>& corelVersions, // fcCORELVER
1915  QVector<int>& startOffsets, // fcStartOffset
1916  QVector< QVector<int> >& fourfitVersions, // fcFOURFVER
1917 //QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
1918  SgVector*&deltaEpochs, // fcDELTAEPO
1919  SgMatrix*&urvrs, // fcURVR
1920  SgMatrix*&instrDelays, // fcIDELAY
1921  SgMatrix*&starElev, // fcSTARELEV
1922  SgMatrix*&zenithDelays, // fcZDELAY
1923  SgMatrix*&searchParams, // fcSRCHPAR
1924  QVector<QString>& baselineCodes, // fcCORBASCD
1925  QVector<QString>& tapeQualityCodes, // fcTapeCode
1926  QVector<int>& stopOffsets, // fcStopOffset
1927  QVector<int>& hopsRevisionNumbers, // fcHopsRevNum
1928  SgVector*&sampleRate, // fcRECSETUP
1929  SgVector*&sbdResids, // fcSBRESID
1930  SgVector*&rateResids, // fcRATRESID
1931  SgVector*&effDurations, // fcEffectiveDuration
1932  SgVector*&startSeconds, // fcStartSec
1933  SgVector*&stopSeconds, // fcStopSec
1934  SgVector*&percentOfDiscards, // fcDISCARD
1935  SgVector*&uniformityFactors, // fcQBFACTOR
1936  SgVector*&geocenterPhaseResids, // fcGeocResidPhase
1937  SgVector*&geocenterPhaseTotals, // fcGeocPhase
1938  SgVector*&geocenterSbDelays, // fcGeocSBD
1939  SgVector*&geocenterGrDelays, // fcGeocMBD
1940  SgVector*&geocenterDelayRates, // fcGeocRate
1941  SgVector*&probOfFalses, // fcProbFalseDetection
1942  SgVector*&corrAprioriDelays, // fcABASDEL
1943  SgVector*&corrAprioriRates, // fcABASRATE
1944  SgVector*&corrAprioriAccs, // fcABASACCE
1945  SgVector*&incohAmps, // fcINCOHAMP
1946  SgVector*&incohAmps2, // fcINCOH2
1947  SgVector*&delayResids, // fcDELRESID
1948  QVector<QString>& vlb1FileNames, // fcVLB1FILE
1949  QVector<QString>& tapeIds_1, // fcTAPEID
1950  QVector<QString>& tapeIds_2, // fcTAPEID
1951  QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
1952  QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
1953  QVector< QVector<int> >& epochsOfFourfitings, // fcFOURFUTC
1954  QVector< QVector<int> >& epochsOfNominalScanTime, // fcUTCScan
1955  SgMatrix*&corrClocks, // fcCORCLOCK
1956  SgMatrix*&mDlys, // fcDLYEPOm1, fcDLYEPOCH, fcDLYEPOp1
1957  SgMatrix*&mAux // fcAPCLOFST, fcTOTPCENT, fcRATOBSVM,
1958  // fcUTCVLB2, fcDELOBSVM
1959 )
1960 {
1961  bool isOk=false;
1962  // reset the storages:
1963  fourfitOutputFName.clear();
1964  fourfitErrorCodes.clear();
1965 //corelVersions.clear();
1966  startOffsets.clear();
1967  fourfitVersions.clear();
1968 //dbeditVersion.clear();
1969  baselineCodes.clear();
1970  tapeQualityCodes.clear();
1971  stopOffsets.clear();
1972  hopsRevisionNumbers.clear();
1973  vlb1FileNames.clear();
1974  tapeIds_1.clear();
1975  tapeIds_2.clear();
1976  epochsOfCorrelations.clear();
1977  epochsOfCentrals.clear();
1978  epochsOfFourfitings.clear();
1979  epochsOfNominalScanTime.clear();
1980 
1981  QList<SgVector*> vecs2clear;
1982  QList<SgMatrix*> mats2clear;
1983 
1984  vecs2clear << deltaEpochs << sbdResids << rateResids << effDurations << startSeconds << stopSeconds
1985  << percentOfDiscards << uniformityFactors << geocenterPhaseResids << geocenterPhaseTotals
1986  << geocenterSbDelays << geocenterGrDelays << geocenterDelayRates << probOfFalses
1987  << corrAprioriDelays << corrAprioriRates << corrAprioriAccs << incohAmps << incohAmps2
1988  << delayResids << sampleRate;
1989  mats2clear << urvrs << instrDelays << searchParams << corrClocks << mDlys << mAux
1990  << starElev << zenithDelays;
1991 
1992  for (int i=0; i<vecs2clear.size(); i++)
1993  {
1994  SgVector *v=vecs2clear[i];
1995  if (v)
1996  {
1997  delete v;
1998  v = NULL;
1999  };
2000  };
2001  for (int i=0; i<mats2clear.size(); i++)
2002  {
2003  SgMatrix *m=mats2clear[i];
2004  if (m)
2005  {
2006  delete m;
2007  m = NULL;
2008  };
2009  };
2010  //
2011  //
2012  if (correlatorType_ == CT_Mk3 ||
2014  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
2015  deltaEpochs, searchParams, baselineCodes, tapeQualityCodes, sampleRate, sbdResids, rateResids,
2016  effDurations, startSeconds, stopSeconds, percentOfDiscards, geocenterPhaseResids,
2017  geocenterPhaseTotals, probOfFalses, corrAprioriDelays, corrAprioriRates, corrAprioriAccs,
2018  incohAmps, incohAmps2, delayResids, vlb1FileNames, epochsOfCorrelations, epochsOfCentrals,
2019  mDlys, mAux);
2020  else if ( correlatorType_ == CT_S2 )
2021  isOk = loadObsCorrelatorInfoS2(band, fourfitOutputFName, fourfitErrorCodes,
2022  deltaEpochs, searchParams, baselineCodes, tapeQualityCodes, sampleRate, sbdResids, rateResids,
2023  effDurations, startSeconds, stopSeconds, percentOfDiscards, geocenterPhaseResids,
2024  geocenterPhaseTotals, probOfFalses, corrAprioriDelays, corrAprioriRates, corrAprioriAccs,
2025  incohAmps, incohAmps2, delayResids, vlb1FileNames, epochsOfCorrelations, epochsOfCentrals,
2026  mDlys, mAux);
2027  else if ( correlatorType_ == CT_CRL ||
2028  correlatorType_ == CT_GSI )
2029  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
2030  deltaEpochs, searchParams, baselineCodes, tapeQualityCodes, sampleRate, sbdResids, rateResids,
2031  effDurations, startSeconds, stopSeconds, percentOfDiscards, geocenterPhaseResids,
2032  geocenterPhaseTotals, probOfFalses, corrAprioriDelays, corrAprioriRates, corrAprioriAccs,
2033  incohAmps, incohAmps2, delayResids, vlb1FileNames, epochsOfCorrelations, epochsOfCentrals,
2034  mDlys, mAux);
2035  else if ( correlatorType_ == CT_Mk4 ||
2038  isOk = loadObsCorrelatorInfoMk4(band, fourfitOutputFName, fourfitErrorCodes,
2039  startOffsets, fourfitVersions, deltaEpochs, urvrs, instrDelays, starElev, zenithDelays,
2040  searchParams, baselineCodes, tapeQualityCodes, stopOffsets, hopsRevisionNumbers,
2041  sbdResids, rateResids, effDurations, startSeconds, stopSeconds, percentOfDiscards,
2042  uniformityFactors, geocenterPhaseResids, geocenterPhaseTotals, geocenterSbDelays,
2043  geocenterGrDelays, geocenterDelayRates, probOfFalses, corrAprioriDelays, corrAprioriRates,
2044  corrAprioriAccs, incohAmps, incohAmps2, delayResids, tapeIds_1, tapeIds_2, epochsOfCorrelations,
2045  epochsOfCentrals, epochsOfFourfitings, epochsOfNominalScanTime, corrClocks);
2046  else
2047  {
2048  // Unknown, try each of types:
2050  "::loadObsCorrelatorInfo(): unknown correlator type, trying Mk4 data format");
2051 /*
2052  isOk = loadObsCorrelatorInfoMk4(band, fourfitOutputFName, fourfitErrorCodes,
2053  startSeconds, stopSeconds);
2054  if (!isOk)
2055  {
2056  logger->write(SgLogger::INF, SgLogger::IO_NCDF, className() +
2057  "::loadObsCorrelatorInfo(): unknown correlator type, trying S2 data format");
2058  isOk = loadObsCorrelatorInfoCrl(band, fourfitOutputFName, fourfitErrorCodes,
2059  startSeconds, stopSeconds);
2060  };
2061  if (!isOk)
2062  {
2063  logger->write(SgLogger::INF, SgLogger::IO_NCDF, className() +
2064  "::loadObsCorrelatorInfo(): unknown correlator type, trying Mk3 data format");
2065  isOk = loadObsCorrelatorInfoMk3(band, fourfitOutputFName, fourfitErrorCodes,
2066  startSeconds, stopSeconds);
2067  };
2068 */
2069  };
2070  return isOk;
2071 };
2072 
2073 
2074 
2075 //
2076 bool SgVgosDb::loadObsCorrelatorInfoCrl(const QString& band,
2077  QVector<QString>& fourfitOutputFName, // fcFOURFFIL
2078  QVector<QString>& fourfitErrorCodes, // fcFRNGERR
2079 //QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
2080  SgVector*&deltaEpochs, // fcDELTAEPO
2081  SgMatrix*&searchParams, // fcSRCHPAR
2082  QVector<QString>& baselineCodes, // fcCORBASCD
2083  QVector<QString>& tapeQualityCodes, // fcTapeCode
2084  SgVector*&sampleRate, // fcRECSETUP
2085  SgVector*&sbdResids, // fcSBRESID
2086  SgVector*&rateResids, // fcRATRESID
2087  SgVector*&effDurations, // fcEffectiveDuration
2088  SgVector*&startSeconds, // fcStartSec
2089  SgVector*&stopSeconds, // fcStopSec
2090  SgVector*&percentOfDiscards, // fcDISCARD
2091  SgVector*&geocenterPhaseResids, // fcGeocResidPhase
2092  SgVector*&geocenterPhaseTotals, // fcGeocPhase
2093  SgVector*&probOfFalses, // fcProbFalseDetection
2094  SgVector*&corrAprioriDelays, // fcABASDEL
2095  SgVector*&corrAprioriRates, // fcABASRATE
2096  SgVector*&corrAprioriAccs, // fcABASACCE
2097  SgVector*&incohAmps, // fcINCOHAMP
2098  SgVector*&incohAmps2, // fcINCOH2
2099  SgVector*&delayResids, // fcDELRESID
2100  QVector<QString>& vlb1FileNames, // fcVLB1FILE
2101  QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
2102  QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
2103  SgMatrix*&mDlys, // fcDLYEPOm1, fcDLYEPOCH, fcDLYEPOp1
2104  SgMatrix*&mAux // fcAPCLOFST, fcTOTPCENT, fcRATOBSVM,
2105  // fcUTCVLB2, fcDELOBSVM
2106 )
2107 {
2108  if (!bandDataByName_.contains(band))
2109  {
2111  "::loadObsCorrelatorInfoCrl(): the band \"" + band + "\" is not registered");
2112  return false;
2113  };
2114  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
2115  if (var.isEmpty())
2116  {
2118  "::loadObsCorrelatorInfoCrl(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
2119  return false;
2120  };
2121  //
2122  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
2123  ncdf.getData();
2124  if (!checkFormat(fcfCorrInfoKomb, ncdf))
2125  {
2127  "::loadObsCorrelatorInfoCrl(): format check failed");
2128  return false;
2129  };
2130  //
2131  //
2132  // strings:
2133  const char *pCORBASCD=ncdf.lookupVar(fcCORBASCD.name())?
2134  ncdf.lookupVar(fcCORBASCD.name())->data2char():NULL;
2135  const char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())?
2136  ncdf.lookupVar(fcFOURFFIL.name())->data2char():NULL;
2137  const char *pTapeCode=ncdf.lookupVar(fcTapeCode.name())?
2138  ncdf.lookupVar(fcTapeCode.name())->data2char():NULL;
2139  const char *pVLB1FILE=ncdf.lookupVar(fcVLB1FILE.name())?
2140  ncdf.lookupVar(fcVLB1FILE.name())->data2char():NULL;
2141  //
2142  // shorts:
2143  const short *pUTCCorr=ncdf.lookupVar(fcUTCCorr.name())?
2144  ncdf.lookupVar(fcUTCCorr.name())->data2short():NULL;
2145  const short *pUTCMidObs=ncdf.lookupVar(fcUTCMidObs.name())->data2short();
2146 //const short *pDBEDITVE=ncdf.lookupVar(fcDBEDITVE.name())->data2short();
2147  // non-mandatory:
2148  const short *pFRNGERR4S2=NULL;
2149  const char *pFRNGERR =NULL;
2150  const short *pRECSETUP=ncdf.lookupVar(fcRECSETUP.name())?
2151  ncdf.lookupVar(fcRECSETUP.name())->data2short():NULL;
2152  //const short *pUTCVLB2=ncdf.lookupVar(fcUTCVLB2.name())?
2153  // ncdf.lookupVar(fcUTCVLB2.name())->data2short():NULL;
2154  //
2155  // non-mandatory:
2156  // doubles:
2157  const double *pSRCHPAR=ncdf.lookupVar(fcSRCHPAR.name())->data2double();
2158  const double *pEffectiveDuration=
2160  const double *pDISCARD=ncdf.lookupVar(fcDISCARD.name())->data2double();
2161  const double *pGeocResidPhase=ncdf.lookupVar(fcGeocResidPhase.name())->data2double();
2162  const double *pProbFalseDetection=
2164  const double *pABASRATE=ncdf.lookupVar(fcABASRATE.name())?
2165  ncdf.lookupVar(fcABASRATE.name())->data2double():NULL;
2166  const double *pABASDEL=ncdf.lookupVar(fcABASDEL.name())?
2167  ncdf.lookupVar(fcABASDEL.name())->data2double():NULL;
2168  const double *pABASACCE=ncdf.lookupVar(fcABASACCE.name())?
2169  ncdf.lookupVar(fcABASACCE.name())->data2double():NULL;
2170  const double *pGeocPhase=ncdf.lookupVar(fcGeocPhase.name())->data2double();
2171  const double *pINCOHAMP=ncdf.lookupVar(fcINCOHAMP.name())->data2double();
2172  const double *pINCOH2=ncdf.lookupVar(fcINCOH2.name())->data2double();
2173  const double *pDELRESID=ncdf.lookupVar(fcDELRESID.name())->data2double();
2174  // non-mandatory:
2175  const double *pDELTAEPO=ncdf.lookupVar(fcDELTAEPO.name())?
2176  ncdf.lookupVar(fcDELTAEPO.name())->data2double():NULL;
2177  const double *pSBRESID=ncdf.lookupVar(fcSBRESID.name())?
2178  ncdf.lookupVar(fcSBRESID.name())->data2double():NULL;
2179  const double *pRATRESID=ncdf.lookupVar(fcRATRESID.name())?
2180  ncdf.lookupVar(fcRATRESID.name())->data2double():NULL;
2181  const double *pStartSec=ncdf.lookupVar(fcStartSec.name())?
2182  ncdf.lookupVar(fcStartSec.name())->data2double():NULL;
2183  const double *pStopSec=ncdf.lookupVar(fcStopSec.name())?
2184  ncdf.lookupVar(fcStopSec.name())->data2double():NULL;
2185  const double *pDLYEPOp1=ncdf.lookupVar(fcDLYEPOp1.name())?
2186  ncdf.lookupVar(fcDLYEPOp1.name())->data2double():NULL;
2187  const double *pDLYEPOCH=ncdf.lookupVar(fcDLYEPOCH.name())?
2188  ncdf.lookupVar(fcDLYEPOCH.name())->data2double():NULL;
2189  const double *pDLYEPOm1=ncdf.lookupVar(fcDLYEPOm1.name())?
2190  ncdf.lookupVar(fcDLYEPOm1.name())->data2double():NULL;
2191  const double *pAPCLOFST=ncdf.lookupVar(fcAPCLOFST.name())?
2192  ncdf.lookupVar(fcAPCLOFST.name())->data2double():NULL;
2193  const double *pTOTPCENT=ncdf.lookupVar(fcTOTPCENT.name())?
2194  ncdf.lookupVar(fcTOTPCENT.name())->data2double():NULL;
2195  const double *pRATOBSVM=ncdf.lookupVar(fcRATOBSVM.name())?
2196  ncdf.lookupVar(fcRATOBSVM.name())->data2double():NULL;
2197  const double *pDELOBSVM=ncdf.lookupVar(fcDELOBSVM.name())?
2198  ncdf.lookupVar(fcDELOBSVM.name())->data2double():NULL;
2199  //
2200  //
2201  double d;
2202  //
2203  // adjust the sizes:
2204  if (pFOURFFIL)
2205  fourfitOutputFName.resize(numOfObs_);
2206 
2207  // can be either char or int:
2208  if (ncdf.lookupVar(fcFRNGERR4S2.name()) &&
2210  pFRNGERR4S2 = ncdf.lookupVar(fcFRNGERR4S2.name())->data2short();
2211  else if (ncdf.lookupVar(fcFRNGERR.name()) &&
2213  pFRNGERR = ncdf.lookupVar(fcFRNGERR.name())->data2char();
2214 
2215  if (pFRNGERR || pFRNGERR4S2)
2216  fourfitErrorCodes.resize(numOfObs_);
2217  if (pCORBASCD)
2218  baselineCodes.resize(numOfObs_);
2219  if (pTapeCode)
2220  tapeQualityCodes.resize(numOfObs_);
2221  if (pVLB1FILE)
2222  vlb1FileNames.resize(numOfObs_);
2223 //dbeditVersion.resize(numOfObs_);
2224 
2225  // ?mandatory:
2226  epochsOfCorrelations.resize(numOfObs_);
2227  epochsOfCentrals.resize(numOfObs_);
2228  for (int i=0; i<numOfObs_; i++)
2229  {
2230 // dbeditVersion[i].resize(3);
2231  epochsOfCorrelations[i].resize(6);
2232  epochsOfCentrals[i].resize(6);
2233  };
2234  //
2235  if (pDELTAEPO)
2236  deltaEpochs = new SgVector(numOfObs_);
2237  if (pSBRESID)
2238  sbdResids = new SgVector(numOfObs_);
2239  if (pRATRESID)
2240  rateResids = new SgVector(numOfObs_);
2241  if (pEffectiveDuration)
2242  effDurations = new SgVector(numOfObs_);
2243  if (pStartSec)
2244  startSeconds = new SgVector(numOfObs_);
2245  if (pStopSec)
2246  stopSeconds = new SgVector(numOfObs_);
2247  if (pDISCARD)
2248  percentOfDiscards = new SgVector(numOfObs_);
2249  if (pGeocResidPhase)
2250  geocenterPhaseResids = new SgVector(numOfObs_);
2251  if (pGeocPhase)
2252  geocenterPhaseTotals = new SgVector(numOfObs_);
2253  if (pProbFalseDetection)
2254  probOfFalses = new SgVector(numOfObs_);
2255  if (pABASDEL)
2256  corrAprioriDelays = new SgVector(numOfObs_);
2257  if (pABASRATE)
2258  corrAprioriRates = new SgVector(numOfObs_);
2259  if (pABASACCE)
2260  corrAprioriAccs = new SgVector(numOfObs_);
2261  if (pINCOHAMP)
2262  incohAmps = new SgVector(numOfObs_);
2263  if (pINCOH2)
2264  incohAmps2 = new SgVector(numOfObs_);
2265  if (pDELRESID)
2266  delayResids = new SgVector(numOfObs_);
2267  //
2268  searchParams = new SgMatrix(numOfObs_, 6);
2269  //
2270  if (pRECSETUP)
2271  sampleRate = new SgVector(numOfObs_);
2272  if (pDLYEPOm1 || pDLYEPOCH || pDLYEPOp1)
2273  mDlys = new SgMatrix(numOfObs_, 3);
2274  if (pAPCLOFST || pTOTPCENT || pRATOBSVM || pDELOBSVM)
2275  mAux = new SgMatrix(numOfObs_, 4);
2276 
2277 
2278 //int lCORBASCD, lFOURFFIL, lTapeCode, lVLB1FILE;
2279  int lCORBASCD, lFOURFFIL, lFRNGERR, lTapeCode, lVLB1FILE;
2280  lCORBASCD = pCORBASCD?ncdf.lookupVar(fcCORBASCD.name())->dimensions().at(1)->getN():0;
2281  lFOURFFIL = pFOURFFIL?ncdf.lookupVar(fcFOURFFIL.name())->dimensions().at(1)->getN():0;
2282  lTapeCode = pTapeCode?ncdf.lookupVar(fcTapeCode.name())->dimensions().at(1)->getN():0;
2283  lVLB1FILE = pVLB1FILE?ncdf.lookupVar(fcVLB1FILE.name())->dimensions().at(1)->getN():0;
2284  lFRNGERR = 1;
2285 
2286  for (int i=0; i<numOfObs_; i++)
2287  {
2288  //
2289  // strings:
2290  if (pCORBASCD)
2291  baselineCodes[i] = QString::fromLatin1(pCORBASCD + lCORBASCD*i, lCORBASCD);
2292  if (pFOURFFIL)
2293  fourfitOutputFName[i] = QString::fromLatin1(pFOURFFIL + lFOURFFIL*i, lFOURFFIL);
2294  if (pTapeCode)
2295  tapeQualityCodes[i] = QString::fromLatin1(pTapeCode + lTapeCode*i, lTapeCode);
2296  //
2297  // shorts:
2298  for (int j=0; j<6; j++)
2299  {
2300  if (pUTCCorr)
2301  epochsOfCorrelations[i][j] = pUTCCorr[6*i + j];
2302  if (pUTCMidObs)
2303  epochsOfCentrals[i][j] = pUTCMidObs[6*i + j];
2304  };
2305 // dbeditVersion[i][0] = pDBEDITVE[3*i ];
2306 // dbeditVersion[i][1] = pDBEDITVE[3*i+1];
2307 // dbeditVersion[i][2] = pDBEDITVE[3*i+2];
2308  if (pSBRESID)
2309  sbdResids->setElement(i, pSBRESID[i]);
2310  if (pRATRESID)
2311  rateResids->setElement(i, pRATRESID[i]);
2312  if (pStartSec)
2313  {
2314  if (40000.0 < (d=pStartSec[i]))
2315  {
2317  "::loadObsCorrelatorInfoCrl(): got unexpected value for start second: " +
2318  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2319  d = 0.0;
2320  };
2321  startSeconds->setElement(i, d);
2322  };
2323  if (pStopSec)
2324  {
2325  if (40000.0 < (d=pStopSec[i]))
2326  {
2328  "::loadObsCorrelatorInfoCrl(): got unexpected value for stop second: " +
2329  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2330  d = 0.0;
2331  };
2332  stopSeconds->setElement(i, d);
2333  };
2334  if (pDELTAEPO)
2335  deltaEpochs->setElement(i, pDELTAEPO[i]);
2336  //
2337  // doubles:
2338  if (pEffectiveDuration)
2339  effDurations->setElement(i, pEffectiveDuration[i]);
2340  if (pABASRATE)
2341  corrAprioriRates->setElement(i, pABASRATE[i]);
2342  if (pABASDEL)
2343  corrAprioriDelays->setElement(i, pABASDEL[i]);
2344  if (pABASACCE)
2345  corrAprioriAccs->setElement(i, pABASACCE[i]);
2346  if (pDISCARD)
2347  percentOfDiscards->setElement(i, pDISCARD[i]);
2348  if (pGeocResidPhase)
2349  geocenterPhaseResids->setElement(i, pGeocResidPhase[i]);
2350  if (pGeocPhase)
2351  geocenterPhaseTotals->setElement(i, pGeocPhase[i]);
2352  if (pProbFalseDetection)
2353  probOfFalses->setElement(i, pProbFalseDetection[i]);
2354  if (pINCOHAMP)
2355  incohAmps->setElement(i, pINCOHAMP[i]);
2356  if (pINCOH2)
2357  incohAmps2->setElement(i, pINCOH2[i]);
2358  if (pDELRESID)
2359  delayResids->setElement(i, pDELRESID[i]);
2360  for (int j=0; j<6; j++)
2361  searchParams->setElement(i,j, pSRCHPAR[6*i + j]);
2362  //
2363  // GSI-specific variables:
2364  if (pVLB1FILE)
2365  vlb1FileNames[i] = QString::fromLatin1(pVLB1FILE + lVLB1FILE*i, lVLB1FILE);
2366 
2367  if (pFRNGERR)
2368  fourfitErrorCodes[i] = QString::fromLatin1(pFRNGERR + lFRNGERR*i, lFRNGERR);
2369  else if (pFRNGERR4S2)
2370  fourfitErrorCodes[i] = pFRNGERR4S2[i]==0?" ":"F";
2371 
2372  if (pRECSETUP)
2373  sampleRate->setElement(i, pRECSETUP[3*i]*1.0e3);
2374  if (pDLYEPOm1)
2375  mDlys->setElement(i,0, pDLYEPOm1[i]);
2376  if (pDLYEPOCH)
2377  mDlys->setElement(i,1, pDLYEPOCH[i]);
2378  if (pDLYEPOp1)
2379  mDlys->setElement(i,2, pDLYEPOp1[i]);
2380  if (pAPCLOFST)
2381  mAux->setElement(i, 0, pAPCLOFST[i]);
2382  if (pTOTPCENT)
2383  mAux->setElement(i, 1, pTOTPCENT[i]);
2384  if (pRATOBSVM)
2385  mAux->setElement(i, 2, pRATOBSVM[i]);
2386  if (pDELOBSVM)
2387  mAux->setElement(i, 3, (pDELOBSVM[2*i] + pDELOBSVM[2*i + 1])*1.0e-6);
2388  };
2390  "::loadObsCorrelatorInfoCrl(): data loaded successfully from " + ncdf.getFileName());
2391  return true;
2392 };
2393 
2394 
2395 
2396 //
2397 bool SgVgosDb::loadObsCorrelatorInfoS2(const QString& band,
2398  QVector<QString>& fourfitOutputFName, // fcFOURFFIL
2399  QVector<QString>& fourfitErrorCodes, // fcFRNGERR
2400 //QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
2401  SgVector*&deltaEpochs, // fcDELTAEPO
2402  SgMatrix*&searchParams, // fcSRCHPAR
2403  QVector<QString>& baselineCodes, // fcCORBASCD
2404  QVector<QString>& tapeQualityCodes, // fcTapeCode
2405  SgVector*&sampleRate, // fcRECSETUP
2406  SgVector*&sbdResids, // fcSBRESID
2407  SgVector*&rateResids, // fcRATRESID
2408  SgVector*&effDurations, // fcEffectiveDuration
2409  SgVector*&startSeconds, // fcStartSec
2410  SgVector*&stopSeconds, // fcStopSec
2411  SgVector*&percentOfDiscards, // fcDISCARD
2412  SgVector*&geocenterPhaseResids, // fcGeocResidPhase
2413  SgVector*&geocenterPhaseTotals, // fcGeocPhase
2414  SgVector*&probOfFalses, // fcProbFalseDetection
2415  SgVector*&corrAprioriDelays, // fcABASDEL
2416  SgVector*&corrAprioriRates, // fcABASRATE
2417  SgVector*&corrAprioriAccs, // fcABASACCE
2418  SgVector*&incohAmps, // fcINCOHAMP
2419  SgVector*&incohAmps2, // fcINCOH2
2420  SgVector*&delayResids, // fcDELRESID
2421  QVector<QString>& vlb1FileNames, // fcVLB1FILE
2422  QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
2423  QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
2424  SgMatrix*&mDlys, // fcDLYEPOm1, fcDLYEPOCH, fcDLYEPOp1
2425  SgMatrix*&mAux // fcAPCLOFST, fcTOTPCENT, fcRATOBSVM,
2426  // fcUTCVLB2, fcDELOBSVM
2427 )
2428 {
2429  if (!bandDataByName_.contains(band))
2430  {
2432  "::loadObsCorrelatorInfoS2(): the band \"" + band + "\" is not registered");
2433  return false;
2434  };
2435  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
2436  if (var.isEmpty())
2437  {
2439  "::loadObsCorrelatorInfoS2(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
2440  return false;
2441  };
2442  //
2443  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
2444  ncdf.getData();
2445  if (!checkFormat(fcfCorrInfoInptS2, ncdf))
2446  {
2448  "::loadObsCorrelatorInfoS2(): format check failed");
2449  return false;
2450  };
2451  //
2452  //
2453  // strings:
2454  const char *pVLB1FILE=ncdf.lookupVar(fcVLB1FILE.name())?
2455  ncdf.lookupVar(fcVLB1FILE.name())->data2char():NULL;
2456  // doubles:
2457  const short *pRECSETUP=ncdf.lookupVar(fcRECSETUP.name())?
2458  ncdf.lookupVar(fcRECSETUP.name())->data2short():NULL;
2459  const double *pSBRESID=ncdf.lookupVar(fcSBRESID.name())?
2460  ncdf.lookupVar(fcSBRESID.name())->data2double():NULL;
2461  const double *pRATRESID=ncdf.lookupVar(fcRATRESID.name())?
2462  ncdf.lookupVar(fcRATRESID.name())->data2double():NULL;
2463  const double *pDELRESID=ncdf.lookupVar(fcDELRESID.name())?
2464  ncdf.lookupVar(fcDELRESID.name())->data2double():NULL;
2465  const double *pStartSec=ncdf.lookupVar(fcStartSec.name())?
2466  ncdf.lookupVar(fcStartSec.name())->data2double():NULL;
2467  const double *pStopSec=ncdf.lookupVar(fcStopSec.name())?
2468  ncdf.lookupVar(fcStopSec.name())->data2double():NULL;
2469  const double *pGeocPhase=ncdf.lookupVar(fcGeocPhase.name())?
2470  ncdf.lookupVar(fcGeocPhase.name())->data2double():NULL;
2471 
2472  const double *pUTCErr=ncdf.lookupVar(fcUTCErr.name())?
2473  ncdf.lookupVar(fcUTCErr.name())->data2double():NULL;
2474  const double *pVFDWELL=ncdf.lookupVar(fcVFDWELL.name())?
2475  ncdf.lookupVar(fcVFDWELL.name())->data2double():NULL;
2476  const double *pS2EFFREQ=ncdf.lookupVar(fcS2EFFREQ.name())?
2477  ncdf.lookupVar(fcS2EFFREQ.name())->data2double():NULL;
2478  const double *pS2REFREQ=ncdf.lookupVar(fcS2REFREQ.name())?
2479  ncdf.lookupVar(fcS2REFREQ.name())->data2double():NULL;
2480  const double *pS2PHEFRQ=ncdf.lookupVar(fcS2PHEFRQ.name())?
2481  ncdf.lookupVar(fcS2PHEFRQ.name())->data2double():NULL;
2482  const double *pTotalFringeErr=ncdf.lookupVar(fcTotalFringeErr.name())?
2483  ncdf.lookupVar(fcTotalFringeErr.name())->data2double():NULL;
2484  const double *pDURATION=ncdf.lookupVar(fcDURATION.name())?
2485  ncdf.lookupVar(fcDURATION.name())->data2double():NULL;
2486  const double *pTimeSinceStart=ncdf.lookupVar(fcTimeSinceStart.name())?
2487  ncdf.lookupVar(fcTimeSinceStart.name())->data2double():NULL;
2488  //
2489  //
2490  double d;
2491  //
2492  //
2493  // adjust the sizes:
2494  if (pVLB1FILE)
2495  vlb1FileNames.resize(numOfObs_);
2496 
2497  //
2498  if (pRECSETUP)
2499  sampleRate = new SgVector(numOfObs_);
2500  if (pSBRESID)
2501  sbdResids = new SgVector(numOfObs_);
2502  if (pRATRESID)
2503  rateResids = new SgVector(numOfObs_);
2504  if (pDELRESID)
2505  delayResids = new SgVector(numOfObs_);
2506  if (pStartSec)
2507  startSeconds = new SgVector(numOfObs_);
2508  if (pStopSec)
2509  stopSeconds = new SgVector(numOfObs_);
2510  if (pGeocPhase)
2511  geocenterPhaseTotals = new SgVector(numOfObs_);
2512  if (pDURATION)
2513  effDurations = new SgVector(numOfObs_);
2514 
2515 
2516  int lVLB1FILE;
2517  lVLB1FILE = pVLB1FILE?ncdf.lookupVar(fcVLB1FILE.name())->dimensions().at(1)->getN():0;
2518 
2519  for (int i=0; i<numOfObs_; i++)
2520  {
2521  //
2522  // strings:
2523  if (pVLB1FILE)
2524  vlb1FileNames[i] = QString::fromLatin1(pVLB1FILE + lVLB1FILE*i, lVLB1FILE);
2525  // doubles:
2526  if (pRECSETUP)
2527  sampleRate->setElement(i, pRECSETUP[3*i]*1.0e3);
2528  if (pSBRESID)
2529  sbdResids->setElement(i, pSBRESID[i]);
2530  if (pRATRESID)
2531  rateResids->setElement(i, pRATRESID[i]);
2532  if (pDELRESID)
2533  delayResids->setElement(i, pDELRESID[i]);
2534  if (pStartSec)
2535  {
2536  if (40000.0 < (d=pStartSec[i]))
2537  {
2539  "::loadObsCorrelatorInfoS2(): got unexpected value for start second: " +
2540  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2541  d = 0.0;
2542  };
2543  startSeconds->setElement(i, d);
2544  };
2545  if (pStopSec)
2546  {
2547  if (40000.0 < (d=pStopSec[i]))
2548  {
2550  "::loadObsCorrelatorInfoS2(): got unexpected value for stop second: " +
2551  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2552  d = 0.0;
2553  };
2554  stopSeconds->setElement(i, d);
2555  };
2556  if (pGeocPhase)
2557  geocenterPhaseTotals->setElement(i, pGeocPhase[i]);
2558 
2559  if (pDURATION)
2560  effDurations->setElement(i, pDURATION[i]);
2561 
2562  };
2564  "::loadObsCorrelatorInfoS2(): data loaded successfully from " + ncdf.getFileName());
2565  return true;
2566 };
2567 
2568 
2569 
2570 
2571 //
2572 bool SgVgosDb::loadObsCorrelatorInfoMk4(const QString& band,
2573  QVector<QString>& fourfitOutputFName, // fcFOURFFIL
2574  QVector<QString>& fourfitErrorCodes, // fcFRNGERR
2575 //QVector<int>& corelVersions, // fcCORELVER
2576  QVector<int>& startOffsets, // fcStartOffset
2577  QVector< QVector<int> >& fourfitVersions, // fcFOURFVER
2578 //QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
2579  SgVector*&deltaEpochs, // fcDELTAEPO
2580  SgMatrix*&urvrs, // fcURVR
2581  SgMatrix*&instrDelays, // fcIDELAY
2582  SgMatrix*&starElev, // fcSTARELEV
2583  SgMatrix*&zenithDelays, // fcZDELAY
2584  SgMatrix*&searchParams, // fcSRCHPAR
2585  QVector<QString>& baselineCodes, // fcCORBASCD
2586  QVector<QString>& tapeQualityCodes, // fcTapeCode
2587  QVector<int>& stopOffsets, // fcStopOffset
2588  QVector<int>& hopsRevisionNumbers, // fcHopsRevNum
2589  SgVector*&sbdResids, // fcSBRESID
2590  SgVector*&rateResids, // fcRATRESID
2591  SgVector*&effDurations, // fcEffectiveDuration
2592  SgVector*&startSeconds, // fcStartSec
2593  SgVector*&stopSeconds, // fcStopSec
2594  SgVector*&percentOfDiscards, // fcDISCARD
2595  SgVector*&uniformityFactors, // fcQBFACTOR
2596  SgVector*&geocenterPhaseResids, // fcGeocResidPhase
2597  SgVector*&geocenterPhaseTotals, // fcGeocPhase
2598  SgVector*&geocenterSbDelays, // fcGeocSBD
2599  SgVector*&geocenterGrDelays, // fcGeocMBD
2600  SgVector*&geocenterDelayRates, // fcGeocRate
2601  SgVector*&probOfFalses, // fcProbFalseDetection
2602  SgVector*&corrAprioriDelays, // fcABASDEL
2603  SgVector*&corrAprioriRates, // fcABASRATE
2604  SgVector*&corrAprioriAccs, // fcABASACCE
2605  SgVector*&incohAmps, // fcINCOHAMP
2606  SgVector*&incohAmps2, // fcINCOH2
2607  SgVector*&delayResids, // fcDELRESID
2608  QVector<QString>& tapeIds_1, // fcTAPEID
2609  QVector<QString>& tapeIds_2, // fcTAPEID
2610  QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
2611  QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
2612  QVector< QVector<int> >& epochsOfFourfitings, // fcFOURFUTC
2613  QVector< QVector<int> >& epochsOfNominalScanTime, // fcUTCScan
2614  SgMatrix*&corrClocks // fcCORCLOCK
2615  )
2616 {
2617  if (!bandDataByName_.contains(band))
2618  {
2620  "::loadObsCorrelatorInfoMk4(): the band \"" + band + "\" is not registered");
2621  return false;
2622  };
2623  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
2624  if (var.isEmpty())
2625  {
2627  "::loadObsCorrelatorInfoMk4(): the vgosDb variable CorrInfo for the band [" + band + "] is empty");
2628  return false;
2629  };
2630  //
2631  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
2632  ncdf.getData();
2633  if (!checkFormat(fcfCorrInfoMk4, ncdf))
2634  {
2636  "::loadObsCorrelatorInfoMk4(): format check failed");
2637  return false;
2638  };
2639  //
2640  //
2641 
2642  // strings:
2643  const char *pCORBASCD=ncdf.lookupVar(fcCORBASCD.name())?
2644  ncdf.lookupVar(fcCORBASCD.name())->data2char():NULL;
2645  const char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())?
2646  ncdf.lookupVar(fcFOURFFIL.name())->data2char():NULL;
2647  const char *pFRNGERR=ncdf.lookupVar(fcFRNGERR.name())?
2648  ncdf.lookupVar(fcFRNGERR.name())->data2char():NULL;
2649  const char *pTAPEID=ncdf.lookupVar(fcTAPEID.name())?
2650  ncdf.lookupVar(fcTAPEID.name())->data2char():NULL;
2651  const char *pTapeCode=ncdf.lookupVar(fcTapeCode.name())?
2652  ncdf.lookupVar(fcTapeCode.name())->data2char():NULL;
2653 
2654  // shorts:
2655  const short *pUTCCorr=ncdf.lookupVar(fcUTCCorr.name())?
2656  ncdf.lookupVar(fcUTCCorr.name())->data2short():NULL;
2657  const short *pUTCMidObs=ncdf.lookupVar(fcUTCMidObs.name())->data2short();
2658 //const short *pDBEDITVE=ncdf.lookupVar(fcDBEDITVE.name())->data2short();
2659  // non-mandatory:
2660 //const short *pCORELVER=ncdf.lookupVar(fcCORELVER.name())?
2661 // ncdf.lookupVar(fcCORELVER.name())->data2short():NULL;
2662  const short *pFOURFVER=ncdf.lookupVar(fcFOURFVER.name())?
2663  ncdf.lookupVar(fcFOURFVER.name())->data2short():NULL;
2664  const short *pStartOffset=ncdf.lookupVar(fcStartOffset.name())?
2665  ncdf.lookupVar(fcStartOffset.name())->data2short():NULL;
2666  const short *pStopOffset=ncdf.lookupVar(fcStopOffset.name())?
2667  ncdf.lookupVar(fcStopOffset.name())->data2short():NULL;
2668  const short *pHopsRevNum=ncdf.lookupVar(fcHopsRevNum.name())?
2669  ncdf.lookupVar(fcHopsRevNum.name())->data2short():NULL;
2670  const short *pFOURFUTC=ncdf.lookupVar(fcFOURFUTC.name())?
2671  ncdf.lookupVar(fcFOURFUTC.name())->data2short():NULL;
2672  const short *pUTCScan=ncdf.lookupVar(fcUTCScan.name())?
2673  ncdf.lookupVar(fcUTCScan.name())->data2short():NULL;
2674  // doubles:
2675  const double *pSRCHPAR=ncdf.lookupVar(fcSRCHPAR.name())->data2double();
2676  const double *pEffectiveDuration=
2678  const double *pDISCARD=ncdf.lookupVar(fcDISCARD.name())->data2double();
2679  const double *pGeocResidPhase=ncdf.lookupVar(fcGeocResidPhase.name())->data2double();
2680  const double *pProbFalseDetection=
2682  const double *pABASRATE=ncdf.lookupVar(fcABASRATE.name())?
2683  ncdf.lookupVar(fcABASRATE.name())->data2double():NULL;
2684  const double *pABASDEL=ncdf.lookupVar(fcABASDEL.name())?
2685  ncdf.lookupVar(fcABASDEL.name())->data2double():NULL;
2686  const double *pABASACCE=ncdf.lookupVar(fcABASACCE.name())?
2687  ncdf.lookupVar(fcABASACCE.name())->data2double():NULL;
2688  const double *pGeocPhase=ncdf.lookupVar(fcGeocPhase.name())->data2double();
2689  const double *pINCOHAMP=ncdf.lookupVar(fcINCOHAMP.name())->data2double();
2690  const double *pINCOH2=ncdf.lookupVar(fcINCOH2.name())->data2double();
2691  const double *pDELRESID=ncdf.lookupVar(fcDELRESID.name())->data2double();
2692  // non-mandatory:
2693  const double *pURVR=ncdf.lookupVar(fcURVR.name())?
2694  ncdf.lookupVar(fcURVR.name())->data2double():NULL;
2695  const double *pIDELAY=ncdf.lookupVar(fcIDELAY.name())?
2696  ncdf.lookupVar(fcIDELAY.name())->data2double():NULL;
2697  const double *pSTARELEV=ncdf.lookupVar(fcSTARELEV.name())?
2698  ncdf.lookupVar(fcSTARELEV.name())->data2double():NULL;
2699  const double *pZDELAY=ncdf.lookupVar(fcZDELAY.name())?
2700  ncdf.lookupVar(fcZDELAY.name())->data2double():NULL;
2701  const double *pQBFACTOR=ncdf.lookupVar(fcQBFACTOR.name())?
2702  ncdf.lookupVar(fcQBFACTOR.name())->data2double():NULL;
2703  const double *pGeocSBD=ncdf.lookupVar(fcGeocSBD.name())?
2704  ncdf.lookupVar(fcGeocSBD.name())->data2double():NULL;
2705  const double *pGeocRate=ncdf.lookupVar(fcGeocRate.name())?
2706  ncdf.lookupVar(fcGeocRate.name())->data2double():NULL;
2707  const double *pGeocMBD=ncdf.lookupVar(fcGeocMBD.name())?
2708  ncdf.lookupVar(fcGeocMBD.name())->data2double():NULL;
2709  const double *pCORCLOCK=ncdf.lookupVar(fcCORCLOCK.name())?
2710  ncdf.lookupVar(fcCORCLOCK.name())->data2double():NULL;
2711  const double *pDELTAEPO=ncdf.lookupVar(fcDELTAEPO.name())?
2712  ncdf.lookupVar(fcDELTAEPO.name())->data2double():NULL;
2713  const double *pSBRESID=ncdf.lookupVar(fcSBRESID.name())?
2714  ncdf.lookupVar(fcSBRESID.name())->data2double():NULL;
2715  const double *pRATRESID=ncdf.lookupVar(fcRATRESID.name())?
2716  ncdf.lookupVar(fcRATRESID.name())->data2double():NULL;
2717  const double *pStartSec=ncdf.lookupVar(fcStartSec.name())?
2718  ncdf.lookupVar(fcStartSec.name())->data2double():NULL;
2719  const double *pStopSec=ncdf.lookupVar(fcStopSec.name())?
2720  ncdf.lookupVar(fcStopSec.name())->data2double():NULL;
2721  //
2722  bool have2swapGeocMbdAndRate=false;
2723  double d;
2724  //
2725  // workaround for the bug of swapped geocentric MBD and rates:
2726  SgNcdfVariable *svcV;
2727  if ( (svcV=ncdf.lookupServiceVar(SgNetCdf::svcProgram)) )
2728  {
2729  const char *c=svcV->data2char();
2730  int l=svcV->dimensions().at(0)->getN();
2731  SgVersion v;
2732  if (v.parseString(QString::fromLatin1(c, l)))
2733  {
2734  if (v.getSoftwareName() == "vgosDbMake" &&
2735  v < SgVersion("", 0, 4, 4, "", tZero))
2736  {
2737  have2swapGeocMbdAndRate = true;
2739  "::loadObsCorrelatorInfoMk4(): found a file with the geocentric delay and rate swap bug; "
2740  "the bug has been corrected");
2741  };
2742  };
2743  };
2744 
2745  //
2746  // adjust the sizes:
2747  if (pFOURFFIL)
2748  fourfitOutputFName.resize(numOfObs_);
2749  if (pFRNGERR)
2750  fourfitErrorCodes.resize(numOfObs_);
2751  if (pCORBASCD)
2752  baselineCodes.resize(numOfObs_);
2753  if (pTapeCode)
2754  tapeQualityCodes.resize(numOfObs_);
2755  if (pTAPEID)
2756  {
2757  tapeIds_1.resize(numOfObs_);
2758  tapeIds_2.resize(numOfObs_);
2759  };
2760 //corelVersions.resize(numOfObs_);
2761  if (pStartOffset)
2762  startOffsets.resize(numOfObs_);
2763  if (pStopOffset)
2764  stopOffsets.resize(numOfObs_);
2765  if (pHopsRevNum)
2766  hopsRevisionNumbers.resize(numOfObs_);
2767  if (pFOURFVER)
2768  fourfitVersions.resize(numOfObs_);
2769 //dbeditVersion.resize(numOfObs_);
2770  epochsOfCorrelations.resize(numOfObs_);
2771  epochsOfCentrals.resize(numOfObs_);
2772  if (pFOURFUTC)
2773  epochsOfFourfitings.resize(numOfObs_);
2774  if (pUTCScan)
2775  epochsOfNominalScanTime.resize(numOfObs_);
2776  for (int i=0; i<numOfObs_; i++)
2777  {
2778  fourfitVersions[i].resize(2);
2779 // dbeditVersion[i].resize(3);
2780  epochsOfCorrelations[i].resize(6);
2781  epochsOfCentrals[i].resize(6);
2782  if (pFOURFUTC)
2783  epochsOfFourfitings[i].resize(6);
2784  if (pUTCScan)
2785  epochsOfNominalScanTime[i].resize(6);
2786  };
2787  //
2788  if (pDELTAEPO)
2789  deltaEpochs = new SgVector(numOfObs_);
2790  if (pSBRESID)
2791  sbdResids = new SgVector(numOfObs_);
2792  if (pRATRESID)
2793  rateResids = new SgVector(numOfObs_);
2794  effDurations = new SgVector(numOfObs_);
2795  if (pStartSec)
2796  startSeconds = new SgVector(numOfObs_);
2797  if (pStopSec)
2798  stopSeconds = new SgVector(numOfObs_);
2799  percentOfDiscards = new SgVector(numOfObs_);
2800  if (pQBFACTOR)
2801  uniformityFactors = new SgVector(numOfObs_);
2802  geocenterPhaseResids = new SgVector(numOfObs_);
2803  geocenterPhaseTotals = new SgVector(numOfObs_);
2804  if (pGeocSBD)
2805  geocenterSbDelays = new SgVector(numOfObs_);
2806  if (pGeocMBD)
2807  geocenterGrDelays = new SgVector(numOfObs_);
2808  if (pGeocRate)
2809  geocenterDelayRates = new SgVector(numOfObs_);
2810  probOfFalses = new SgVector(numOfObs_);
2811  corrAprioriDelays = new SgVector(numOfObs_);
2812  corrAprioriRates = new SgVector(numOfObs_);
2813  corrAprioriAccs = new SgVector(numOfObs_);
2814  incohAmps = new SgVector(numOfObs_);
2815  incohAmps2 = new SgVector(numOfObs_);
2816  delayResids = new SgVector(numOfObs_);
2817  if (pURVR)
2818  urvrs = new SgMatrix(numOfObs_, 2);
2819  if (pIDELAY)
2820  instrDelays = new SgMatrix(numOfObs_, 2);
2821  if (pSTARELEV)
2822  starElev = new SgMatrix(numOfObs_, 2);
2823  if (pZDELAY)
2824  zenithDelays = new SgMatrix(numOfObs_, 2);
2825  searchParams = new SgMatrix(numOfObs_, 6);
2826  if (pCORCLOCK)
2827  corrClocks = new SgMatrix(numOfObs_, 4);
2828  //
2829 //int lCORBASCD, lFOURFFIL, lFRNGERR, lTAPEID, lTapeCode;
2830  int lCORBASCD, lFOURFFIL, lFRNGERR, lTAPEID, lTapeCode;
2831  lCORBASCD = pCORBASCD?ncdf.lookupVar(fcCORBASCD.name())->dimensions().at(1)->getN():0;
2832  lFOURFFIL = pFOURFFIL?ncdf.lookupVar(fcFOURFFIL.name())->dimensions().at(1)->getN():0;
2833 //lFRNGERR = pFRNGERR ?ncdf.lookupVar(fcFRNGERR.name()) ->dimensions().at(1)->getN():0;
2834  lFRNGERR = 1;
2835  lTAPEID = pTAPEID ?ncdf.lookupVar(fcTAPEID.name()) ->dimensions().at(2)->getN():0;
2836  lTapeCode = pTapeCode?ncdf.lookupVar(fcTapeCode.name())->dimensions().at(1)->getN():0;
2837 
2838  for (int i=0; i<numOfObs_; i++)
2839  {
2840  //
2841  // strings:
2842  if (pCORBASCD)
2843  baselineCodes[i] = QString::fromLatin1(pCORBASCD + lCORBASCD*i, lCORBASCD);
2844  if (pFOURFFIL)
2845  fourfitOutputFName[i] = QString::fromLatin1(pFOURFFIL + lFOURFFIL*i, lFOURFFIL);
2846  if (pFRNGERR)
2847  fourfitErrorCodes[i] = QString::fromLatin1(pFRNGERR + lFRNGERR*i, lFRNGERR);
2848  if (pTAPEID)
2849  {
2850  tapeIds_1[i] = QString::fromLatin1(pTAPEID + lTAPEID*2*i, 2*lTAPEID);
2851  tapeIds_2[i] = QString::fromLatin1(pTAPEID + lTAPEID*(2*i + 1), 2*lTAPEID);
2852  };
2853  if (pTapeCode)
2854  tapeQualityCodes[i] = QString::fromLatin1(pTapeCode + lTapeCode*i, lTapeCode);
2855  //
2856  // shorts:
2857  for (int j=0; j<6; j++)
2858  {
2859  if (pUTCCorr)
2860  epochsOfCorrelations[i][j] = pUTCCorr[6*i + j];
2861  if (pUTCMidObs)
2862  epochsOfCentrals[i][j] = pUTCMidObs[6*i + j];
2863  if (pFOURFUTC)
2864  epochsOfFourfitings[i][j] = pFOURFUTC[6*i + j];
2865  if (pUTCScan)
2866  epochsOfNominalScanTime[i][j] = pUTCScan[6*i + j];
2867  };
2868 // dbeditVersion[i][0] = pDBEDITVE[3*i ];
2869 // dbeditVersion[i][1] = pDBEDITVE[3*i+1];
2870 // dbeditVersion[i][2] = pDBEDITVE[3*i+2];
2871 // if (pCORELVER)
2872 // corelVersions[i] = pCORELVER[i];
2873  if (pStartOffset)
2874  startOffsets[i] = pStartOffset[i];
2875  if (pStopOffset)
2876  stopOffsets[i] = pStopOffset[i];
2877  if (pHopsRevNum)
2878  hopsRevisionNumbers[i] = pHopsRevNum[i];
2879  if (pFOURFVER)
2880  {
2881  fourfitVersions[i][0] = pFOURFVER[2*i ];
2882  fourfitVersions[i][1] = pFOURFVER[2*i+1];
2883  };
2884  //
2885  // doubles:
2886  effDurations->setElement(i, pEffectiveDuration[i]);
2887  if (pABASRATE)
2888  corrAprioriRates->setElement(i, pABASRATE[i]);
2889  if (pABASDEL)
2890  corrAprioriDelays->setElement(i, pABASDEL[i]);
2891  if (pABASACCE)
2892  corrAprioriAccs->setElement(i, pABASACCE[i]);
2893  percentOfDiscards->setElement(i, pDISCARD[i]);
2894  geocenterPhaseResids->setElement(i, pGeocResidPhase[i]);
2895  geocenterPhaseTotals->setElement(i, pGeocPhase[i]);
2896  probOfFalses->setElement(i, pProbFalseDetection[i]);
2897  incohAmps->setElement(i, pINCOHAMP[i]);
2898  incohAmps2->setElement(i, pINCOH2[i]);
2899  delayResids->setElement(i, pDELRESID[i]);
2900  for (int j=0; j<6; j++)
2901  searchParams->setElement(i,j, pSRCHPAR[6*i + j]);
2902  //
2903  if (pSBRESID)
2904  sbdResids->setElement(i, pSBRESID[i]);
2905  if (pRATRESID)
2906  rateResids->setElement(i, pRATRESID[i]);
2907  if (pStartSec)
2908  {
2909  if (40000.0 < (d=pStartSec[i]))
2910  {
2912  "::loadObsCorrelatorInfoMk4(): got unexpected value for start second: " +
2913  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2914  d = 0.0;
2915  };
2916  startSeconds->setElement(i, d);
2917  };
2918  if (pStopSec)
2919  {
2920  if (40000.0 < (d=pStopSec[i]))
2921  {
2923  "::loadObsCorrelatorInfoMk4(): got unexpected value for stop second: " +
2924  QString("").setNum(d) + " for obs #" + QString("").setNum(i));
2925  d = 0.0;
2926  };
2927  stopSeconds->setElement(i, d);
2928  };
2929  if (pDELTAEPO)
2930  deltaEpochs->setElement(i, pDELTAEPO[i]);
2931  if (pGeocSBD)
2932  geocenterSbDelays->setElement(i, pGeocSBD[i]);
2933 
2934  if (have2swapGeocMbdAndRate)
2935  {
2936  if (pGeocMBD)
2937  geocenterGrDelays->setElement(i, pGeocRate[i]);
2938  if (pGeocRate)
2939  geocenterDelayRates->setElement(i, pGeocMBD[i]);
2940  }
2941  else
2942  {
2943  if (pGeocMBD)
2944  geocenterGrDelays->setElement(i, pGeocMBD[i]);
2945  if (pGeocRate)
2946  geocenterDelayRates->setElement(i, pGeocRate[i]);
2947  };
2948 
2949  if (pQBFACTOR)
2950  uniformityFactors->setElement(i, pQBFACTOR[i]);
2951 
2952  if (pURVR)
2953  {
2954  urvrs->setElement(i,0, pURVR[2*i ]);
2955  urvrs->setElement(i,1, pURVR[2*i+1]);
2956  };
2957  if (pIDELAY)
2958  {
2959  instrDelays->setElement(i,0, pIDELAY[2*i ]);
2960  instrDelays->setElement(i,1, pIDELAY[2*i+1]);
2961  };
2962  if (pSTARELEV)
2963  {
2964  starElev->setElement(i,0, pSTARELEV[2*i ]);
2965  starElev->setElement(i,1, pSTARELEV[2*i+1]);
2966  };
2967  if (pZDELAY)
2968  {
2969  zenithDelays->setElement(i,0, pZDELAY[2*i ]);
2970  zenithDelays->setElement(i,1, pZDELAY[2*i+1]);
2971  };
2972  if (pCORCLOCK)
2973  {
2974  corrClocks->setElement(i,0, pCORCLOCK[4*i ]);
2975  corrClocks->setElement(i,1, pCORCLOCK[4*i + 1]);
2976  corrClocks->setElement(i,2, pCORCLOCK[4*i + 2]);
2977  corrClocks->setElement(i,3, pCORCLOCK[4*i + 3]);
2978  };
2979  };
2981  "::loadObsCorrelatorInfoMk4(): data loaded successfully from " + ncdf.getFileName());
2982  return true;
2983 };
2984 
2985 
2986 
2987 
2988 //
2989 bool SgVgosDb::loadObsEditData(QVector<int>& delUFlag, QVector<int>& phsUFlag, QVector<int>& ratUFlag,
2990  QVector<int>& uAcSup)
2991 {
2992  if (vEdit_.isEmpty())
2993  {
2995  "::loadObsEditData(): the vgosDb variable Edit is empty");
2996  return false;
2997  };
2998  SgNetCdf ncdf(path2RootDir_ + "/" + vEdit_.getFileName());
2999  ncdf.getData();
3000  if (!checkFormat(*fcfEdit, ncdf))
3001  {
3003  "::loadObsEditData(): format check failed");
3004  return false;
3005  };
3006  const short *pDel=ncdf.lookupVar(fcDelayFlag.name())->data2short();
3007  const short *pRat=ncdf.lookupVar(fcRateFlag .name())->data2short();
3008  const short *pPha=ncdf.lookupVar(fcPhaseFlag.name())?
3009  ncdf.lookupVar(fcPhaseFlag.name())->data2short():NULL;
3010  const short *pUsS=ncdf.lookupVar(fcUserSup .name())?
3011  ncdf.lookupVar(fcUserSup .name())->data2short():NULL;
3012  delUFlag.resize(numOfObs_);
3013  phsUFlag.resize(numOfObs_);
3014  ratUFlag.resize(numOfObs_);
3015  if (inputFormatVersion_ == 1.001)
3016  uAcSup .resize(numOfObs_);
3017  for (int i=0; i<numOfObs_; i++)
3018  {
3019  delUFlag[i] = pDel[i];
3020  ratUFlag[i] = pRat[i];
3021  phsUFlag[i] = pPha?pPha[i]:0;
3022  if (inputFormatVersion_ == 1.001)
3023  uAcSup [i] = pUsS?pUsS[i]:-32768;
3024  };
3025  //
3026  if (1.002 <= inputFormatVersion_)
3027  loadObsUserSup(uAcSup);
3028  //
3030  "::loadObsEditData(): data loaded successfully from " + ncdf.getFileName());
3031  return true;
3032 };
3033 
3034 
3035 
3036 //
3037 bool SgVgosDb::loadObsUserSup(QVector<int>& uAcSup)
3038 {
3040  if (var.isEmpty())
3041  {
3043  "::loadObsUserSup(): the vgosDb variable UserSup is empty");
3044  return false;
3045  };
3046  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3047  ncdf.getData();
3048  if (!checkFormat(fcfUserSup, ncdf))
3049  {
3051  "::loadObsUserSup(): format check failed");
3052  return false;
3053  };
3054  const short *pUsS=ncdf.lookupVar(fcUserSup .name())?
3055  ncdf.lookupVar(fcUserSup .name())->data2short():NULL;
3056  if (!pUsS)
3057  {
3059  "::loadObsUserSup(): nothing to get");
3060  return false;
3061  }
3062  uAcSup .resize(numOfObs_);
3063  for (int i=0; i<numOfObs_; i++)
3064  uAcSup [i] = pUsS[i];
3066  "::loadObsUserSup(): data loaded successfully from " + ncdf.getFileName());
3067  return true;
3068 };
3069 
3070 
3071 
3072 //
3073 bool SgVgosDb::loadObsNumGroupAmbigs(const QString &band, QVector<int> &numAmbigs,
3074  QVector<int> &numSubAmbigs)
3075 {
3076  numAmbigs .clear();
3077  numSubAmbigs.clear();
3078 
3079  if (!bandDataByName_.contains(band))
3080  {
3082  "::loadObsNumGroupAmbigs(): the band \"" + band + "\" is not registered");
3083  return false;
3084  };
3085  SgVdbVariable &var=bandDataByName_[band].vNumGroupAmbig_;
3086  if (var.isEmpty())
3087  {
3089  "::loadObsNumGroupAmbigs(): the vgosDb variable NumGroupAmbig for the band [" + band + "] is empty");
3090  return false;
3091  };
3092  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3093  ncdf.getData();
3094  //
3095  if (checkFormat(fcfNumGroupAmbigE, ncdf))
3096  {
3097  const short *pN=ncdf.lookupVar(fcNumGroupAmbig.name())->data2short();
3098  const short *pS=ncdf.lookupVar(fcNumGroupSubAmbig.name())?
3099  ncdf.lookupVar(fcNumGroupSubAmbig.name())->data2short():NULL;
3100  numAmbigs .resize(numOfObs_);
3101  if (pS)
3102  numSubAmbigs.resize(numOfObs_);
3103  for (int i=0; i<numOfObs_; i++)
3104  {
3105  numAmbigs [i] = pN[i];
3106  if (pS)
3107  numSubAmbigs[i] = pS[i];
3108  };
3110  "::loadObsNumGroupAmbigs(): data " + (pS?"(E) ":"") +
3111  "were successfully loaded from " + ncdf.getFileName());
3112  return true;
3113  }
3114  else if (!checkFormat(fcfNumGroupAmbig, ncdf))
3115  {
3117  "::loadObsNumGroupAmbigs(): format (E) check failed");
3118  return false;
3119  };
3120  const short *p=ncdf.lookupVar(fcNumGroupAmbig.name())->data2short();
3121  numAmbigs.resize(numOfObs_);
3122  for (int i=0; i<numOfObs_; i++)
3123  numAmbigs[i] = p[i];
3125  "::loadObsNumGroupAmbigs(): data loaded successfully from " + ncdf.getFileName());
3126  return true;
3127 };
3128 
3129 
3130 
3131 //
3132 bool SgVgosDb::loadObsNumPhaseAmbigs(const QString &band, QVector<int> &numAmbigs)
3133 {
3134  numAmbigs .clear();
3135  //
3136  if (!bandDataByName_.contains(band))
3137  {
3139  "::loadObsNumPhaseAmbigs(): the band \"" + band + "\" is not registered");
3140  return false;
3141  };
3142  SgVdbVariable &var=bandDataByName_[band].vNumPhaseAmbig_;
3143  if (var.isEmpty())
3144  {
3146  "::loadObsNumPhaseAmbigs(): the vgosDb variable NumPhaseAmbig for the band [" + band + "] is empty");
3147  return false;
3148  };
3149  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3150  ncdf.getData();
3151  //
3152  if (!checkFormat(fcfNumPhaseAmbig, ncdf))
3153  {
3155  "::loadObsNumPhaseAmbigs(): format check failed");
3156  return false;
3157  };
3158  const int *p=ncdf.lookupVar(fcNumPhaseAmbig.name())->data2int();
3159  numAmbigs.resize(numOfObs_);
3160  for (int i=0; i<numOfObs_; i++)
3161  numAmbigs[i] = p[i];
3163  "::loadObsNumPhaseAmbigs(): data loaded successfully from " + ncdf.getFileName());
3164  return true;
3165 };
3166 
3167 
3168 
3169 //
3170 bool SgVgosDb::loadObsCalIonGroup(const QString& band, SgMatrix*& ionCals, SgMatrix*& ionSigmas,
3171  QVector<int> &ionDataFlag)
3172 {
3173  if (!bandDataByName_.contains(band))
3174  {
3176  "::loadObsCalIonGroup(): the band \"" + band + "\" is not registered");
3177  return false;
3178  };
3179  SgVdbVariable &var=bandDataByName_[band].vCal_SlantPathIonoGroup_;
3180  if (var.isEmpty())
3181  {
3183  "::loadObsCalIonGroup(): the vgosDb variable Cal_SlantPathIonoGroup for the band [" + band +
3184  "] is empty");
3185  return false;
3186  };
3187  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3188  ncdf.getData();
3190  {
3192  "::loadObsCalIonGroup(): format check failed");
3193  return false;
3194  };
3195  const double *pVal=ncdf.lookupVar(fcCalIonoGroup .name())->data2double();
3196  const double *pSig=ncdf.lookupVar(fcCalIonoGroupSigma .name())->data2double();
3197  const short *pFlg=ncdf.lookupVar(fcCalIonoGroupDataFlag.name())?
3199  ionCals = new SgMatrix(numOfObs_, 2);
3200  ionSigmas = new SgMatrix(numOfObs_, 2);
3201  ionDataFlag.resize(numOfObs_);
3202  for (int i=0; i<numOfObs_; i++)
3203  {
3204  ionCals->setElement (i, 0, pVal[2*i ]);
3205  ionCals->setElement (i, 1, pVal[2*i + 1]);
3206  ionSigmas->setElement(i, 0, pSig[2*i ]);
3207  ionSigmas->setElement(i, 1, pSig[2*i + 1]);
3208  ionDataFlag[i] = pFlg?pFlg[i]:0;
3209  };
3211  "::loadObsCalIonGroup(): data loaded successfully from " + ncdf.getFileName());
3212  return true;
3213 };
3214 
3215 
3216 
3217 //
3218 // Load of Calibrations:
3219 //
3220 //
3221 bool SgVgosDb::loadStdObsCalibration(SgMatrix*& cals, QString& origin,
3222  const QString& varName, const SgVdbVariable& odbV, const SgVgosDb::FmtChkVar& fc,
3223  const QList<SgVgosDb::FmtChkVar*>& fcf, bool isMandatory)
3224 {
3225  origin = "";
3226  if (odbV.isEmpty())
3227  {
3229  "::loadStdObsCalibration(): the vgosDb variable " + varName + " is empty");
3230  return false;
3231  };
3232  SgNetCdf ncdf(path2RootDir_ + "/" + odbV.getFileName());
3233  ncdf.getData();
3234  if (!checkFormat(fcf, ncdf))
3235  {
3237  "::loadStdObsCalibration(): format check failed");
3238  return false;
3239  };
3240  SgNcdfVariable *nV=ncdf.lookupVar(fc.name());
3241  if (!nV)
3242  {
3244  "::loadStdObsCalibration(): the variable " + fc.name() + " was not found in the file");
3245  return false;
3246  };
3247  int nRow=nV->dimensions().at(0)->getN();
3248  int nCol=nV->dimensions().size()==1?1:nV->dimensions().at(1)->getN();
3249  const double *p=nV->data2double();
3250  cals = new SgMatrix(nRow, nCol);
3251  for (int i=0; i<nRow; i++)
3252  for (int j=0; j<nCol; j++)
3253  cals->setElement(i, j, p[nCol*i + j]);
3254  //
3255  //
3256  SgNcdfVariable *svcV;
3257  if ( (svcV=ncdf.lookupServiceVar(SgNetCdf::svcDataOrigin)) )
3258  {
3259  const char *c=svcV->data2char();
3260  int l=svcV->dimensions().at(0)->getN();
3261  origin = QString::fromLatin1(c, l);
3262  }
3263  else
3265  "::loadStdObsCalibration(): cannot find service variable \"" + SgNetCdf::svcDataOrigin +
3266  "\" in " + ncdf.getFileName());
3267  //
3268  //
3270  "::loadStdObsCalibration(): data loaded successfully from " + ncdf.getFileName());
3271  return true;
3272 };
3273 
3274 
3275 
3276 //
3277 bool SgVgosDb::loadObsCalEarthTide(SgMatrix*& cals, QString &kind)
3278 {
3279  bool isOk;
3280  QString origin;
3281  kind = "";
3282  isOk = loadStdObsCalibration(cals, origin, "Cal-EarthTide",
3284  kind = vCal_EarthTide_.getKind();
3285  return isOk;
3286 };
3287 
3288 
3289 
3290 //
3292 {
3293  QString origin;
3294  return loadStdObsCalibration(cals, origin, "Cal-FeedCorrection",
3296 };
3297 
3298 
3299 
3300 //
3301 bool SgVgosDb::loadObsCalFeedCorr(const QString& band, SgMatrix*& contrib)
3302 {
3303  if (!bandDataByName_.contains(band))
3304  {
3306  "::loadObsCalFeedCorr(): the band \"" + band + "\" is not registered");
3307  return false;
3308  };
3309  SgVdbVariable &var=bandDataByName_[band].vCal_FeedCorrection_;
3310  if (var.isEmpty())
3311  {
3313  "::loadObsCalFeedCorr(): the vgosDb variable Cal_FeedCorrection for the band [" + band +
3314  "] is empty");
3315  return false;
3316  };
3317  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3318  ncdf.getData();
3319  if (!checkFormat(fcfCalFeedCorrection, ncdf))
3320  {
3322  "::loadObsCalFeedCorr(): format check failed");
3323  return false;
3324  };
3325  const double *p=ncdf.lookupVar(fcCalFeedCorrection.name())?
3327  if (!p)
3328  {
3330  "::loadObsCalFeedCorr(): cannot find the variable " + fcCalFeedCorrection.name() + " in the file");
3331  return false;
3332  };
3333  contrib = new SgMatrix(numOfObs_, 2);
3334  for (int i=0; i<numOfObs_; i++)
3335  {
3336  contrib->setElement(i,0, p[2*i ]);
3337  contrib->setElement(i,1, p[2*i + 1]);
3338  };
3340  "::loadObsCalFeedCorr(): data loaded successfully from " + ncdf.getFileName());
3341  return true;
3342 };
3343 
3344 
3345 
3346 //
3347 bool SgVgosDb::loadObsCalHiFyErp(SgMatrix*& calsUt, SgMatrix*& calsXY, QString &kind)
3348 {
3349  kind = "";
3350  if (vCal_HfErp_.isEmpty())
3351  {
3353  "::loadObsCalHiFyErp(): the vgosDb variable Cal_HfErp is empty");
3354  return false;
3355  };
3357  ncdf.getData();
3358  if (!checkFormat(fcfCalHiFyErp, ncdf))
3359  {
3361  "::loadObsCalHiFyErp(): format check failed");
3362  return false;
3363  };
3364  const double *pUt=ncdf.lookupVar(fcCalUt1Ortho.name())->data2double();
3365  const double *pPm=ncdf.lookupVar(fcCalWobOrtho.name())->data2double();
3366  calsUt = new SgMatrix(numOfObs_, 2);
3367  calsXY = new SgMatrix(numOfObs_, 2);
3368  for (int i=0; i<numOfObs_; i++)
3369  {
3370  calsUt->setElement(i,0, pUt[2*i]);
3371  calsUt->setElement(i,1, pUt[2*i + 1]);
3372  calsXY->setElement(i,0, pPm[2*i]);
3373  calsXY->setElement(i,1, pPm[2*i + 1]);
3374  };
3375  kind = vCal_HfErp_.getKind();
3377  "::loadObsCalHiFyErp(): data loaded successfully from " + ncdf.getFileName());
3378  return true;
3379 };
3380 
3381 
3382 
3383 //
3385 {
3386  QString origin;
3387  return loadStdObsCalibration(cals, origin, "Cal-OceanLoad",
3389 };
3390 
3391 
3392 
3393 //
3395 {
3396  QString origin;
3397  return loadStdObsCalibration(cals, origin, "Cal-OceanLoadOld", vCal_OceanLoadOld_, fcCalOceanLoadOld,
3398  fcfCalOceanLoadOld, false);
3399 };
3400 
3401 
3402 
3403 //
3405 {
3406  QString origin;
3407  return loadStdObsCalibration(cals, origin, "Cal-OceanPoleTideLoad", vCal_OceanPoleTideLoad_,
3409 };
3410 
3411 
3412 
3413 //
3414 bool SgVgosDb::loadObsCalPoleTide(SgMatrix*& cals, QString &kind)
3415 {
3416  bool isOk;
3417  QString origin;
3418  kind = "";
3419  isOk = loadStdObsCalibration(cals, origin, "Cal-PoleTide",
3421  kind = vCal_PoleTide_.getKind();
3422  return isOk;
3423 };
3424 
3425 
3426 
3427 //
3429 {
3430  QString origin;
3431  return loadStdObsCalibration(cals, origin, "Cal-PoleTideOldRestore",
3433 };
3434 
3435 
3436 
3437 //
3439 {
3440  QString origin;
3441  return loadStdObsCalibration(cals, origin, "Cal-TiltRemover",
3443 };
3444 
3445 
3446 
3447 //
3449 {
3451  if (var.isEmpty())
3452  {
3454  "::loadObsFractC(): the vgosDb variable FractC is empty");
3455  return false;
3456  };
3457  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3458  ncdf.getData();
3459  if (!checkFormat(fcfFractC, ncdf))
3460  {
3462  "::loadObsFractC(): format check failed");
3463  return false;
3464  };
3465  const double *p=ncdf.lookupVar(fcFractC.name())?
3466  ncdf.lookupVar(fcFractC.name())->data2double():NULL;
3467  if (!p)
3468  {
3470  "::loadObsFractC(): nothing to get");
3471  return false;
3472  }
3473  v = new SgVector(numOfObs_);
3474  for (int i=0; i<numOfObs_; i++)
3475  v->setElement(i, p[i]);
3477  "::loadObsFractC(): data loaded successfully from " + ncdf.getFileName());
3478  return true;
3479 };
3480 
3481 
3482 
3483 //
3484 bool SgVgosDb::loadObsCalUnphase(const QString& band, SgMatrix*& unPhaseCal_1, SgMatrix*& unPhaseCal_2)
3485 {
3486  if (!bandDataByName_.contains(band))
3487  {
3489  "::loadObsCalUnphase(): the band \"" + band + "\" is not registered");
3490  return false;
3491  };
3492  SgVdbVariable &var=bandDataByName_[band].vCal_Unphase_;
3493  if (var.isEmpty())
3494  {
3496  "::loadObsCalUnphase(): the vgosDb variable Cal_Unphase for the band [" + band + "] is empty");
3497  return false;
3498  };
3499  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3500  ncdf.getData();
3501  if (!checkFormat(fcfCalUnphase, ncdf))
3502  {
3504  "::loadObsCalUnphase(): format check failed");
3505  return false;
3506  };
3507  const double *p=ncdf.lookupVar(fcCalUnPhase.name())?
3508  ncdf.lookupVar(fcCalUnPhase.name())->data2double():NULL;
3509  if (!p)
3510  {
3512  "::loadObsCalUnphase(): cannot find the variable " + fcCalUnPhase.name() + " in the file");
3513  return false;
3514  };
3515  unPhaseCal_1 = new SgMatrix(numOfObs_, 2);
3516  unPhaseCal_2 = new SgMatrix(numOfObs_, 2);
3517  for (int i=0; i<numOfObs_; i++)
3518  {
3519  unPhaseCal_1->setElement(i,0, p[4*i ]);
3520  unPhaseCal_2->setElement(i,0, p[4*i + 1]);
3521  unPhaseCal_1->setElement(i,1, p[4*i + 2]);
3522  unPhaseCal_2->setElement(i,1, p[4*i + 3]);
3523  };
3525  "::loadObsCalUnphase(): data loaded successfully from " + ncdf.getFileName());
3526  return true;
3527 };
3528 
3529 
3530 
3531 //
3532 bool SgVgosDb::loadObsCalHiFyLibration(SgMatrix*& cals, QString &kind)
3533 {
3534  bool isOk;
3535  QString origin;
3536  kind = "";
3537  isOk = loadStdObsCalibration(cals, origin, "Cal-HiFreqLibration",
3539  kind = vCal_HfLibration_.getKind();
3540  return isOk;
3541 };
3542 
3543 
3544 
3545 
3546 //
3547 bool SgVgosDb::loadObsCalHiFyLibration(SgMatrix*& calsPm, SgMatrix*& calsUt, QString &kind)
3548 {
3549  kind = "";
3551  {
3553  "::loadObsCalHiFreqLibration(): the vgosDb variable Cal_HiFreqLibration is empty");
3554  return false;
3555  };
3557  ncdf.getData();
3558  if (!checkFormat(fcfCalHiFreqLibration, ncdf))
3559  {
3561  "::loadObsCalHiFreqLibration(): format check failed");
3562  return false;
3563  };
3564  const double *pUt=ncdf.lookupVar(fcCalHiFreqLibrationUt.name())?
3566  const double *pPm=ncdf.lookupVar(fcCalHiFreqLibrationPm.name())?
3568  if (pUt)
3569  calsUt = new SgMatrix(numOfObs_, 2);
3570  if (pPm)
3571  calsPm = new SgMatrix(numOfObs_, 2);
3572  for (int i=0; i<numOfObs_; i++)
3573  {
3574  if (pUt)
3575  {
3576  calsUt->setElement(i,0, pUt[2*i ]);
3577  calsUt->setElement(i,1, pUt[2*i + 1]);
3578  };
3579  if (pPm)
3580  {
3581  calsPm->setElement(i,0, pPm[2*i ]);
3582  calsPm->setElement(i,1, pPm[2*i + 1]);
3583  };
3584  };
3585  kind = vCal_HiFreqLibration_.getKind();
3587  "::loadObsCalHiFreqLibration(): data loaded successfully from " + ncdf.getFileName());
3588  return true;
3589 };
3590 
3591 
3592 
3593 //
3594 bool SgVgosDb::loadObsCalWobble(SgMatrix*& calsXwobble, SgMatrix*& calsYwobble)
3595 {
3596  if (vCal_Wobble_.isEmpty())
3597  {
3599  "::loadObsCalWobble(): the vgosDb variable Cal-Wobble is empty");
3600  return false;
3601  };
3603  ncdf.getData();
3604  if (!checkFormat(fcfCalWobble, ncdf))
3605  {
3607  "::loadObsCalWobble(): format check failed");
3608  return false;
3609  };
3610  const double *pX=ncdf.lookupVar(fcCalXwobble.name())->data2double();
3611  const double *pY=ncdf.lookupVar(fcCalYwobble.name())->data2double();
3612  calsXwobble = new SgMatrix(numOfObs_, 2);
3613  calsYwobble = new SgMatrix(numOfObs_, 2);
3614  for (int i=0; i<numOfObs_; i++)
3615  {
3616  calsXwobble->setElement(i,0, pX[2*i ]);
3617  calsXwobble->setElement(i,1, pX[2*i + 1]);
3618  calsYwobble->setElement(i,0, pY[2*i ]);
3619  calsYwobble->setElement(i,1, pY[2*i + 1]);
3620  };
3622  "::loadObsCalWobble(): data loaded successfully from " + ncdf.getFileName());
3623  return true;
3624 };
3625 
3626 
3627 
3628 //
3630 {
3631  QString origin;
3632  return loadStdObsCalibration(cals, origin, "Cal-Bend",
3633  vCal_Bend_, fcCalBend, fcfCalBend, false);
3634 };
3635 
3636 
3637 
3638 //
3640 {
3641  QString origin;
3642  return loadStdObsCalibration(cals, origin, "Cal-BendSun",
3644 };
3645 
3646 
3647 
3648 //
3650 {
3651  QString origin;
3652  return loadStdObsCalibration(cals, origin, "Cal-BendSunHigher",
3654 };
3655 
3656 
3657 
3658 //
3660 {
3661  QString origin;
3662  return loadStdObsCalibration(cals, origin, "Cal-Parallax",
3664 };
3665 
3666 
3667 
3668 //
3669 //
3670 // Load of Partials:
3671 //
3672 //
3674 {
3675  if (vPart_Bend_.isEmpty())
3676  {
3678  "::loadObsPartBend(): the vgosDb variable Part-Bend is empty");
3679  return false;
3680  };
3682  ncdf.getData();
3683  if (!checkFormat(fcfPart_Bend, ncdf))
3684  {
3686  "::loadObsPartBend(): format check failed");
3687  return false;
3688  };
3689  const double *p=ncdf.lookupVar(fcPartBend.name())->data2double();
3690  partBend = new SgMatrix(numOfObs_, 2);
3691  for (int i=0; i<numOfObs_; i++)
3692  {
3693  partBend->setElement(i, 0, p[2*i ]);
3694  partBend->setElement(i, 1, p[2*i + 1]);
3695  };
3697  "::loadObsPartBend(): data loaded successfully from " + ncdf.getFileName());
3698  return true;
3699 };
3700 
3701 
3702 
3703 //
3705 {
3707  if (var.isEmpty())
3708  {
3710  "::loadObsPartGamma(): the vgosDb variable \"" + var.getStub() + "\" is empty");
3711  return false;
3712  };
3713  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3714  ncdf.getData();
3715  if (!checkFormat(fcfPart_Gamma, ncdf))
3716  {
3718  "::loadObsPartGamma(): format check failed");
3719  return false;
3720  };
3721  const double *p=ncdf.lookupVar(fcPartGamma.name())->data2double();
3722  part = new SgMatrix(numOfObs_, 2);
3723  for (int i=0; i<numOfObs_; i++)
3724  {
3725  part->setElement(i, 0, p[2*i ]);
3726  part->setElement(i, 1, p[2*i + 1]);
3727  };
3729  "::loadObsPartGamma(): data loaded successfully from " + ncdf.getFileName());
3730  return true;
3731 };
3732 
3733 
3734 
3735 //
3737 {
3739  if (var.isEmpty())
3740  {
3742  "::loadObsPartParallax(): the vgosDb variable \"" + var.getStub() + "\" is empty");
3743  return false;
3744  };
3745  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3746  ncdf.getData();
3747  if (!checkFormat(fcfPart_Parallax, ncdf))
3748  {
3750  "::loadObsPartParallax(): format check failed");
3751  return false;
3752  };
3753  const double *p=ncdf.lookupVar(fcPartParallax.name())->data2double();
3754  part = new SgMatrix(numOfObs_, 2);
3755  for (int i=0; i<numOfObs_; i++)
3756  {
3757  part->setElement(i, 0, p[2*i ]);
3758  part->setElement(i, 1, p[2*i + 1]);
3759  };
3761  "::loadObsPartParallax(): data loaded successfully from " + ncdf.getFileName());
3762  return true;
3763 };
3764 
3765 
3766 
3767 //
3768 bool SgVgosDb::loadObsPartPoleTides(SgMatrix*& partX, SgMatrix*& partY, QString& kind)
3769 {
3771  kind = "";
3772  if (var.isEmpty())
3773  {
3775  "::loadObsPartPoleTides(): the vgosDb variable \"" + var.getStub() + "\" is empty");
3776  return false;
3777  };
3778  SgNetCdf ncdf(path2RootDir_ + "/" + var.getFileName());
3779  ncdf.getData();
3780  if (!checkFormat(fcfPart_PolarTide, ncdf))
3781  {
3783  "::loadObsPartPoleTides(): format check failed");
3784  return false;
3785  };
3786  const double *p=ncdf.lookupVar(fcPartPolarTide.name())->data2double();
3787  partX = new SgMatrix(numOfObs_, 2);
3788  partY = new SgMatrix(numOfObs_, 2);
3789  for (int i=0; i<numOfObs_; i++)
3790  {
3791  partX->setElement(i, 0, p[4*i ]);
3792  partY->setElement(i, 0, p[4*i + 1]);
3793  partX->setElement(i, 1, p[4*i + 2]);
3794  partY->setElement(i, 1, p[4*i + 3]);
3795  };
3796  kind = var.getKind();
3798  "::loadObsPartPoleTides(): data loaded successfully from " + ncdf.getFileName());
3799  return true;
3800 };
3801 
3802 
3803 
3804 //
3805 bool SgVgosDb::loadObsPartEOP(SgMatrix*& dV_dPx, SgMatrix*& dV_dPy, SgMatrix*& dV_dUT1)
3806 {
3807  if (vPart_Erp_.isEmpty())
3808  {
3810  "::loadObsPartEOP(): the vgosDb variable Part-Erp is empty");
3811  return false;
3812  };
3813  SgNetCdf ncdf(path2RootDir_ + "/" + vPart_Erp_.getFileName());
3814  ncdf.getData();
3815  if (!checkFormat(fcfPart_Erp, ncdf))
3816  {
3818  "::loadObsPartEOP(): format check failed");
3819  return false;
3820  };
3821  const double *pPm=ncdf.lookupVar(fcPartWobble.name())->data2double();
3822  const double *pUt=ncdf.lookupVar(fcPartUt1 .name())->data2double();
3823  dV_dPx = new SgMatrix(numOfObs_, 2);
3824  dV_dPy = new SgMatrix(numOfObs_, 2);
3825  dV_dUT1 = new SgMatrix(numOfObs_, 4);
3826  for (int i=0; i<numOfObs_; i++)
3827  {
3828  dV_dPx ->setElement(i, 0, pPm[4*i ]);
3829  dV_dPy ->setElement(i, 0, pPm[4*i + 1]);
3830  dV_dPx ->setElement(i, 1, pPm[4*i + 2]);
3831  dV_dPy ->setElement(i, 1, pPm[4*i + 3]);
3832 
3833  dV_dUT1->setElement(i, 0, pUt[4*i ]);
3834  dV_dUT1->setElement(i, 1, pUt[4*i + 1]);
3835  dV_dUT1->setElement(i, 2, pUt[4*i + 2]);
3836  dV_dUT1->setElement(i, 3, pUt[4*i + 3]);
3837  };
3839  "::loadObsPartEOP(): data loaded successfully from " + ncdf.getFileName());
3840  return true;
3841 };
3842 
3843 
3844 
3845 //
3846 bool SgVgosDb::loadObsPartNut2KXY(SgMatrix*& dV_dCipX, SgMatrix*& dV_dCipY, QString& kind)
3847 {
3848  kind = "";
3850  {
3852  "::loadObsPartNut2KXY(): the vgosDb variable Part-NutationNRO is empty");
3853  return false;
3854  };
3856  ncdf.getData();
3857  if (!checkFormat(fcfPart_NutationNro, ncdf))
3858  {
3860  "::loadObsPartNut2KXY(): format check failed");
3861  return false;
3862  };
3863  const double *p=ncdf.lookupVar(fcPartNutationNro.name())?
3864  ncdf.lookupVar(fcPartNutationNro.name())->data2double():NULL;
3865  if (!p)
3866  {
3868  "::loadObsPartNut2KXY(): cannot find variable " + fcPartNutationNro.name() + " in the file");
3869  return false;
3870  };
3871  dV_dCipX = new SgMatrix(numOfObs_, 2);
3872  dV_dCipY = new SgMatrix(numOfObs_, 2);
3873  for (int i=0; i<numOfObs_; i++)
3874  {
3875  dV_dCipX->setElement(i, 0, p[2*2*i ]);
3876  dV_dCipY->setElement(i, 0, p[2*2*i + 1]);
3877  dV_dCipX->setElement(i, 1, p[2*2*i + 2]);
3878  dV_dCipY->setElement(i, 1, p[2*2*i + 3]);
3879  };
3880  kind = vPart_NutationNro_.getKind();
3882  "::loadObsPartNut2KXY(): data loaded successfully from " + ncdf.getFileName());
3883  return true;
3884 };
3885 
3886 
3887 
3888 //
3890 {
3891  if (vPart_RaDec_.isEmpty())
3892  {
3894  "::loadObsPartRaDec(): the vgosDb variable Part-RaDec is empty");
3895  return false;
3896  };
3898  ncdf.getData();
3899  if (!checkFormat(fcfPart_RaDec, ncdf))
3900  {
3902  "::loadObsPartRaDec(): format check failed");
3903  return false;
3904  };
3905  const double *p=ncdf.lookupVar(fcPartRaDec.name())->data2double();
3906  dV_dRA = new SgMatrix(numOfObs_, 2);
3907  dV_dDN = new SgMatrix(numOfObs_, 2);
3908  for (int i=0; i<numOfObs_; i++)
3909  {
3910  dV_dRA->setElement(i, 0, p[2*2*i ]);
3911  dV_dDN->setElement(i, 0, p[2*2*i + 1]);
3912  dV_dRA->setElement(i, 1, p[2*2*i + 2]);
3913  dV_dDN->setElement(i, 1, p[2*2*i + 3]);
3914  };
3916  "::loadObsPartRaDec(): data loaded successfully from " + ncdf.getFileName());
3917  return true;
3918 };
3919 
3920 
3921 
3922 //
3923 bool SgVgosDb::loadObsPartXYZ(SgMatrix*& dTau_dR_1, SgMatrix*& dRat_dR_1)
3924 {
3925  if (vPart_Xyz_.isEmpty())
3926  {
3928  "::loadObsPartXYZ(): the vgosDb variable Part-XYZ is empty");
3929  return false;
3930  };
3931  SgNetCdf ncdf(path2RootDir_ + "/" + vPart_Xyz_.getFileName());
3932  ncdf.getData();
3933  if (!checkFormat(fcfPart_Xyz, ncdf))
3934  {
3936  "::loadObsPartXYZ(): format check failed");
3937  return false;
3938  };
3939  const double *p=ncdf.lookupVar(fcPartXyz.name())->data2double();
3940  dTau_dR_1 = new SgMatrix(numOfObs_, 3);
3941  dRat_dR_1 = new SgMatrix(numOfObs_, 3);
3942  for (int i=0; i<numOfObs_; i++)
3943  {
3944  dTau_dR_1->setElement(i, 0, p[2*3*i ]);
3945  dTau_dR_1->setElement(i, 1, p[2*3*i + 1]);
3946  dTau_dR_1->setElement(i, 2, p[2*3*i + 2]);
3947  dRat_dR_1->setElement(i, 0, p[2*3*i + 3 ]);
3948  dRat_dR_1->setElement(i, 1, p[2*3*i + 3 + 1]);
3949  dRat_dR_1->setElement(i, 2, p[2*3*i + 3 + 2]);
3950  };
3952  "::loadObsPartXYZ(): data loaded successfully from " + ncdf.getFileName());
3953  return true;
3954 };
3955 
3956 
3957 
3958 //
3959 bool SgVgosDb::loadObsUserCorrections(int idx, SgMatrix* m, QString& name)
3960 {
3961  if (idx<0 || obsUserCorrections_.size()-1<idx)
3962  {
3964  "::loadObsUserCorrections(): index " + QString("").setNum(idx) + " out of range");
3965  return false;
3966  };
3967  const SgVdbVariable *var=obsUserCorrections_.at(idx);
3968  if (!var)
3969  {
3971  "::loadObsUserCorrections(): the var #" + QString("").setNum(idx) + " is NULL");
3972  return false;
3973  };
3974  if (var->isEmpty())
3975  {
3977  "::loadObsUserCorrections(): the vgosDb variable " + var->getStub() + " is empty");
3978  return false;
3979  };
3980  //
3981  SgNetCdf ncdf(path2RootDir_ + "/" + var->getFileName());
3982  ncdf.getData();
3983  if (!checkFormat(fcfUserCorrections, ncdf))
3984  {
3986  "::loadObsUserCorrections(): format check failed");
3987  return false;
3988  };
3989  const double *p=ncdf.lookupVar(fcUserCorrections.name())->data2double();
3990  for (int i=0; i<numOfObs_; i++)
3991  {
3992  m->setElement(i, idx, p[i]);
3993  };
3994  name = var->getFileName4Output();
3996  "::loadObsUserCorrections(): data loaded successfully from " + ncdf.getFileName());
3997  return true;
3998 };
3999 
4000 
4001 
4002 
4003 /*=====================================================================================================*/
4004 
4005 
4006 
4007 
4008 
4009 /*=====================================================================================================*/
4010 //
4011 // Constants:
4012 //
4013 const QList<int>
4016 
4017 // Variable descriptions:
4019  fcBaseline ("Baseline", NC_CHAR, true, QList<int>() << SD_NumObs << 2 << 8,
4020  "BASELINE", "Ref and rem site names"),
4021  fcSource ("Source", NC_CHAR, true, QList<int>() << SD_NumObs << 8,
4022  "STAR ID ", "Radio source name"),
4023  fcObs2Baseline ("Obs2Baseline", NC_SHORT, true, QList<int>() << SD_NumObs << 2,
4024  "", "Cross reference from observation to baseline"),
4025  fcObs2Scan ("Obs2Scan", NC_INT, true, QList<int>() << SD_NumObs,
4026  "", "Cross reference from observation to scan"),
4027  fcCrossRefSourceList("CrossRefSourceList",NC_CHAR, true, QList<int>() << SD_NumSrc << 8,
4028  "", "A list of sources names"),
4029  fcScan2Source ("Scan2Source", NC_INT, true, QList<int>() << SD_NumScans,
4030  "", "Cross reference scan to source"),
4031  fcNumScansPerStation("NumScansPerStation",NC_INT, true, QList<int>() << SD_NumStn,
4032  "", "Number of scans per station."),
4034  ("CrossRefStationList",NC_CHAR, true, QList<int>() << SD_NumStn << 8,
4035  "", "Site names in alphabetical order"),
4036  fcStation2Scan ("Station2Scan", NC_INT, true, QList<int>() << SD_Any << SD_NumStn,
4037  "", "Cross reference station-scan to schedule-scan"),
4038  fcScan2Station ("Scan2Station", NC_INT, true, QList<int>() << SD_NumScans << SD_NumStn,
4039  "", "Cross reference scans to station"),
4040  fcSBDelay ("SBDelay", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4041  "SB DELAY", "Single band delay", "second", "?"),
4042  fcSBDelaySig ("SBDelaySig", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4043  "SB SIGMA", "Single band delay error", "second", "?"),
4044  fcGroupDelay ("GroupDelay", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4045  "DEL OBSV", "Delay observable produced by fringing", "second", "?"),
4046  fcGroupDelaySig ("GroupDelaySig", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4047  "DELSIGMA", "Delay Measurement Sigma", "second", "?"),
4048  fcGroupRate ("GroupRate", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4049  "RAT OBSV", "Rate Observable", "second/second", "?"),
4050  fcGroupRateSig ("GroupRateSig", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4051  "RATSIGMA", "Rate Measurement Sigma", "second/second", "?"),
4052  fcPhase ("Phase", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4053  "TOTPHASE", "Total phase", "radian", "?"),
4054  fcPhaseSig ("PhaseSig", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4055  "", "Total phase sigma", "radian", "?"),
4056  fcGroupDelayFull ("GroupDelayFull", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4057  "", "Delay Observable with ambiguities resolved and added.", "second", "?"),
4058  fcPhaseDelayFull ("PhaseDelayFull", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4059  "", "Phase Delay \"Observable\" with ambiguities resolved and added.", "second", "?"),
4060  fcPhaseDelaySigFull ("PhaseDelaySigFull", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4061  "", "Phase Delay Sigma", "second", "?"),
4062  fcRefFreq ("RefFreq", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4063  "REF FREQ", "Frequency to which phase is referenced", "MHz", "?"),
4064  fcFreqRateIon ("FreqRateIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4065  "", "Effective Group Rate Ionospheric Frequency", "MHz", "?"),
4066  fcFreqPhaseIon ("FreqPhaseIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4067  "PHIONFRQ", "Effective Phase Delay Ionospheric Frequency", "MHz", "?"),
4068  fcFreqGroupIon ("FreqGroupIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4069  "GRIONFRQ", "Effective Group Delay Ionospheric Frequency", "MHz", "?"),
4070  fcFreqRateIonEqWgts ("FreqRateIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4071  "", "Effective Group Rate Ionospheric Frequency. All channels equal wt.", "MHz", "?"),
4072  fcFreqPhaseIonEqWgts("FreqPhaseIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4073  "", "Effective Phase Delay Ionospheric Frequency. All channels equal wt.", "MHz", "?"),
4074  fcFreqGroupIonEqWgts("FreqGroupIono", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4075  "", "Effective Group Delay Ionospheric Frequency. All channels equal wt.", "MHz", "?"),
4076  fcDtec ("diffTec", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4077  "", "Difference of the total electron contents", "TEC units"),
4078  fcDtecStdErr ("diffTecStdDev", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4079  "", "Standard deviation of dTec estimation", "TEC units"),
4080  fcAmbigSize ("AmbigSize", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4081  "GPDLAMBG", "Group delay ambiguity spacing", "second", "?"),
4082  fcQualityCode ("QualityCode", NC_CHAR, true, QList<int>() << SD_NumObs,
4083  "QUALCODE", "FRNGE quality index 0 --> 9", "", "?"),
4084  fcCorrelation ("Correlation", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4085  "COHERCOR", "Corr coeff (0 --> 1)", "", "?"),
4086  fcSNR ("SNR", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4087  "SNRATIO ", "Signal to noise ratio", "", "?"),
4088  fcDelayDataFlag ("DelayDataFlag", NC_SHORT, true, QList<int>() << SD_NumObs ),
4089  fcDataFlag ("DataFlag", NC_SHORT, false,QList<int>() << SD_NumObs,
4090  "", "0=OK, -1=Missing, -2=bad,-3=sigma small, -4=sigma big", "", "?"),
4091  fcDelayTheoretical ("DelayTheoretical", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4092  "CONSNDEL", "Consensus theoretical delay", "second"),
4093  fcRateTheoretical ("RateTheoretical", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4094  "CONSNRAT", "Consensus theoretical rate", "second/second"),
4095  fcUVFperAsec ("UVFperAsec", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4096  "UVF/ASEC", "U V in FR per arcsec from CALC", "", "?"),
4097  //
4098  // begin of channel info:
4099  //
4100  fcChannelID ("ChannelID", NC_CHAR, false,QList<int>() << SD_NumObs << SD_2NumChans,
4101  "CHAN ID ", "One-letter Fourfit channel ID...", "", "?"),
4102  fcPolarization ("Polarization", NC_CHAR, false,QList<int>() << SD_NumObs << SD_NumChans
4103  << 4,
4104  "POLARIZ ", "Polarization per sta/chan R/L...", "", "?"),
4105  fcNumChannels ("NumChannels", NC_SHORT, true, QList<int>() << SD_NumObs,
4106  "#CHANELS", "No. of U-L pairs in integration.", "", "?"),
4107  fcNumAp ("NumAp", NC_SHORT, false,QList<int>() << SD_NumObs << SD_NumChans
4108  << 2,
4109  "NO.OF AP", "# of AP by sideband and channel.", "", "?"),
4110  fcNumAccum ("NumAccum", NC_SHORT, false,QList<int>() << SD_NumObs << 32,
4111  "VFRQ#APS", "No. of accum. periods in Channel (S2)", "", "?"),
4112  fcERRORATE ("ERRORATE", NC_SHORT, false,QList<int>() << SD_NumObs << SD_NumChans
4113  << 2 << 2,
4114  "ERRORATE", "Log err rate by sta, sb, channel", "", "?"),
4115  fcBITSAMPL ("BITSAMPL", NC_SHORT, false,QList<int>() << SD_NumObs,
4116  "BITSAMPL", "Number of bits per sample.......", "", "?"),
4117  fcBBCIndex ("BBCIndex", NC_SHORT, false,QList<int>() << SD_NumObs << SD_NumChans
4118  << 2,
4119  "BBC IND ", "Physical BBC number by channel..", "", "?"),
4120  fcINDEXNUM ("INDEXNUM", NC_SHORT, false,QList<int>() << SD_NumObs << SD_NumChans
4121  << 2,
4122  "INDEXNUM", "Corel index numbers by sb,freq..", "", "?"),
4123  fcChannelFreq ("ChannelFreq", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans,
4124  "RFREQ ", "RF freq by channel (MHz)........", "MHz", "?"),
4125  fcVIRTFREQ ("VIRTFREQ", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans,
4126  "VIRTFREQ", "Sky Frequencies", "MHz", "?"),
4127 
4128  fcLOFreq ("LOFreq", NC_DOUBLE, false,QList<int>() << SD_NumObs << SD_NumChans
4129  << 2,
4130  "LO FREQ ", "LO frequencies per cha/sta MHz", "MHz", "?"),
4131  fcChanAmpPhase ("ChanAmpPhase", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans
4132  << 2,
4133  "AMPBYFRQ", "Amp(0-1), phs(-180to180) by chan", "", "?"),
4134  fcVFRQAM ("VFRQAM", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans,
4135  "VFRQAM", "Normalized channel amplitude", "", "?"),
4136  fcVFRQPH ("VFRQPH", NC_DOUBLE, true, QList<int>() << SD_NumObs << SD_NumChans,
4137  "VFRQPH", "Channel Phase (degrees)", "", "?"),
4138 
4139 
4140 
4141  fcNumSamples ("NumSamples", NC_DOUBLE, false,QList<int>() << SD_NumObs << SD_NumChans
4142  << 2,
4143  "#SAMPLES", "# of samples by sideband and cha", "", "?"),
4144  fcSampleRate ("SampleRate", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4145  "SAMPLRAT", "Sample rate (Hz)", "Hz", "?"),
4146  //
4147  // begin of phase cal info:
4148  //
4149  fcPhaseCalRate ("PhaseCalRate", NC_DOUBLE, true, dim_Obs_x_Stn,
4150  "PHASECAL", "PC rate by sta ( us per s)......", "", "?"),
4151  fcPhaseCalFreq ("PhaseCalFreq", NC_SHORT, false, dim_Obs_x_Chan_x_Stn,
4152  "", "PhaseCalFreq by channel, Station", "", "?"),
4153  fcPhaseCalOffset ("PhaseCalOffset", NC_SHORT, false, dim_Obs_x_Chan_x_Stn,
4154  "PHCALOFF", "Phase cal offset (-18000/18000).", "centidegrees", "?"),
4155  fcPhaseCalPhase ("PhaseCalPhase", NC_SHORT, true, dim_Obs_x_Chan_x_Stn,
4156  "", "PhaseCalPhase by channel, Station(-18000 to 18000)", "centidegrees", "?"),
4157  fcPhaseCalAmp ("PhaseCalAmp", NC_SHORT, true, dim_Obs_x_Chan_x_Stn,
4158  "", "PhaseCalAmp by channel, Station", "", "?"),
4159  // phase cal data from S2:
4160  fcPhaseCalFreqS2 ("PhaseCalFreqS2", NC_DOUBLE, false, dim_Obs_x_Chan_x_Stn,
4161  "VFRQPCFR", "Phase cal tone Frequencies", "", "?"),
4162  fcPhaseCalPhaseS2 ("PhaseCalPhaseS2", NC_DOUBLE, true, dim_Obs_x_Chan_x_Stn,
4163  "VFRQPCPH", "PhaseCalPhase by channel, Station(-18000 to 18000)", "centidegrees", "?"),
4164  fcPhaseCalAmpS2 ("PhaseCalAmpS2", NC_DOUBLE, true, dim_Obs_x_Chan_x_Stn,
4165  "VFRQPCAM", "Phase cal tone Amplitudes", "", "?"),
4166  //
4167  // begin of correlator info:
4168  //
4169  fcFOURFFIL ("FOURFFIL", NC_CHAR, false,QList<int>() << SD_NumObs << 16,
4170  "FOURFFIL", "Fourfit output filename", "", "?"),
4171  fcFRNGERR ("FRNGERR", NC_CHAR, false,QList<int>() << SD_NumObs,
4172  "FRNGERR ", "Fourfit error flag blank=OK.....", "", "?"),
4173  fcFRNGERR4S2 ("FRNGERR", NC_SHORT, false,QList<int>() << SD_NumObs,
4174  "FRNGERR ", "Fourfit error flag blank=OK.", "", "?"),
4175  fcFRQGROUP ("FRQGROUP", NC_CHAR, true, QList<int>() << SD_NumObs << 2,
4176  "FRQGROUP", "Frequency group code............", "", "?"),
4177  fcCORELVER ("CORELVER", NC_SHORT, false,QList<int>() << SD_NumObs,
4178  "CORELVER", "Correlator software version numb", "", "?"),
4179  fcFOURFVER ("FOURFVER", NC_SHORT, false,QList<int>() << SD_NumObs << 2,
4180  "FOURFVER", "Fourfit version number..........", "", "?"),
4181  fcDBEDITVE ("DBEDITVE", NC_SHORT, false,QList<int>() << SD_NumObs << 3,
4182  "DBEDITVE", "Dbedit revision date YYYY MM DD", "", "?"),
4183  fcREFCLKER ("REFCLKER", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4184  "REFCLKER", "Ref sta clock epoch microsec....", "", "?"),
4185  fcStartOffset ("StartOffset", NC_SHORT, false,QList<int>() << SD_NumObs,
4186  "STARTOFF", "Offset nominal start time (sec).", "", "?"),
4187  fcDELTAEPO ("DELTAEPO", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4188  "DELTAEPO", "Offset from center of scan (sec)", "", "?"),
4189  fcStopOffset ("StopOffset", NC_SHORT, false,QList<int>() << SD_NumObs,
4190  "STOP OFF", "Offset nominal stop time (sec)..", "", "?"),
4191  fcHopsRevNum ("HopsRevisionNumber",NC_SHORT, false,QList<int>() << SD_NumObs,
4192  "", "HOPS software revision number", "", "?"),
4193  fcURVR ("URVR", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4194  "URVR ", "Rate derivatives mHz per asec...", "", "?"),
4195  fcIDELAY ("IDELAY", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4196  "IDELAY ", "Corel instrumental delay (sec)..", "", "?"),
4197  fcSTARELEV ("STARELEV", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4198  "STARELEV", "Elev angles calc by COREL.......", "", "?"),
4199  fcZDELAY ("ZDELAY", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4200  "ZDELAY ", "Corel zenith atmos. delay (sec).", "", "?"),
4201  fcSRCHPAR ("SRCHPAR", NC_DOUBLE, true, QList<int>() << SD_NumObs << 6,
4202  "SRCHPAR ", "FRNGE/Fourfit search parameters.", "", "?"),
4203  //
4204  fcCORBASCD ("CORBASCD", NC_CHAR, false,QList<int>() << SD_NumObs << 2,
4205  "CORBASCD", "Correlator baseline code (2 ch).", "", "?"),
4206  fcTapeCode ("TapeCode", NC_CHAR, false,QList<int>() << SD_NumObs << 6,
4207  "TAPQCODE", "Tape quality code...............", "", "?"),
4208  fcSBRESID ("SBRESID", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4209  "SBRESID ", "Single band delay residual......", "", "?"),
4210  fcRATRESID ("RATRESID", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4211  "RATRESID", "Rate resid (sec per sec)........", "", "?"),
4212  fcEffectiveDuration ("EffectiveDuration", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4213  "EFF.DURA", "Effective run duration sec......", "", "?"),
4214  fcStartSec ("StartSec", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4215  "STARTSEC", "Start time in sec past hour.....", "", "?"),
4216  fcStopSec ("StopSec", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4217  "STOP SEC", "Stop time in sec past hour.....", "", "?"),
4218  fcDISCARD ("DISCARD", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4219  "DISCARD ", "Percent data discarded by FRNGE.", "", "?"),
4220  fcQBFACTOR ("QBFACTOR", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4221  "QBFACTOR", "Measure of uniformity of data...", "", "?"),
4222  fcGeocResidPhase ("GeocResidPhase", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4223  "GCRESPHS", "Resid phs corrected to cen of E.", "", "?"),
4224  fcGeocSBD ("GeocSBD", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4225  "GC SBD ", "Tot geocenter sbd delay (sec)...", "", "?"),
4226  fcGeocRate ("GeocRate", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4227  "GC RATE ", "Tot geocenter delay rate (s/s)..", "", "?"),
4228  fcGeocMBD ("GeocMBD", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4229  "GC MBD ", "Tot geocenter group delay (sec).", "second", "?"),
4230  fcProbFalseDetection("ProbFalseDetection",NC_DOUBLE, true, QList<int>() << SD_NumObs,
4231  "FALSEDET", "Prob of false det from FRNGE....", "", "?"),
4232  fcABASRATE ("ABASRATE", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4233  "ABASRATE", "Corel bas/apr delay rate (s/s)..", "", "?"),
4234  fcABASDEL ("ABASDEL", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4235  "ABASDEL ", "Corel bas/apr delay (sec).......", "", "?"),
4236  fcABASACCE ("ABASACCE", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4237  "ABASACCE", "Corel bas/apr accel (1/sec**2)..", "", "?"),
4238  fcGeocPhase ("GeocPhase", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4239  "GC PHASE", "Tot phase ref to cen of Earth...", "", "?"),
4240  fcINCOHAMP ("INCOHAMP", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4241  "INCOHAMP", "Fr. amp from incoh int of chan..", "", "?"),
4242  fcINCOH2 ("INCOH2", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4243  "INCOH2 ", "Incoh amp from FRNGE plot segs..", "", "?"),
4244  fcDELRESID ("DELRESID", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4245  "DELRESID", "Delay residual (sec)............", "", "?"),
4246 
4247  fcUTCCorr ("UTCCorr", NC_SHORT, false,QList<int>() << SD_NumObs << 6,
4248  "CORR UTC", "UTC time tag of correlation.....", "", "?"),
4249  fcUTCMidObs ("UTCMidObs", NC_SHORT, true, QList<int>() << SD_NumObs << 6,
4250  "UTCM TAG", "UTC at central epoch YMDHMS.....", "", "?"),
4251  fcFOURFUTC ("FOURFUTC", NC_SHORT, false,QList<int>() << SD_NumObs << 6,
4252  "FOURFUTC", "Fourfit processing time YMDHMS..", "", "?"),
4253  fcUTCScan ("UTCScan", NC_SHORT, false,QList<int>() << SD_NumObs << 6,
4254  "SCAN UTC", "Nominal scan time YMDHMS........", "", "?"),
4255  fcTAPEID ("TAPEID", NC_CHAR, false,QList<int>() << SD_NumObs << 2 << 8,
4256  "TAPEID ", "Raw data tape ID for ref and rem", "", "?"),
4257  fcCORCLOCK ("CORCLOCK", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2 << 2,
4258  "CORCLOCK", "Clock offset(sec)/rate(sec/sec).", "", "?"),
4259  //
4260  // FmtChkVar(const char* name, nc_type type, bool isMandatory, const QList<int> l,
4261  // const QString& attLCode="", const QString& attDefinition="", const QString& attUnits="",
4262  // const QString& attBand="")
4263  // extension from GSI(/Mk3?):
4264  fcRECSETUP ("RECSETUP", NC_SHORT, false,QList<int>() << SD_NumObs << 3,
4265  "RECSETUP", "SAMP rate(KHz),FRAMES/PP,PP/AP..", "", "?"),
4266  fcVLB1FILE ("VLB1FILE", NC_CHAR, false,QList<int>() << SD_NumObs << 6,
4267  "VLB1FILE", "Correlator file name ...........", "", "?"),
4268  fcDLYEPOp1 ("DLYEPO+1", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4269  "DLYEPO+1", "Phase delay at epoch+1 usec ....", "", "?"),
4270  fcDLYEPOCH ("DLYEPOCH", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4271  "DLYEPOCH", "Phase delay at epoch usec ....", "", "?"),
4272  fcDLYEPOm1 ("DLYEPO-1", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4273  "DLYEPO-1", "Phase delay at epoch-1 usec ....", "", "?"),
4274  fcAPCLOFST ("APCLOFST", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4275  "APCLOFST", "Apriori clock offset microsec ..", "", "?"),
4276  fcTOTPCENT ("TOTPCENT", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4277  "TOTPCENT", "TOT phase at central epoch .....", "", "?"),
4278  fcRATOBSVM ("RATOBSVM", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4279  "RATOBSVM", "OBS rate at central epoch ......", "", "?"),
4280  fcUTCVLB2 ("UTCVLB2", NC_SHORT, false,QList<int>() << SD_NumObs << 6,
4281  "VLB2 UTC", "UTC of frnge PROC YMDHMS........", "", "?"),
4282  fcDELOBSVM ("DELOBSVM", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4283  "DELOBSVM", "OBS delay at central epoch uS ..", "", "?"),
4284  //
4285  // S2 artefacts:
4286  fcUTCErr ("UTCErr", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4287  "UTC ERR ", "A priori UTC error site 1 (sec)", "", "?"),
4288  fcVFDWELL ("VFDWELL", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4289  "VFDWELL ", "Dwell time in each channel (sec)", "", "?"),
4290  fcS2EFFREQ ("S2EFFREQ", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4291  "S2EFFREQ", "Effective group freq for ion.", "", "?"),
4292  fcS2REFREQ ("S2REFREQ", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4293  "S2REFREQ", "Effective frequency for rate", "", "?"),
4294  fcS2PHEFRQ ("S2PHEFRQ", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4295  "S2PHEFRQ", "Effective phase frequency", "", "?"),
4296  fcTotalFringeErr ("TotalFringeErr", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4297  "TPHA ERR", "Total fringe phase error (deg)", "", "?"),
4298  fcDURATION ("DURATION", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4299  "TPHA ERR", "Scan duration (sec).", "", "?"),
4300  fcTimeSinceStart ("TimeSinceStart", NC_DOUBLE, false,QList<int>() << SD_NumObs,
4301  "STR TIME", "Interval since start time (sec).", "", "?"),
4302 
4303 
4304 
4305  //
4306  // end of correlator info
4307  //
4308  fcCalEarthTide ("Cal-EarthTide", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4309  "ETD CONT", "Earth tide contributions def."),
4310  fcCalFeedCorrection ("Cal-FeedCorrection",NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4311  "FEED.COR", "Feedhorn corr. in CORFIL scheme"),
4312  fcCalUt1Ortho ("Cal-UT1Ortho", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4313  "UT1ORTHO", "ORTHO_EOP Tidal UT1 contribution"),
4314  fcCalWobOrtho ("Cal-WobOrtho", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4315  "WOBORTHO", "ORTHO_EOP tidal wobble contribtn"),
4316  fcCalOceanLoad ("Cal-OceanLoad", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4317  "OCE CONT", "Obs dependent ocean loading"),
4318  fcCalOceanLoadOld ("Cal-OceanLoadOld", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4319  "OCE_OLD ", "Add to Cal-OceanLoad to get Cal10 OceanLoading"),
4320  fcCalOceanPoleTideLoad ("Cal-OceanPoleTideLoad",
4321  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4322  "OPTLCONT", "Ocean Pole Tide Load Contribution"),
4323  fcCalPoleTide ("Cal-PoleTide", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4324  "PTD CONT", "Pole tide contributions def."),
4325  fcCalPoleTideOldRestore("Cal-PoleTideOldRestore",
4326  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4327  "PTOLDCON", "Old Pole Tide Restorer Contrib."),
4328  fcCalTiltRemover ("Cal-TiltRemover", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4329  "TILTRMVR", "Axis Tilt Contribution Remover"),
4330  fcCalUnPhase ("Cal-UnPhase", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2 << 2,
4331  "UNPHASCL", "UnPhaseCal effect - group&rate"),
4332  fcCalHfLibration ("Cal-HiFreqLibrationPM",
4333  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4334  "", ""),
4336  ("Cal-HiFreqLibrationPM",
4337  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4338  "WOBLIBRA", "Hi Freq Wobble Libration Contribution"),
4340  ("Cal-HiFreqLibrationUT1",
4341  NC_DOUBLE, false,QList<int>() << SD_NumObs << 2,
4342  "UT1LIBRA", "Hi Freq UT1 Libration Contribution"),
4343  fcCalXwobble ("Cal-Xwobble", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4344  "WOBXCONT", "X Wobble contribution definition"),
4345  fcCalYwobble ("Cal-Ywobble", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4346  "WOBYCONT", "Y Wobble contribution definition"),
4347  fcCalBend ("Cal-Bend", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4348  "CON CONT", "Consensus bending contrib. (sec)"),
4349  fcCalBendSun ("Cal-BendSun", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4350  "SUN CONT", "Consensus bending contrib. (sec)"),
4351  fcCalBendSunHigher ("Cal-BendSunHigher", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4352  "SUN2CONT", "High order bending contrib.(sec)"),
4353  fcCalParallax ("Cal-Parallax", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4354  "PLX1PSEC", "Parallax partial/contr 1 parsec"),
4355 
4356  //
4357  //
4358  fcPartBend ("Part-Bend", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4359  "BENDPART", "Grav. bend. partial w.r.t. Gamma"),
4360  fcPartWobble ("Part-Wobble", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 2,
4361  "WOB PART", "Wobble partial derivatives def."),
4362  fcPartUt1 ("Part-UT1", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 2,
4363  "UT1 PART", "UT1 partial derivatives def."),
4364  fcPartGamma ("Part-Gamma", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4365  "CONSPART", "Consensus partial w.r.t. Gamma"),
4366  fcPartNutationNro ("Part-NutationNRO", NC_DOUBLE, false,QList<int>() << SD_NumObs << 2 << 2,
4367  "NUT06XYP", "2000/2006 Nut/Prec X,Y Partials"),
4368  fcPartRaDec ("Part-RaDec", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 2,
4369  "STR PART", "Star partial derivatives def."),
4370  fcPartXyz ("Part-XYZ", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 3,
4371  "SIT PART", "Site partials: dtau/dr_1=-dtau/dr_2"),
4372  fcPartParallax ("Part-Parallax", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
4373  "PLX PART", "Parallax partial deriv. def."),
4374  fcPartPolarTide ("Part-PoleTide", NC_DOUBLE, true, QList<int>() << SD_NumObs << 2 << 2,
4375  "PTDXYPAR", "Pole Tide Partials w.r.t. X & Y"),
4376  fcFractC ("FractC", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4377  "CT SITE1", "Coordinate time at site 1", "day"),
4378  //
4379  fcUserCorrections ("Corrections", NC_DOUBLE, true, QList<int>() << SD_NumObs,
4380  "", "")
4381  ;
4382 
4383 
4384 
4385 
4386 // netCDF files:
4406  << &fcFreqGroupIon,
4421  //
4422  // channel info (what we expect to read):
4423  //
4424  //
4428  fcfChannelInfoInptVLBA // == fcfChannelInfoInptMk3
4431  fcfChannelInfoInptCRL // == fcfChannelInfoInptMk3
4434  fcfChannelInfoInptGSI // == fcfChannelInfoInptMk3
4440  << &fcNumAccum << &fcVIRTFREQ,
4444  fcfChannelInfoInptHaystack // == fcfChannelInfoInptMk4
4447  fcfChannelInfoInptDifx // == fcfChannelInfoInptMk4
4450  //
4451  // what to do with these:
4452  // cannot find the variable "NumAp" in the file 2002/02OCT09XG/Observables/ChannelInfo_bX.nc
4453  // cannot find the variable "NumAp" in the file 2002/02SEP11XG/Observables/ChannelInfo_bX.nc
4454  //
4455  // short NumAccum(NumObs, Dim000032) ;
4456  // NumAccum:LCODE = "VFRQ#APS" ;
4457  // NumAccum:CreateTime = "2002/12/09 14:10:54 " ;
4458  // NumAccum:Band = "X" ;
4459  // NumAccum:Definition = "No. of accum. periods in Channel (S2)" ;
4460  //
4461  //
4462  // Channel info for MK4 type of correlator output:
4466  << &fcSampleRate,
4467  // Channel info for KOMB type of correlator output:
4470  //??<< &fcERRORATE
4471  ,
4472  //
4473  // ------------------------------------------------------------------
4474  //
4477 
4482  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk3
4485  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk3
4488  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk3
4497  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk4
4500  = QList<SgVgosDb::FmtChkVar*>() //==fcfCorrInfoMk4
4502  //
4503  // ------------------------------------------------------------------
4504  //
4505  // correlator info (what we expect to read):
4508  << &fcStartSec << &fcStopSec,
4509  fcfCorrInfoInptVLBA //==fcfCorrInfoMk3
4511  << &fcStartSec << &fcStopSec,
4514  << &fcStartSec << &fcStopSec,
4515  fcfCorrInfoInptGSI // ==fcfCorrInfoInptCRL
4517  << &fcStartSec << &fcStopSec,
4520  << &fcStartSec << &fcStopSec,
4521  fcfCorrInfoInptHaystack //==fcfCorrInfoMk4
4523  << &fcStartSec << &fcStopSec,
4524  fcfCorrInfoInptDifx //==fcfCorrInfoMk4
4526  << &fcStartSec << &fcStopSec,
4527  //
4528  // Info for MK4 type of correlator:
4530  << &fcFOURFFIL << &fcFRNGERR << &fcFRQGROUP
4532  << &fcURVR << &fcIDELAY << &fcSTARELEV << &fcZDELAY << &fcSRCHPAR << &fcCORBASCD << &fcStopOffset
4537  << &fcTAPEID << &fcCORCLOCK,
4538  //
4539  // Info for KOMB type of correlator:
4547  //
4548  // S2:
4553 
4554 // << &fcFRNGERR4S2
4555 
4556 
4557  ,
4558 
4559 
4560  //
4561  //
4587 
4601  ;
4602 
4603 
4604 /*=====================================================================================================*/
4605 
@ 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:2683
QList< SgVgosDb::FmtChkVar * > fcfCalSlantPathIonoGroup
Definition: SgVgosDb.cpp:2671
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:2677
SgVgosDb::FmtChkVar fcYmdhm("YMDHM", NC_SHORT, true, QList< int >()<< SD_Any<< 5, "UTC TAG ", "Epoch UTC YMDHM.................")
QList< SgVgosDb::FmtChkVar * > fcfNumPhaseAmbig
Definition: SgVgosDb.cpp:2685
QList< SgVgosDb::FmtChkVar * > fcfNumGroupAmbigE
Definition: SgVgosDb.cpp:2684
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:2669
QList< SgVgosDb::FmtChkVar * > fcfUserSup
Definition: SgVgosDb.cpp:2681
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:1486
SgVdbVariable vCal_EarthTide_
Definition: SgVgosDb.h:1491
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:1501
SgVdbVariable vPart_Erp_
Definition: SgVgosDb.h:1522
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:2173
bool loadObsCalBendSunHigher(SgMatrix *&cals)
bool loadObsUserCorrections(int idx, SgMatrix *m, QString &name)
bool loadObsCalOceanOld(SgMatrix *&)
SgVdbVariable vPart_NutationNro_
Definition: SgVgosDb.h:1524
bool loadObsGroupDelays(const QString &band, SgMatrix *&)
bool loadObsCalFeedCorr(SgMatrix *&)
double inputFormatVersion_
Definition: SgVgosDb.h:1410
SgVdbVariable vSource_
Definition: SgVgosDb.h:1480
SgVdbVariable vBaseline_
Definition: SgVgosDb.h:1479
@ 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:1499
bool loadObsPartBend(SgMatrix *&partBend)
SgVdbVariable vCal_BendSun_
Definition: SgVgosDb.h:1489
SgVdbVariable vPart_Parallax_
Definition: SgVgosDb.h:1525
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:1403
bool loadObsPartRaDec(SgMatrix *&dV_dRA, SgMatrix *&dV_dDN)
SgVdbVariable vPart_PoleTide_
Definition: SgVgosDb.h:1526
bool loadObsCalWobble(SgMatrix *&, SgMatrix *&)
SgVdbVariable vCal_BendSunHigher_
Definition: SgVgosDb.h:1490
bool loadObsCalPoleTide(SgMatrix *&, QString &kind)
bool loadObsCorrelation(const QString &band, SgVector *&correlations)
SgVdbVariable vPart_Xyz_
Definition: SgVgosDb.h:1529
bool loadObsDataFlag(const QString &band, QVector< int > &delUFlag)
bool loadObsPhase(const QString &band, SgMatrix *&)
bool loadObsCalParallax(SgMatrix *&cals)
int numOfChan_
Definition: SgVgosDb.h:1399
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:1503
bool loadObsFractC(SgVector *&v)
SgVdbVariable vObsCrossRef_
Definition: SgVgosDb.h:1510
SgVdbVariable vEdit_
Definition: SgVgosDb.h:1506
SgVdbVariable vCal_OceanLoad_
Definition: SgVgosDb.h:1494
SgVdbVariable vPart_Bend_
Definition: SgVgosDb.h:1520
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:1493
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:1498
SgVdbVariable vCal_OceanPoleTideLoad_
Definition: SgVgosDb.h:1496
QMap< QString, BandData > bandDataByName_
Definition: SgVgosDb.h:1483
bool loadObsUserSup(QVector< int > &uAcSup)
SgVdbVariable vCal_Bend_
Definition: SgVgosDb.h:1488
SgVdbVariable vCal_FeedCorrection_
Definition: SgVgosDb.h:1492
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:1502
bool loadObsCalIonGroup(const QString &band, SgMatrix *&ionCals, SgMatrix *&ionSigmas, QVector< int > &ionDataFlag)
QList< SgVdbVariable * > obsUserCorrections_
Definition: SgVgosDb.h:1533
bool loadObsCalPoleTideOldRestore(SgMatrix *&cals)
SgVdbVariable vPart_Gamma_
Definition: SgVgosDb.h:1521
bool loadObsUVFperAsec(const QString &band, SgMatrix *&uvfPerAsec)
bool loadObsCalBendSun(SgMatrix *&cals)
bool loadObsRates(const QString &band, SgMatrix *&)
ProgramSolveDescriptor progSolveDescriptor_
Definition: SgVgosDb.h:1537
SgVdbVariable vRateTheoretical_
Definition: SgVgosDb.h:1517
int numOfObs_
Definition: SgVgosDb.h:1397
SgVdbVariable vCal_OceanLoadOld_
Definition: SgVgosDb.h:1495
bool loadObsCorrelatorInfoMk4(const QString &band, QList< QString > &fourfitOutputFName, QList< QString > &fourfitErrorCodes, SgVector *&scanStartSec, SgVector *&scanStopSec)
QString path2RootDir_
Definition: SgVgosDb.h:1406
SgVdbVariable vObservationTimeUTC_
Definition: SgVgosDb.h:1478
bool loadEpochs4Obs(QList< SgMJD > &)
bool loadObsQualityCodes(const QString &band, QVector< QString > &qualityCodes)
SgVdbVariable vPart_RaDec_
Definition: SgVgosDb.h:1528
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:1500
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:1497
SgVdbVariable vDelayTheoretical_
Definition: SgVgosDb.h:1516