General Purpose Geodetic Library
SgVgosDbStoreObs.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 #include <math.h>
25 #include <netcdf.h>
26 
27 
28 #include <SgIdentities.h>
29 #include <SgLogger.h>
30 #include <SgVgosDb.h>
31 #include <SgVlbiSession.h>
32 
33 
34 
35 /*=====================================================================================================*/
36 /* */
37 /* SgVgosDb implementation (continue -- storeObs part of vgosDb data tree) */
38 /* */
39 /*=====================================================================================================*/
40 //
42 {
44  SgNetCdf ncdf(path2RootDir_ + "/" +
46  sessionCode_, "", "");
47  //
48  if (numOfObs_ != epochs.size())
49  {
51  "::storeEpochs4Obs(): size mismatch: " +
52  QString("").sprintf("%d vs %d", numOfObs_, epochs.size()));
53  return false;
54  };
57 // fcUtc4 .alternateDimension(0, SD_NumObs);
58  if (!setupFormat(fcfTimeUTC, ncdf))
59  {
61  "::storeEpochs4Obs(): format description failed");
62  return false;
63  };
64  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator files", "", "");
65  //
66  //
67  double dSec;
68  int nYear, nMonth, nDay, nHour, nMin;
69  double *pS=ncdf.lookupVar(fcSecond.name())->data2double();
70  short *pD=ncdf.lookupVar(fcYmdhm .name())->data2short();
71 // short *pU=ncdf.lookupVar(fcUtc4 .name())->data2short();
72  for (int i=0; i<numOfObs_; i++)
73  {
74  epochs.at(i).toYMDHMS_tr(nYear, nMonth, nDay, nHour, nMin, dSec);
75  pD[5*i + 0] = nYear%100;
76  pD[5*i + 1] = nMonth;
77  pD[5*i + 2] = nDay;
78  pD[5*i + 3] = nHour;
79  pD[5*i + 4] = nMin;
80  pS[i] = dSec;
81  };
82  // write data:
84  if (!ncdf.putData())
85  {
87  "::storeEpochs4Obs(): cannot put data into " + ncdf.getFileName());
88  return false;
89  };
92  "::storeEpochs4Obs(): the data were successfully stored in " + ncdf.getFileName());
93  return true;
94 };
95 
96 
97 
98 //
99 bool SgVgosDb::storeObsCalIonGroup(const QString& band,
100  const SgMatrix* ionCals, const SgMatrix* ionSigmas, const QVector<int> &ionDataFlag)
101 {
102  if (!bandDataByName_.contains(band))
103  {
105  "::storeObsCalIonGroup(): the band \"" + band + "\" is not registered");
106  return false;
107  };
108  SgVdbVariable &var=bandDataByName_[band].vCal_SlantPathIonoGroup_;
109  SgNetCdf ncdf(path2RootDir_ + "/" +
111  sessionCode_, "", band);
112 
113  if (!setupFormat(fcfCalSlantPathIonoGroup, ncdf, "", band))
114  {
116  "::storeObsCalIonGroup(): format description failed");
117  return false;
118  };
119  ncdf.setServiceVars(var.getStub(), "Evaluated from dual band observations", "Obs", "TimeUTC.nc");
120  //
121  //
122  double *pV=ncdf.lookupVar(fcCalIonoGroup .name())->data2double();
123  double *pS=ncdf.lookupVar(fcCalIonoGroupSigma .name())->data2double();
124  short *pI=ncdf.lookupVar(fcCalIonoGroupDataFlag.name())->data2short();
125  for (int i=0; i<ionDataFlag.size(); i++)
126  {
127  pV[2*i + 0] = ionCals ->getElement(i, 0);
128  pV[2*i + 1] = ionCals ->getElement(i, 1);
129  pS[2*i + 0] = ionSigmas->getElement(i, 0);
130  pS[2*i + 1] = ionSigmas->getElement(i, 1);
131  pI[i] = ionDataFlag[i];
132  };
133  // write data:
135  if (!ncdf.putData())
136  {
138  "::storeObsCalIonGroup(): cannot put data into " + ncdf.getFileName());
139  return false;
140  };
143  "::storeObsCalIonGroup(): the data were successfully stored in " + ncdf.getFileName());
144  return true;
145 };
146 
147 
148 
149 //
150 //
151 bool SgVgosDb::storeIonoBits(const QVector<int>& ionoBits)
152 {
154  SgNetCdf ncdf(path2RootDir_ + "/" +
156  sessionCode_, "", "");
157 
158  if (!setupFormat(fcfIonoBits, ncdf))
159  {
161  "::storeIonBits(): format description failed");
162  return false;
163  };
164  ncdf.setServiceVars(var.getStub(), "The results of calculations", "Obs", "TimeUTC.nc");
165  //
166  //
167  short *pI=ncdf.lookupVar(fcIonoBits.name())->data2short();
168  for (int i=0; i<ionoBits.size(); i++)
169  pI[i] = ionoBits[i];
170  // write data:
172  if (!ncdf.putData())
173  {
175  "::storeIonoBits(): cannot put data into " + ncdf.getFileName());
176  return false;
177  };
180  "::storeIonoBits(): the data were successfully stored in " + ncdf.getFileName());
181  return true;
182 };
183 
184 
185 
186 //
187 bool SgVgosDb::storeObsEditData(const QVector<int>& delUFlag, const QVector<int>& phsUFlag,
188  const QVector<int>& ratUFlag, const QVector<int>& uAcSup)
189 {
190  SgVdbVariable &var=vEdit_;
191  SgNetCdf ncdf(path2RootDir_ + "/" +
193  sessionCode_, "", "");
194 
195  if (!setupFormat(fcfEdit_v1002, ncdf)) // this is a current version
196  {
198  "::storeObsEditData(): format description failed");
199  return false;
200  };
201  ncdf.setServiceVars(var.getStub(), "The results of calculations", "Obs", "TimeUTC.nc");
202  //
203  //
204  short *pD=ncdf.lookupVar(fcDelayFlag.name())->data2short();
205  short *pR=ncdf.lookupVar(fcRateFlag .name())->data2short();
206  short *pP=ncdf.lookupVar(fcPhaseFlag.name())->data2short();
207 // short *pU=ncdf.lookupVar(fcUserSup .name())->data2short();
208  for (int i=0; i<delUFlag.size(); i++)
209  {
210  pD[i] = delUFlag[i];
211  pR[i] = ratUFlag[i];
212  pP[i] = phsUFlag[i];
213 // pU[i] = uAcSup [i];
214  };
215  // write data:
217  if (!ncdf.putData())
218  {
220  "::storeObsEditData(): cannot put data into " + ncdf.getFileName());
221  return false;
222  };
223  //
224  storeObsUserSup(uAcSup);
225  //
228  "::storeObsEditData(): the data were successfully stored in " + ncdf.getFileName());
229  return true;
230 };
231 
232 
233 
234 //
235 bool SgVgosDb::storeObsUserSup(const QVector<int>& uAcSup)
236 {
238  SgNetCdf ncdf(path2RootDir_ + "/" +
240  sessionCode_, "", "");
241 
242  if (!setupFormat(fcfUserSup, ncdf))
243  {
245  "::storeObsUserSup(): format description failed");
246  return false;
247  };
248  ncdf.setServiceVars(var.getStub(), "The results of user's actions", "Obs", "TimeUTC.nc");
249  //
250  //
251  short *pU=ncdf.lookupVar(fcUserSup .name())->data2short();
252  for (int i=0; i<uAcSup.size(); i++)
253  pU[i] = uAcSup[i];
254  // write data:
256  if (!ncdf.putData())
257  {
259  "::storeObsUserSup(): cannot put data into " + ncdf.getFileName());
260  return false;
261  };
264  "::storeObsUserSup(): the data were successfully stored in " + ncdf.getFileName());
265  return true;
266 };
267 
268 
269 
270 //
271 //
272 bool SgVgosDb::storeObsNumGroupAmbigs(const QString &band, const QVector<int> &numAmbigs,
273  const QVector<int> &numSubAmbigs)
274 {
275  if (!bandDataByName_.contains(band))
276  {
278  "::storeObsNumGroupAmbigs(): the band \"" + band + "\" is not registered");
279  return false;
280  };
281  SgVdbVariable &var=bandDataByName_[band].vNumGroupAmbig_;
282  SgNetCdf ncdf(path2RootDir_ + "/" +
284  sessionCode_, "", band);
285  //
286  if (numSubAmbigs.size() == numAmbigs.size())
287  {
288  if (!setupFormat(fcfNumGroupAmbigE, ncdf, "", band))
289  {
291  "::storeObsNumGroupAmbigs(): format description (E) failed");
292  return false;
293  };
294  ncdf.setServiceVars(var.getStub(), "The results of calculations", "Obs", "TimeUTC.nc");
295  //
296  short *pN=ncdf.lookupVar(fcNumGroupAmbig.name())->data2short();
297  short *pS=ncdf.lookupVar(fcNumGroupSubAmbig.name())->data2short();
298  for (int i=0; i<numAmbigs.size(); i++)
299  {
300  pN[i] = numAmbigs[i];
301  pS[i] = numSubAmbigs[i];
302  };
303  // write data:
305  if (!ncdf.putData())
306  {
308  "::storeObsNumGroupAmbigs(): cannot put data (E) into " + ncdf.getFileName());
309  return false;
310  };
313  "::storeObsNumGroupAmbigs(): the data (E) were successfully stored in " + ncdf.getFileName());
314  return true;
315  }
316  else
317  {
318  if (!setupFormat(fcfNumGroupAmbig, ncdf, "", band))
319  {
321  "::storeObsNumGroupAmbigs(): format description failed");
322  return false;
323  };
324  ncdf.setServiceVars(var.getStub(), "The results of calculations", "Obs", "TimeUTC.nc");
325  //
326  short *pI=ncdf.lookupVar(fcNumGroupAmbig.name())->data2short();
327  for (int i=0; i<numAmbigs.size(); i++)
328  pI[i] = numAmbigs[i];
329  // write data:
331  if (!ncdf.putData())
332  {
334  "::storeObsNumGroupAmbigs(): cannot put data into " + ncdf.getFileName());
335  return false;
336  };
339  "::storeObsNumGroupAmbigs(): the data were successfully stored in " + ncdf.getFileName());
340  return true;
341  };
342 };
343 
344 
345 
346 //
347 //
348 bool SgVgosDb::storeObsNumPhaseAmbigs(const QString &band, const QVector<int> &numAmbigs)
349 {
350  if (!bandDataByName_.contains(band))
351  {
353  "::storeObsNumPhaseAmbigs(): the band \"" + band + "\" is not registered");
354  return false;
355  };
356  SgVdbVariable &var=bandDataByName_[band].vNumPhaseAmbig_;
357  SgNetCdf ncdf(path2RootDir_ + "/" +
359  sessionCode_, "", band);
360  //
361  if (!setupFormat(fcfNumPhaseAmbig, ncdf, "", band))
362  {
364  "::storeObsNumPhaseAmbigs(): format description failed");
365  return false;
366  };
367  ncdf.setServiceVars(var.getStub(), "The results of calculations", "Obs", "TimeUTC.nc");
368  //
369  int *pI=ncdf.lookupVar(fcNumPhaseAmbig.name())->data2int();
370  for (int i=0; i<numAmbigs.size(); i++)
371  pI[i] = numAmbigs[i];
372  // write data:
374  if (!ncdf.putData())
375  {
377  "::storeObsNumPhaseAmbigs(): cannot put data into " + ncdf.getFileName());
378  return false;
379  };
382  "::storeObsNumPhaseAmbigs(): the data were successfully stored in " + ncdf.getFileName());
383  return true;
384 };
385 
386 
387 
388 //
389 bool SgVgosDb::storeObsObjectNames(const QList<QString>& stations_1, const QList<QString>& stations_2,
390  const QList<QString>& sources)
391 {
393  SgVdbVariable &varS=vSource_;
394  SgNetCdf ncdfB(path2RootDir_ + "/" +
396  sessionCode_, "", "");
397  if (!setupFormat(fcfBaseline, ncdfB))
398  {
400  "::storeObsObjectNames(): format description of baselines failed");
401  return false;
402  };
403  SgNetCdf ncdfS(path2RootDir_ + "/" +
405  sessionCode_, "", "");
406  if (!setupFormat(fcfSource, ncdfS))
407  {
409  "::storeObsObjectNames(): format description of sources failed");
410  return false;
411  };
412  ncdfB.setServiceVars(varB.getStub(), "Data are extracted from correlator files", "Obs", "TimeUTC.nc");
413  ncdfS.setServiceVars(varS.getStub(), "Data are extracted from correlator files", "Obs", "TimeUTC.nc");
414  //
415  char *pSb=ncdfB.lookupVar(fcBaseline.name())->data2char();
416  char *pSs=ncdfS.lookupVar(fcSource.name())->data2char();
417  int lenB=fcBaseline.dims().at(2);
418  int lenS=fcSource.dims().at(1);
419  for (int i=0; i<numOfObs_; i++)
420  {
421  strncpy(pSb + lenB* 2*i , qPrintable(stations_1.at(i)), lenB);
422  strncpy(pSb + lenB*(2*i+1), qPrintable(stations_2.at(i)), lenB);
423  strncpy(pSs + lenS*i , qPrintable(sources.at(i)), lenS);
424  };
425  // write data:
427  if (!ncdfB.putData())
428  {
430  "::storeObsObjectNames(): cannot put baselines data into " + ncdfB.getFileName());
431  return false;
432  };
434  if (!ncdfS.putData())
435  {
437  "::storeObsObjectNames(): cannot put sources data into " + ncdfS.getFileName());
438  return false;
439  };
441  {
443  "::storeObsObjectNames(): the data were successfully stored in " + ncdfB.getFileName());
445  "::storeObsObjectNames(): the data were successfully stored in " + ncdfS.getFileName());
446  };
447  return true;
448 };
449 
450 
451 
452 //
454  const QList<int>& obs2stn_1, const QList<int>& obs2stn_2)
455 {
457  SgNetCdf ncdf(path2RootDir_ + "/" +
459  sessionCode_, "", "");
460  //
461  if (!setupFormat(fcfObsCrossRef, ncdf))
462  {
464  "::storeObsCrossRefs(): format description failed");
465  return false;
466  };
467  ncdf.setServiceVars(var.getStub(), "Generated on the fly", "", "");
468  //
469  //
470  int *pI=ncdf.lookupVar(fcObs2Scan .name())->data2int();
471  short *pB=ncdf.lookupVar(fcObs2Baseline.name())->data2short();
472  for (int i=0; i<numOfObs_; i++)
473  {
474  pI[ i ] = obs2scan.at(i);
475  pB[2*i ] = obs2stn_1.at(i);
476  pB[2*i + 1] = obs2stn_2.at(i);
477  };
478  // write data:
480  if (!ncdf.putData())
481  {
483  "::storeObsCrossRefs(): cannot put data into " + ncdf.getFileName());
484  return false;
485  };
488  "::storeObsCrossRefs(): the data were successfully stored in " + ncdf.getFileName());
489  return true;
490 };
491 
492 
493 
494 //
495 bool SgVgosDb::storeSourceCrossRefs(const QList<QString>& sources, const QList<int>& scan2src)
496 {
498  SgNetCdf ncdf(path2RootDir_ + "/" +
500  sessionCode_, "", "");
501 
502  //
503  if (numOfSrc_ != sources.size())
504  {
506  "::storeSourceCrossRefs(): src list size mismatch: " +
507  QString("").sprintf("%d vs %d", numOfSrc_, sources.size()));
508  return false;
509  };
510  if (numOfScans_ != scan2src.size())
511  {
513  "::storeSourceCrossRefs(): scan map size mismatch: " +
514  QString("").sprintf("%d vs %d", numOfScans_, scan2src.size()));
515  return false;
516  };
517  //
518  if (!setupFormat(fcfSourceCrossRef, ncdf))
519  {
521  "::storeSourceCrossRefs(): format description failed");
522  return false;
523  };
524  ncdf.setServiceVars(var.getStub(), "Generated on the fly", "", "");
525  //
526  //
527  int *pI=ncdf.lookupVar(fcScan2Source .name())->data2int();
528  char *pS=ncdf.lookupVar(fcCrossRefSourceList.name())->data2char();
529  int len=fcCrossRefSourceList.dims().at(1);
530  for (int i=0; i<numOfSrc_; i++)
531  strncpy(pS + len*i, qPrintable(sources.at(i)), len);
532  for (int i=0; i<numOfScans_; i++)
533  pI[i] = scan2src.at(i);
534  // write data:
536  if (!ncdf.putData())
537  {
539  "::storeSourceCrossRefs(): cannot put data into " + ncdf.getFileName());
540  return false;
541  };
544  "::storeSourceCrossRefs(): the data were successfully stored in " + ncdf.getFileName());
545  return true;
546 };
547 
548 
549 
550 //
551 bool SgVgosDb::storeStationCrossRefs(const QList<int>& numScansPerStation,
552  const QList<QString>& stations,
553  const QMap<QString, QList<int> >& stations2scan,
554  const QMap<QString, QList<int> >& scans2station)
555 {
557  SgNetCdf ncdf(path2RootDir_ + "/" +
559  sessionCode_, "", "");
560  //
561  //
562  if (numOfStn_ != numScansPerStation.size())
563  {
565  "::storeStationCrossRefs(): numScansPerStation list size mismatch: " +
566  QString("").sprintf("%d vs %d", numOfStn_, numScansPerStation.size()));
567  return false;
568  };
569  if (numOfStn_ != stations.size())
570  {
572  "::storeStationCrossRefs(): stn list size mismatch: " +
573  QString("").sprintf("%d vs %d", numOfStn_, stations.size()));
574  return false;
575  };
576  if (numOfStn_ != stations2scan.size())
577  {
579  "::storeStationCrossRefs(): stations2scan map size mismatch: " +
580  QString("").sprintf("%d vs %d", numOfStn_, stations2scan.size()));
581  return false;
582  };
583  if (numOfStn_ != scans2station.size())
584  {
586  "::storeStationCrossRefs(): scans2station map size mismatch: " +
587  QString("").sprintf("%d vs %d", numOfStn_, scans2station.size()));
588  return false;
589  };
590  if (numOfScans_ != scans2station.begin().value().size())
591  {
593  "::storeStationCrossRefs(): scans2station map's content size mismatch: " +
594  QString("").sprintf("%d vs %d", numOfScans_, scans2station.begin().value().size()));
595  return false;
596  };
597  // check the dimensions:
598  int numOfEpochs=stations2scan.begin().value().size();
599  //
600  for (QMap<QString, QList<int> >::const_iterator it=stations2scan.begin(); it!=stations2scan.end();
601  ++it)
602  if (it.value().size() != numOfEpochs)
603  {
605  "::storeStationCrossRefs(): stations2scan map content size mismatch for the station " +
606  it.key() + ": " + QString("").sprintf("%d vs %d", numOfEpochs, it.value().size()));
607  return false;
608  };
609  for (QMap<QString, QList<int> >::const_iterator it=scans2station.begin(); it!=scans2station.end();
610  ++it)
611  if (it.value().size() != numOfScans_)
612  {
614  "::storeStationCrossRefs(): scans2station map content size mismatch for the station " +
615  it.key() + ": " + QString("").sprintf("%d vs %d", numOfScans_, it.value().size()));
616  return false;
617  };
618  //
619  fcStation2Scan.alternateDimension(0, numOfEpochs);
620  if (!setupFormat(fcfStationCrossRef, ncdf))
621  {
623  "::storeStationCrossRefs(): format description failed");
624  return false;
625  };
627  ncdf.setServiceVars(var.getStub(), "Generated on the fly", "", "");
628  //
629  //
630  int *pN=ncdf.lookupVar(fcNumScansPerStation .name())->data2int();
631  int *p2Scn=ncdf.lookupVar(fcStation2Scan .name())->data2int();
632  int *p2Stn=ncdf.lookupVar(fcScan2Station .name())->data2int();
633  char *pS=ncdf.lookupVar(fcCrossRefStationList .name())->data2char();
634  int len=fcCrossRefStationList.dims().at(1);
635  for (int i=0; i<numOfStn_; i++)
636  {
637  const QString &stn=stations.at(i);
638  strncpy(pS + len*i, qPrintable(stn), len);
639  pN[i] = numScansPerStation.at(i);
640  //
641  if (stations2scan.contains(stn))
642  {
643  for (int j=0; j<numOfEpochs; j++)
644  p2Scn[i + j*numOfStn_] = stations2scan[stn].at(j);
645  }
646  else
647  {
649  "::storeStationCrossRefs(): cannot find station " + stn + " in the stations2scan map");
650  return false;
651  };
652  //
653  if (scans2station.contains(stn))
654  {
655  for (int j=0; j<numOfScans_; j++)
656  p2Stn[i + j*numOfStn_] = scans2station[stn].at(j);
657  }
658  else
659  {
661  "::storeStationCrossRefs(): cannot find station " + stn + " in the scans2station map");
662  return false;
663  };
664  };
665  // write data:
667  if (!ncdf.putData())
668  {
670  "::storeStationCrossRefs(): cannot put data into " + ncdf.getFileName());
671  return false;
672  };
675  "::storeStationCrossRefs(): the data were successfully stored in " + ncdf.getFileName());
676  return true;
677 };
678 
679 
680 
681 //
682 bool SgVgosDb::storeObsSingleBandDelays(const QString& band, const SgMatrix* singleBandDelays)
683 {
684  if (!bandDataByName_.contains(band))
685  {
687  "::storeObsSingleBandDelays(): the band \"" + band + "\" is not registered");
688  return false;
689  };
690  SgVdbVariable &var=bandDataByName_[band].vSBDelay_;
691  SgNetCdf ncdf(path2RootDir_ + "/" +
693  sessionCode_, "", band);
694  //
695  if (numOfObs_ != (int)singleBandDelays->nRow())
696  {
698  "::storeObsSingleBandDelays(): matrix size mismatch: " +
699  QString("").sprintf("%d vs %d", numOfObs_, singleBandDelays->nRow()));
700  return false;
701  };
702  if (2 != singleBandDelays->nCol())
703  {
705  "::storeObsSingleBandDelays(): matrix size mismatch: " +
706  QString("").sprintf("%d vs %d", 2, singleBandDelays->nCol()));
707  return false;
708  };
709  //
710  if (!setupFormat(fcfSBDelay, ncdf, "", band))
711  {
713  "::storeObsSingleBandDelays(): format description failed");
714  return false;
715  };
716  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
717  //
718  double *pVal=ncdf.lookupVar(fcSBDelay .name())->data2double();
719  double *pSig=ncdf.lookupVar(fcSBDelaySig.name())->data2double();
720  for (int i=0; i<numOfObs_; i++)
721  {
722  pVal[i] = singleBandDelays->getElement(i,0);
723  pSig[i] = singleBandDelays->getElement(i,1);
724  };
725  // write data:
727  if (!ncdf.putData())
728  {
730  "::storeObsSingleBandDelays(): cannot put data into " + ncdf.getFileName());
731  return false;
732  };
735  "::storeObsSingleBandDelays(): the data were successfully stored in " + ncdf.getFileName());
736  return true;
737 };
738 
739 
740 
741 //
742 bool SgVgosDb::storeObsGroupDelays(const QString& band, const SgMatrix* groupDelays, const QString& kind)
743 {
744  if (!bandDataByName_.contains(band))
745  {
747  "::storeObsGroupDelays(): the band \"" + band + "\" is not registered");
748  return false;
749  };
750  SgVdbVariable &var=bandDataByName_[band].vGroupDelay_;
751  //
752  var.setKind(kind); // empty is ok too
753  //
754  SgNetCdf ncdf(path2RootDir_ + "/" +
756  sessionCode_, "", band);
757  //
758  if (numOfObs_ != (int)groupDelays->nRow())
759  {
761  "::storeObsGroupDelays(): matrix size mismatch: " +
762  QString("").sprintf("%d vs %d", numOfObs_, groupDelays->nRow()));
763  return false;
764  };
765  if (2 != groupDelays->nCol())
766  {
768  "::storeObsGroupDelays(): matrix size mismatch: " +
769  QString("").sprintf("%d vs %d", 2, groupDelays->nCol()));
770  return false;
771  };
772  //
773  if (!setupFormat(fcfGroupDelay, ncdf, "", band))
774  {
776  "::storeObsGroupDelays(): format description failed");
777  return false;
778  };
779  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
780  //
781  double *pVal=ncdf.lookupVar(fcGroupDelay .name())->data2double();
782  double *pSig=ncdf.lookupVar(fcGroupDelaySig .name())->data2double();
783  for (int i=0; i<numOfObs_; i++)
784  {
785  pVal[i] = groupDelays->getElement(i,0);
786  pSig[i] = groupDelays->getElement(i,1);
787  };
788  // write data:
790  if (!ncdf.putData())
791  {
793  "::storeObsGroupDelays(): cannot put data into " + ncdf.getFileName());
794  return false;
795  };
798  "::storeObsGroupDelays(): the data were successfully stored in " + ncdf.getFileName());
799  return true;
800 };
801 
802 
803 
804 //
805 bool SgVgosDb::storeObsGroupDelaysFull(const QString& band, const SgVector* groupDelays)
806 {
807  if (!bandDataByName_.contains(band))
808  {
810  "::storeObsGroupDelaysFull(): the band \"" + band + "\" is not registered");
811  return false;
812  };
813  SgVdbVariable &var=bandDataByName_[band].vGroupDelayFull_;
814  SgNetCdf ncdf(path2RootDir_ + "/" +
816  sessionCode_, "", band);
817  //
818  if (numOfObs_ != (int)groupDelays->n())
819  {
821  "::storeObsGroupDelaysFull(): vector size mismatch: " +
822  QString("").sprintf("%d vs %d", numOfObs_, groupDelays->n()));
823  return false;
824  };
825  //
826  if (!setupFormat(fcfGroupDelayFull, ncdf, "", band))
827  {
829  "::storeObsGroupDelaysFull(): format description failed");
830  return false;
831  };
832  ncdf.setServiceVars(var.getStub(), "Evaluated by the software", "Obs", "TimeUTC.nc");
833  //
834  double *pVal=ncdf.lookupVar(fcGroupDelayFull.name())->data2double();
835  for (int i=0; i<numOfObs_; i++)
836  pVal[i] = groupDelays->getElement(i);
837  // write data:
839  if (!ncdf.putData())
840  {
842  "::storeObsGroupDelaysFull(): cannot put data into " + ncdf.getFileName());
843  return false;
844  };
847  "::storeObsGroupDelaysFull(): the data were successfully stored in " + ncdf.getFileName());
848  return true;
849 };
850 
851 
852 
853 //
854 bool SgVgosDb::storeObsPhaseDelaysFull(const QString& band, const SgVector* phaseDelays,
855  const SgVector* phaseDelaySigs)
856 {
857  if (!bandDataByName_.contains(band))
858  {
860  "::storeObsPhaseDelaysFull(): the band \"" + band + "\" is not registered");
861  return false;
862  };
863  SgVdbVariable &var=bandDataByName_[band].vPhaseDelayFull_;
864  SgNetCdf ncdf(path2RootDir_ + "/" +
866  sessionCode_, "", band);
867  //
868  if (numOfObs_ != (int)phaseDelays->n() || numOfObs_ != (int)phaseDelaySigs->n())
869  {
871  "::storeObsPhaseDelaysFull(): vector size mismatch: " +
872  QString("").sprintf("%d vs (%d or %d)", numOfObs_, phaseDelays->n(), phaseDelaySigs->n()));
873  return false;
874  };
875  //
876  if (!setupFormat(fcfPhaseDelayFull, ncdf, "", band))
877  {
879  "::storeObsPhaseDelaysFull(): format description failed");
880  return false;
881  };
882  ncdf.setServiceVars(var.getStub(), "Evaluated by the software", "Obs", "TimeUTC.nc");
883  //
884  double *pVal=ncdf.lookupVar(fcPhaseDelayFull.name())->data2double();
885  double *pSig=ncdf.lookupVar(fcPhaseDelaySigFull.name())->data2double();
886  for (int i=0; i<numOfObs_; i++)
887  {
888  pVal[i] = phaseDelays->getElement(i);
889  pSig[i] = phaseDelaySigs->getElement(i);
890  };
891  // write data:
893  if (!ncdf.putData())
894  {
896  "::storeObsPhaseDelaysFull(): cannot put data into " + ncdf.getFileName());
897  return false;
898  };
901  "::storeObsPhaseDelaysFull(): the data were successfully stored in " + ncdf.getFileName());
902  return true;
903 };
904 
905 
906 //
907 bool SgVgosDb::storeObsRates(const QString& band, const SgMatrix* rates, const QString& kind)
908 {
909  if (!bandDataByName_.contains(band))
910  {
912  "::storeObsRates(): the band \"" + band + "\" is not registered");
913  return false;
914  };
915  SgVdbVariable &var=bandDataByName_[band].vGroupRate_;
916  //
917  var.setKind(kind); // empty is ok too
918  //
919  SgNetCdf ncdf(path2RootDir_ + "/" +
921  sessionCode_, "", band);
922  if (numOfObs_ != (int)rates->nRow())
923  {
925  "::storeObsRates(): matrix size mismatch: " +
926  QString("").sprintf("%d vs %d", numOfObs_, rates->nRow()));
927  return false;
928  };
929  if (2 != rates->nCol())
930  {
932  "::storeObsRates(): matrix size mismatch: " +
933  QString("").sprintf("%d vs %d", 2, rates->nCol()));
934  return false;
935  };
936  //
937  if (!setupFormat(fcfGroupRate, ncdf, "", band))
938  {
940  "::storeObsRates(): format description failed");
941  return false;
942  };
943  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
944  //
945  double *pVal=ncdf.lookupVar(fcGroupRate .name())->data2double();
946  double *pSig=ncdf.lookupVar(fcGroupRateSig.name())->data2double();
947  for (int i=0; i<numOfObs_; i++)
948  {
949  pVal[i] = rates->getElement(i,0);
950  pSig[i] = rates->getElement(i,1);
951  };
952  // write data:
954  if (!ncdf.putData())
955  {
957  "::storeObsRates(): cannot put data into " + ncdf.getFileName());
958  return false;
959  };
962  "::storeObsRates(): the data were successfully stored in " + ncdf.getFileName());
963  return true;
964 };
965 
966 
967 
968 //
969 bool SgVgosDb::storeObsPhase(const QString& band, const SgMatrix* phases)
970 {
971  if (!bandDataByName_.contains(band))
972  {
974  "::storeObsPhase(): the band \"" + band + "\" is not registered");
975  return false;
976  };
977  SgVdbVariable &var=bandDataByName_[band].vPhase_;
978  SgNetCdf ncdf(path2RootDir_ + "/" +
980  sessionCode_, "", band);
981  //
982  if (numOfObs_ != (int)phases->nRow())
983  {
985  "::storeObsPhase(): matrix size mismatch: " +
986  QString("").sprintf("%d vs %d", numOfObs_, phases->nRow()));
987  return false;
988  };
989  if (2 != phases->nCol())
990  {
992  "::storeObsPhase(): matrix size mismatch: " +
993  QString("").sprintf("%d vs %d", 2, phases->nCol()));
994  return false;
995  };
996  //
997  if (!setupFormat(fcfPhase, ncdf, "", band))
998  {
1000  "::storeObsPhase(): format description failed");
1001  return false;
1002  };
1003  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1004  //
1005  double *pVal=ncdf.lookupVar(fcPhase .name())->data2double();
1006  double *pSig=ncdf.lookupVar(fcPhaseSig.name())->data2double();
1007  for (int i=0; i<numOfObs_; i++)
1008  {
1009  pVal[i] = phases->getElement(i,0);
1010  pSig[i] = phases->getElement(i,1);
1011  };
1012  // write data:
1014  if (!ncdf.putData())
1015  {
1017  "::storeObsPhase(): cannot put data into " + ncdf.getFileName());
1018  return false;
1019  };
1022  "::storeObsPhase(): the data were successfully stored in " + ncdf.getFileName());
1023  return true;
1024 };
1025 
1026 
1027 
1028 //
1029 bool SgVgosDb::storeObsRefFreqs(const QString& band, const SgVector* rf)
1030 {
1031  if (!bandDataByName_.contains(band))
1032  {
1034  "::storeObsRefFreqs(): the band \"" + band + "\" is not registered");
1035  return false;
1036  };
1037  SgVdbVariable &var=bandDataByName_[band].vRefFreq_;
1038  SgNetCdf ncdf(path2RootDir_ + "/" +
1040  sessionCode_, "", band);
1041  //
1042  if (numOfObs_ != (int)rf->n())
1043  {
1045  "::storeObsRefFreqs(): vector size mismatch: " +
1046  QString("").sprintf("%d vs %d", numOfObs_, rf->n()));
1047  return false;
1048  };
1049  //
1050  if (!setupFormat(fcfRefFreq, ncdf, "", band))
1051  {
1053  "::storeObsRefFreqs(): format description failed");
1054  return false;
1055  };
1056  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1057  //
1058  double *p=ncdf.lookupVar(fcRefFreq.name())->data2double();
1059  for (int i=0; i<numOfObs_; i++)
1060  p[i] = rf->getElement(i);
1061  // write data:
1063  if (!ncdf.putData())
1064  {
1066  "::storeObsRefFreqs(): cannot put data into " + ncdf.getFileName());
1067  return false;
1068  };
1071  "::storeObsRefFreqs(): the data were successfully stored in " + ncdf.getFileName());
1072  return true;
1073 };
1074 
1075 
1076 
1077 //
1078 bool SgVgosDb::storeObsEffFreqs(const QString& band, const SgMatrix* freqs, bool areEqWgts)
1079 {
1080  if (!bandDataByName_.contains(band))
1081  {
1083  "::storeObsEffFreqs(): the band \"" + band + "\" is not registered");
1084  return false;
1085  };
1086  SgVdbVariable &var=areEqWgts?
1087  bandDataByName_[band].vEffFreq_EqWt_:bandDataByName_[band].vEffFreq_;
1088  SgNetCdf ncdf(path2RootDir_ + "/" +
1090  sessionCode_, "", band);
1091  //
1092  if (numOfObs_ != (int)freqs->nRow())
1093  {
1095  "::storeObsEffFreqs(): matrix size mismatch: " +
1096  QString("").sprintf("%d vs %d", numOfObs_, freqs->nRow()));
1097  return false;
1098  };
1099  if (3 != freqs->nCol())
1100  {
1102  "::storeObsEffFreqs(): matrix size mismatch: " +
1103  QString("").sprintf("%d vs %d", 2, freqs->nCol()));
1104  return false;
1105  };
1106  //
1108  if (!setupFormat(fcf, ncdf, "", band))
1109  {
1111  "::storeObsEffFreqs(): format description failed");
1112  return false;
1113  };
1114  ncdf.setServiceVars(var.getStub(), "Data calculated using channel setup", "Obs", "TimeUTC.nc");
1115  //
1116  double *pG, *pP, *pR;
1117  if (areEqWgts)
1118  {
1121  pR=ncdf.lookupVar(fcFreqRateIonEqWgts .name())->data2double();
1122  }
1123  else
1124  {
1125  pG=ncdf.lookupVar(fcFreqGroupIon.name())->data2double();
1126  pP=ncdf.lookupVar(fcFreqPhaseIon.name())->data2double();
1127  pR=ncdf.lookupVar(fcFreqRateIon .name())->data2double();
1128  };
1129  for (int i=0; i<numOfObs_; i++)
1130  {
1131  pG[i] = freqs->getElement(i, 0);
1132  pP[i] = freqs->getElement(i, 1);
1133  pR[i] = freqs->getElement(i, 2);
1134  };
1135  // write data:
1137  if (!ncdf.putData())
1138  {
1140  "::storeObsEffFreqs(): cannot put data into " + ncdf.getFileName() +
1141  " using " + (areEqWgts?"equal weights":"weighted") + " mode");
1142  return false;
1143  };
1146  "::storeObsEffFreqs(): the data were successfully stored in " + ncdf.getFileName() +
1147  " using " + (areEqWgts?"equal weights":"weighted") + " mode");
1148  return true;
1149 };
1150 
1151 
1152 
1153 //
1154 bool SgVgosDb::storeObsAmbigSpacing(const QString& band, const SgVector* ambigs)
1155 {
1156  if (!bandDataByName_.contains(band))
1157  {
1159  "::storeObsAmbigSpacing(): the band \"" + band + "\" is not registered");
1160  return false;
1161  };
1162  SgVdbVariable &var=bandDataByName_[band].vAmbigSize_;
1163  SgNetCdf ncdf(path2RootDir_ + "/" +
1165  sessionCode_, "", band);
1166  //
1167  if (numOfObs_ != (int)ambigs->n())
1168  {
1170  "::storeObsAmbigSpacing(): vector size mismatch: " +
1171  QString("").sprintf("%d vs %d", numOfObs_, ambigs->n()));
1172  return false;
1173  };
1174  //
1175  if (!setupFormat(fcfAmbigSize, ncdf, "", band))
1176  {
1178  "::storeObsAmbigSpacing(): format description failed");
1179  return false;
1180  };
1181  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1182  //
1183  double *p=ncdf.lookupVar(fcAmbigSize.name())->data2double();
1184  for (int i=0; i<numOfObs_; i++)
1185  p[i] = ambigs->getElement(i);
1186  // write data:
1188  if (!ncdf.putData())
1189  {
1191  "::storeObsAmbigSpacing(): cannot put data into " + ncdf.getFileName());
1192  return false;
1193  };
1196  "::storeObsAmbigSpacing(): the data were successfully stored in " + ncdf.getFileName());
1197  return true;
1198 };
1199 
1200 
1201 
1202 //
1203 bool SgVgosDb::storeObsQualityCodes(const QString& band, const QVector<char>& qualityCodes)
1204 {
1205  if (!bandDataByName_.contains(band))
1206  {
1208  "::storeObsQualityCodes(): the band \"" + band + "\" is not registered");
1209  return false;
1210  };
1211  SgVdbVariable &var=bandDataByName_[band].vQualityCode_;
1212  SgNetCdf ncdf(path2RootDir_ + "/" +
1214  sessionCode_, "", band);
1215  //
1216  if (numOfObs_ != qualityCodes.size())
1217  {
1219  "::storeObsQualityCodes(): vector size mismatch: " +
1220  QString("").sprintf("%d vs %d", numOfObs_, qualityCodes.size()));
1221  return false;
1222  };
1223  //
1224  if (!setupFormat(fcfQualityCode, ncdf, "", band))
1225  {
1227  "::storeObsQualityCodes(): format description failed");
1228  return false;
1229  };
1230  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1231  //
1232  char *p=ncdf.lookupVar(fcQualityCode.name())->data2char();
1233  for (int i=0; i<numOfObs_; i++)
1234  p[i] = qualityCodes.at(i);
1235  // write data:
1237  if (!ncdf.putData())
1238  {
1240  "::storeObsQualityCodes(): cannot put data into " + ncdf.getFileName());
1241  return false;
1242  };
1245  "::storeObsAmbigSpacing(): the data were successfully stored in " + ncdf.getFileName());
1246  return true;
1247 };
1248 
1249 
1250 
1251 //
1252 bool SgVgosDb::storeObsCorrelation(const QString &band, const SgVector* correlations)
1253 {
1254  if (!bandDataByName_.contains(band))
1255  {
1257  "::storeObsCorrelation(): the band \"" + band + "\" is not registered");
1258  return false;
1259  };
1260  SgVdbVariable &var=bandDataByName_[band].vCorrelation_;
1261  SgNetCdf ncdf(path2RootDir_ + "/" +
1263  sessionCode_, "", band);
1264  //
1265  if (numOfObs_ != (int)correlations->n())
1266  {
1268  "::storeObsCorrelation(): vector size mismatch: " +
1269  QString("").sprintf("%d vs %d", numOfObs_, correlations->n()));
1270  return false;
1271  };
1272  //
1273  if (!setupFormat(fcfCorrelation, ncdf, "", band))
1274  {
1276  "::storeObsCorrelation(): format description failed");
1277  return false;
1278  };
1279  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1280  //
1281  double *p=ncdf.lookupVar(fcCorrelation.name())->data2double();
1282  for (int i=0; i<numOfObs_; i++)
1283  p[i] = correlations->getElement(i);
1284  // write data:
1286  if (!ncdf.putData())
1287  {
1289  "::storeObsCorrelation(): cannot put data into " + ncdf.getFileName());
1290  return false;
1291  };
1294  "::storeObsCorrelation(): the data were successfully stored in " + ncdf.getFileName());
1295  return true;
1296 };
1297 
1298 
1299 
1300 //
1301 bool SgVgosDb::storeObsUVFperAsec(const QString &band, const SgMatrix* uvfPerAsec)
1302 {
1303  if (!bandDataByName_.contains(band))
1304  {
1306  "::storeObsUVFperAsec(): the band \"" + band + "\" is not registered");
1307  return false;
1308  };
1309  SgVdbVariable &var=bandDataByName_[band].vUVFperAsec_;
1310  SgNetCdf ncdf(path2RootDir_ + "/" +
1312  sessionCode_, "", band);
1313  //
1314  if (numOfObs_ != (int)uvfPerAsec->nRow())
1315  {
1317  "::storeObsUVFperAsec(): matrix size mismatch: " +
1318  QString("").sprintf("%d vs %d", numOfObs_, uvfPerAsec->nRow()));
1319  return false;
1320  };
1321  //
1322  if (!setupFormat(fcfUVFperAsec, ncdf, "", band))
1323  {
1325  "::storeObsUVFperAsec(): format description failed");
1326  return false;
1327  };
1328  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1329  //
1330  double *p=ncdf.lookupVar(fcUVFperAsec.name())->data2double();
1331  for (int i=0; i<numOfObs_; i++)
1332  {
1333  p[2*i ] = uvfPerAsec->getElement(i, 0);
1334  p[2*i + 1] = uvfPerAsec->getElement(i, 1);
1335  };
1336  // write data:
1338  if (!ncdf.putData())
1339  {
1341  "::storeObsUVFperAsec(): cannot put data into " + ncdf.getFileName());
1342  return false;
1343  };
1346  "::storeObsUVFperAsec(): the data were successfully stored in " + ncdf.getFileName());
1347  return true;
1348 };
1349 
1350 
1351 
1352 //
1353 bool SgVgosDb::storeObsCalFeedCorr(const QString &band, const SgMatrix* contrib)
1354 {
1355  if (!bandDataByName_.contains(band))
1356  {
1358  "::storeObsCalFeedCorr(): the band \"" + band + "\" is not registered");
1359  return false;
1360  };
1361  SgVdbVariable &var=bandDataByName_[band].vCal_FeedCorrection_;
1362  SgNetCdf ncdf(path2RootDir_ + "/" +
1364  sessionCode_, "", band);
1365  //
1366  if (numOfObs_ != (int)contrib->nRow())
1367  {
1369  "::storeObsCalFeedCorr(): matrix size mismatch: " +
1370  QString("").sprintf("%d vs %d", numOfObs_, contrib->nRow()));
1371  return false;
1372  };
1373  //
1374  if (!setupFormat(fcfCalFeedCorrection, ncdf, "", band))
1375  {
1377  "::storeObsCalFeedCorr(): format description failed");
1378  return false;
1379  };
1380  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
1381  "Obs", "TimeUTC.nc");
1382  //
1383  double *p=ncdf.lookupVar(fcCalFeedCorrection.name())->data2double();
1384  for (int i=0; i<numOfObs_; i++)
1385  {
1386  p[2*i ] = contrib->getElement(i, 0);
1387  p[2*i + 1] = contrib->getElement(i, 1);
1388  };
1389  // write data:
1391  if (!ncdf.putData())
1392  {
1394  "::storeObsCalFeedCorr(): cannot put data into " + ncdf.getFileName());
1395  return false;
1396  };
1399  "::storeObsCalFeedCorr(): the data were successfully stored in " + ncdf.getFileName());
1400  return true;
1401 };
1402 
1403 
1404 
1405 //
1406 bool SgVgosDb::storeObsSNR(const QString &band, const SgVector* snrs)
1407 {
1408  if (!bandDataByName_.contains(band))
1409  {
1411  "::storeObsSNR(): the band \"" + band + "\" is not registered");
1412  return false;
1413  };
1414  SgVdbVariable &var=bandDataByName_[band].vSNR_;
1415  SgNetCdf ncdf(path2RootDir_ + "/" +
1417  sessionCode_, "", band);
1418  //
1419  if (numOfObs_ != (int)snrs->n())
1420  {
1422  "::storeObsSNR(): vector size mismatch: " +
1423  QString("").sprintf("%d vs %d", numOfObs_, snrs->n()));
1424  return false;
1425  };
1426  //
1427  if (!setupFormat(fcfSNR, ncdf, "", band))
1428  {
1430  "::storeObsSNR(): format description failed");
1431  return false;
1432  };
1433  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1434  //
1435  double *p=ncdf.lookupVar(fcSNR.name())->data2double();
1436  for (int i=0; i<numOfObs_; i++)
1437  p[i] = snrs->getElement(i);
1438  // write data:
1440  if (!ncdf.putData())
1441  {
1443  "::storeObsSNR(): cannot put data into " + ncdf.getFileName());
1444  return false;
1445  };
1448  "::storeObsSNR(): the data were successfully stored in " + ncdf.getFileName());
1449  return true;
1450 };
1451 
1452 
1453 
1454 //
1455 bool SgVgosDb::storeObsDtec(const SgVector* dTec, const SgVector* dTecStdDev)
1456 {
1457  SgVdbVariable &var=vDiffTec_;
1458  SgNetCdf ncdf(path2RootDir_ + "/" +
1460  sessionCode_);
1461  //
1462  if (numOfObs_ != (int)dTec->n())
1463  {
1465  "::storeObsDtec(): vector dTec size mismatch: " +
1466  QString("").sprintf("%d vs %d", numOfObs_, dTec->n()));
1467  return false;
1468  };
1469  if (numOfObs_ != (int)dTecStdDev->n())
1470  {
1472  "::storeObsDtec(): vector dTecStdDev size mismatch: " +
1473  QString("").sprintf("%d vs %d", numOfObs_, dTecStdDev->n()));
1474  return false;
1475  };
1476  //
1477  if (!setupFormat(fcfDTec, ncdf))
1478  {
1480  "::storeObsDtec(): format description failed");
1481  return false;
1482  };
1483  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1484  //
1485  double *d=ncdf.lookupVar(fcDtec .name())->data2double();
1486  double *e=ncdf.lookupVar(fcDtecStdErr .name())->data2double();
1487  for (int i=0; i<numOfObs_; i++)
1488  {
1489  d[i] = dTec ->getElement(i);
1490  e[i] = dTecStdDev ->getElement(i);
1491  };
1492  // write data:
1494  if (!ncdf.putData())
1495  {
1497  "::storeObsDtec(): cannot put data into " + ncdf.getFileName());
1498  return false;
1499  };
1502  "::storeObsDtec(): the data were successfully stored in " + ncdf.getFileName());
1503  return true;
1504 };
1505 
1506 
1507 
1508 //
1509 bool SgVgosDb::storeObsDataFlag(const QString &band, const QVector<int>& dataFlags)
1510 {
1511  if (!bandDataByName_.contains(band))
1512  {
1514  "::storeObsDataFlag(): the band \"" + band + "\" is not registered");
1515  return false;
1516  };
1517  SgVdbVariable &var=bandDataByName_[band].vDataFlag_;
1518  SgNetCdf ncdf(path2RootDir_ + "/" +
1520  sessionCode_, "", band);
1521  //
1522  if (numOfObs_ != (int)dataFlags.size())
1523  {
1525  "::storeObsDataFlag(): vector size mismatch: " +
1526  QString("").sprintf("%d vs %d", numOfObs_, dataFlags.size()));
1527  return false;
1528  };
1529  //
1530  if (!setupFormat(fcfDataFlag, ncdf, "", band))
1531  {
1533  "::storeObsDataFlag(): format description failed");
1534  return false;
1535  };
1536  ncdf.setServiceVars(var.getStub(), "Auxiliary data", "Obs", "TimeUTC.nc");
1537  //
1538  short *p=ncdf.lookupVar(fcDataFlag.name())->data2short();
1539  for (int i=0; i<numOfObs_; i++)
1540  p[i] = dataFlags.at(i);
1541  // write data:
1543  if (!ncdf.putData())
1544  {
1546  "::storeObsDataFlag(): cannot put data into " + ncdf.getFileName());
1547  return false;
1548  };
1551  "::storeObsDataFlag(): the data were successfully stored in " + ncdf.getFileName());
1552  return true;
1553 };
1554 
1555 
1556 
1557 
1558 //
1560  const QVector<QString>& channelIds, // CHAN ID
1561  const QVector<QString>& polarizations, // POLARIZ
1562  const QVector<int>& numOfChannels, // #CHANELS
1563  const QVector<int>& bitsPerSamples, // BITSAMPL
1564  const QVector< QVector<int> >& errorRates_1, // ERRORATE @1
1565  const QVector< QVector<int> >& errorRates_2, // ERRORATE @2
1566  const QVector< QVector<int> >& bbcIdxs_1, // BBC IND @1
1567  const QVector< QVector<int> >& bbcIdxs_2, // BBC IND @2
1568  const QVector< QVector<int> >& corelIdxNumbersUsb, // INDEXNUM usb
1569  const QVector< QVector<int> >& corelIdxNumbersLsb, // INDEXNUM lsb
1570  const SgVector* sampleRate, // SAMPLRAT
1571  const SgMatrix* residFringeAmplByChan, // AMPBYFRQ Amp
1572  const SgMatrix* residFringePhseByChan, // AMPBYFRQ Phs
1573  const SgMatrix* refFreqByChan, // RFREQ
1574  const SgMatrix* numOfSamplesByChan_USB, // #SAMPLES usb
1575  const SgMatrix* numOfSamplesByChan_LSB, // #SAMPLES lsb
1576  const SgMatrix* numOfAccPeriodsByChan_USB, // NO.OF AP usb
1577  const SgMatrix* numOfAccPeriodsByChan_LSB, // NO.OF AP lsb
1578  const SgMatrix* loFreqs_1, // LO FREQ @1
1579  const SgMatrix* loFreqs_2 // LO FREQ @2
1580  )
1581 {
1582  if (!bandDataByName_.contains(band))
1583  {
1585  "::storeObsChannelInfo(): the band \"" + band + "\" is not registered");
1586  return false;
1587  };
1588  SgVdbVariable &var=bandDataByName_[band].vChannelInfo_;
1589  SgNetCdf ncdf(path2RootDir_ + "/" +
1591  sessionCode_, "", band);
1592  //
1593  if (numOfObs_ != numOfChannels.size())
1594  {
1596  "::storeObsChannelInfo(): numOfChannels vector size mismatch: " +
1597  QString("").sprintf("%d vs %d", numOfObs_, numOfChannels.size()));
1598  return false;
1599  };
1600  //
1602  if (originType == SgVlbiSessionInfo::OT_KOMB)
1603  fcfChannelInfo = fcfChannelInfoKomb;
1604  //
1605  if (!setupFormat(fcfChannelInfo, ncdf, "", band))
1606  {
1608  "::storeObsChannelInfo(): format description failed");
1609  return false;
1610  };
1611  //
1612  //
1613  bool isNewMode=false;
1614  if (originType == SgVlbiSessionInfo::OT_MK4 ||
1615  (originType == SgVlbiSessionInfo::OT_AGV &&
1617  isNewMode = true;
1618 
1619 
1620  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1621  //
1622  char *pChannelID=NULL;
1623  char *pPolarization=NULL;
1624  short *pNumChannels=ncdf.lookupVar(fcNumChannels.name())->data2short();
1625  short *pBITSAMPL=NULL;
1626  short *pERRORATE=NULL;
1627  short *pBBCIndex=NULL;
1628  short *pINDEXNUM=NULL;
1629  double *pSampleRate=ncdf.lookupVar(fcSampleRate.name())->data2double();
1630  double *pChanAmpPhase=ncdf.lookupVar(fcChanAmpPhase.name())->data2double();
1631  double *pChannelFreq=ncdf.lookupVar(fcChannelFreq.name())->data2double();
1632  double *pNumSamples=NULL;
1633  double *pLOFreq=NULL;
1634  short *pNumAp=ncdf.lookupVar(fcNumAp.name())->data2short();
1635  //
1636  // Mk4 extension:
1637 // if (originType == SgVlbiSessionInfo::OT_MK4)
1638 // SgVgosDb::CT_Mk3 || SgVgosDb::CT_CRL || SgVgosDb::CT_GSI || SgVgosDb::CT_S2
1639  if (isNewMode)
1640  {
1641  pChannelID = ncdf.lookupVar(fcChannelID.name())->data2char();
1642  pPolarization = ncdf.lookupVar(fcPolarization.name())->data2char();
1643  pBITSAMPL = ncdf.lookupVar(fcBITSAMPL.name())->data2short();
1644  pERRORATE = ncdf.lookupVar(fcERRORATE.name())->data2short();
1645  pBBCIndex = ncdf.lookupVar(fcBBCIndex.name())->data2short();
1646  pINDEXNUM = ncdf.lookupVar(fcINDEXNUM.name())->data2short();
1647  pNumSamples = ncdf.lookupVar(fcNumSamples.name())->data2double();
1648  pLOFreq = ncdf.lookupVar(fcLOFreq.name())->data2double();
1649  }
1650  // KOMB extension:
1651  else if (originType == SgVlbiSessionInfo::OT_KOMB)
1652  {
1653  // reserved
1654  };
1655  //
1656  // fill data structures:
1657  //
1658  for (int i=0; i<numOfObs_; i++)
1659  {
1660  // common for all types of correlator:
1661  pNumChannels[i] = numOfChannels[i];
1662  pSampleRate[i] = sampleRate->getElement(i);
1663  //
1664  // Mk4 specific part:
1665 // if (originType == SgVlbiSessionInfo::OT_MK4)
1666  if (isNewMode)
1667  {
1668  strncpy(pChannelID + 2*numOfChan_*i, qPrintable(channelIds.at(i)), 2*numOfChan_);
1669  strncpy(pPolarization + 4*numOfChan_*i, qPrintable(polarizations.at(i)), 4*numOfChan_);
1670  }
1671  // KOMB specific part:
1672  else if (originType == SgVlbiSessionInfo::OT_KOMB)
1673  {
1674  // reserved
1675  };
1676  //
1677  // per channel data:
1678  for (int j=0; j<numOfChan_; j++)
1679  {
1680  // common part:
1681  pNumAp[2*numOfChan_*i + 2*j ] = round(numOfAccPeriodsByChan_USB->getElement(i,j));
1682  pNumAp[2*numOfChan_*i + 2*j + 1] = round(numOfAccPeriodsByChan_LSB->getElement(i,j));
1683  pChannelFreq [numOfChan_ *i + j] = refFreqByChan->getElement(i,j);
1684  pChanAmpPhase [numOfChan_*2*i + 2*j + 0] = residFringeAmplByChan->getElement(i,j);
1685  pChanAmpPhase [numOfChan_*2*i + 2*j + 1] = residFringePhseByChan->getElement(i,j);
1686  //
1687  // Mk4 specific part:
1688 // if (originType == SgVlbiSessionInfo::OT_MK4)
1689  if (isNewMode)
1690  {
1691  //fcERRORATE:
1692  if (errorRates_1.at(i).size()==numOfChan_ && errorRates_2.at(i).size()==numOfChan_)
1693  {
1694  // LSB here is the same as USB:
1695  pERRORATE[4*numOfChan_*i + 4*j ] = errorRates_1.at(i).at(j);
1696  pERRORATE[4*numOfChan_*i + 4*j + 1] = errorRates_2.at(i).at(j);
1697  pERRORATE[4*numOfChan_*i + 4*j + 2] = errorRates_1.at(i).at(j);
1698  pERRORATE[4*numOfChan_*i + 4*j + 3] = errorRates_2.at(i).at(j);
1699  };
1700  //fcLOFreq:
1701  pLOFreq[2*numOfChan_*i + 2*j ] = loFreqs_1->getElement(i,j);
1702  pLOFreq[2*numOfChan_*i + 2*j + 1] = loFreqs_2->getElement(i,j);
1703  //fcNumSamples:
1704  pNumSamples[2*numOfChan_*i + 2*j ] = numOfSamplesByChan_USB->getElement(i,j);
1705  pNumSamples[2*numOfChan_*i + 2*j + 1] = numOfSamplesByChan_LSB->getElement(i,j);
1706  //fcBITSAMPL:
1707  pBITSAMPL[i] = bitsPerSamples.at(i);
1708  //fcBBCIndex:
1709  if (bbcIdxs_1.at(i).size()==numOfChan_ && bbcIdxs_2.at(i).size()==numOfChan_)
1710  {
1711  pBBCIndex[2*numOfChan_*i + 2*j ] = bbcIdxs_1.at(i).at(j);
1712  pBBCIndex[2*numOfChan_*i + 2*j + 1] = bbcIdxs_2.at(i).at(j);
1713  };
1714  //fcINDEXNUM:
1715  if (corelIdxNumbersUsb.at(i).size()==numOfChan_ && corelIdxNumbersLsb.at(i).size()==numOfChan_)
1716  {
1717  pINDEXNUM[2*numOfChan_*i + 2*j ] = corelIdxNumbersUsb.at(i).at(j);
1718  pINDEXNUM[2*numOfChan_*i + 2*j + 1] = corelIdxNumbersLsb.at(i).at(j);
1719  };
1720  }
1721  // KOMB specific part:
1722  else if (originType == SgVlbiSessionInfo::OT_KOMB)
1723  {
1724  // reserved
1725  };
1726  };
1727  //
1728  };
1729  // write data:
1731  if (!ncdf.putData())
1732  {
1734  "::storeObsChannelInfo(): cannot put data into " + ncdf.getFileName());
1735  return false;
1736  };
1739  "::storeObsChannelInfo(): the data were successfully stored in " + ncdf.getFileName());
1740  return true;
1741 };
1742 
1743 
1744 
1745 //
1747  const SgMatrix* phCalFrqs_1ByChan,
1748  const SgMatrix* phCalAmps_1ByChan,
1749  const SgMatrix* phCalPhss_1ByChan,
1750  const SgMatrix* phCalOffs_1ByChan,
1751  const SgVector* phCalRates_1,
1752 
1753  const SgMatrix* phCalFrqs_2ByChan,
1754  const SgMatrix* phCalAmps_2ByChan,
1755  const SgMatrix* phCalPhss_2ByChan,
1756  const SgMatrix* phCalOffs_2ByChan,
1757  const SgVector* phCalRates_2
1758  )
1759 {
1760  if (!bandDataByName_.contains(band))
1761  {
1763  "::storeObsPhaseCalInfo(): the band \"" + band + "\" is not registered");
1764  return false;
1765  };
1766  SgVdbVariable &var=bandDataByName_[band].vPhaseCalInfo_;
1767  SgNetCdf ncdf(path2RootDir_ + "/" +
1769  sessionCode_, "", band);
1771  if (originType == SgVlbiSessionInfo::OT_KOMB)
1773  //
1774  if (numOfObs_ != (int)phCalFrqs_1ByChan->nRow())
1775  {
1777  "::storeObsPhaseCalInfo(): phCalFrqs_1ByChan matrix size mismatch: " +
1778  QString("").sprintf("%d vs %d", numOfObs_, phCalFrqs_1ByChan->nRow()));
1779  return false;
1780  };
1781  //
1782  if (!setupFormat(fcfPhaseCalInfo, ncdf, "", band))
1783  {
1785  "::storeObsPhaseCalInfo(): format description failed");
1786  return false;
1787  };
1788  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1789  //
1790  double *pPhaseCalRate=ncdf.lookupVar(fcPhaseCalRate.name())->data2double();
1791  short *pPhaseCalFreq=ncdf.lookupVar(fcPhaseCalFreq.name())->data2short();
1792  short *pPhaseCalAmp=ncdf.lookupVar(fcPhaseCalAmp.name())->data2short();
1793  short *pPhaseCalPhase=ncdf.lookupVar(fcPhaseCalPhase.name())->data2short();
1794  short *pPhaseCalOffset=NULL;
1795  if (originType == SgVlbiSessionInfo::OT_MK4 ||
1796  originType == SgVlbiSessionInfo::OT_AGV)
1797  pPhaseCalOffset = ncdf.lookupVar(fcPhaseCalOffset.name())->data2short();
1798  //
1799  for (int i=0; i<numOfObs_; i++)
1800  {
1801  pPhaseCalRate[2*i ] = phCalRates_1->getElement(i);
1802  pPhaseCalRate[2*i + 1 ] = phCalRates_2->getElement(i);
1803  // per channel data:
1804  for (int j=0; j<numOfChan_; j++)
1805  {
1806  // fcPhaseCalFreq:
1807  pPhaseCalFreq[2*numOfChan_*i + 2*j ] = round(phCalFrqs_1ByChan-> getElement(i,j));
1808  pPhaseCalFreq[2*numOfChan_*i + 2*j + 1] = round(phCalFrqs_2ByChan-> getElement(i,j));
1809  // fcPhaseCalAmp:
1810  pPhaseCalAmp[2*numOfChan_*i + 2*j ] = round(phCalAmps_1ByChan-> getElement(i,j));
1811  pPhaseCalAmp[2*numOfChan_*i + 2*j + 1] = round(phCalAmps_2ByChan-> getElement(i,j));
1812  // fcPhaseCalPhase:
1813  pPhaseCalPhase[2*numOfChan_*i + 2*j ] = round(phCalPhss_1ByChan-> getElement(i,j));
1814  pPhaseCalPhase[2*numOfChan_*i + 2*j + 1] = round(phCalPhss_2ByChan-> getElement(i,j));
1815  // fcPhaseCalOffset:
1816  if (originType == SgVlbiSessionInfo::OT_MK4 ||
1817  originType == SgVlbiSessionInfo::OT_AGV)
1818  {
1819  pPhaseCalOffset[2*numOfChan_*i + 2*j ] = round(phCalOffs_1ByChan-> getElement(i,j));
1820  pPhaseCalOffset[2*numOfChan_*i + 2*j + 1] = round(phCalOffs_2ByChan-> getElement(i,j));
1821  };
1822  };
1823  };
1824  // write data:
1826  if (!ncdf.putData())
1827  {
1829  "::storeObsPhaseCalInfo(): cannot put data into " + ncdf.getFileName());
1830  return false;
1831  };
1834  "::storeObsPhaseCalInfo(): the data were successfully stored in " + ncdf.getFileName());
1835  return true;
1836 };
1837 
1838 
1839 
1840 //
1842  const QVector<QString>& fourfitOutputFName, // fcFOURFFIL
1843  const QVector<QString>& fourfitErrorCodes, // fcFRNGERR
1844  const QVector<QString>& frqGrpCodes, // fcFRQGROUP
1845  const QVector<int>& corelVersions, // fcCORELVER
1846  const QVector<int>& startOffsets, // fcStartOffset
1847  const QVector< QVector<int> >& fourfitVersions, // fcFOURFVER
1848  const QVector< QVector<int> >& dbeditVersion, // fcDBEDITVE
1849  const SgVector* deltaEpochs, // fcDELTAEPO
1850  const SgMatrix* urvrs, // fcURVR
1851  const SgMatrix* instrDelays, // fcIDELAY
1852  const SgMatrix* starElev, // fcSTARELEV
1853  const SgMatrix* zenithDelays, // fcZDELAY
1854  const SgMatrix* searchParams, // fcSRCHPAR
1855  const QVector<QString>& baselineCodes, // fcCORBASCD
1856  const QVector<QString>& tapeQualityCodes, // fcTapeCode
1857  const QVector<int>& stopOffsets, // fcStopOffset
1858  const QVector<int>& hopsRevisionNumbers, // fcHopsRevNum
1859  const SgVector* sampleRate, // fcRECSETUP
1860  const SgVector* sbdResids, // fcSBRESID
1861  const SgVector* rateResids, // fcRATRESID
1862  const SgVector* effDurations, // fcEffectiveDuration
1863  const SgVector* startSeconds, // fcStartSec
1864  const SgVector* stopSeconds, // fcStopSec
1865  const SgVector* percentOfDiscards, // fcDISCARD
1866  const SgVector* uniformityFactors, // fcQBFACTOR
1867  const SgVector* geocenterPhaseResids, // fcGeocResidPhase
1868  const SgVector* geocenterPhaseTotals, // fcGeocPhase
1869  const SgVector* geocenterSbDelays, // fcGeocSBD
1870  const SgVector* geocenterGrDelays, // fcGeocMBD
1871  const SgVector* geocenterDelayRates, // fcGeocRate
1872  const SgVector* probOfFalses, // fcProbFalseDetection
1873  const SgVector* corrAprioriDelays, // fcABASDEL
1874  const SgVector* corrAprioriRates, // fcABASRATE
1875  const SgVector* corrAprioriAccs, // fcABASACCE
1876  const SgVector* incohAmps, // fcINCOHAMP
1877  const SgVector* incohAmps2, // fcINCOH2
1878  const SgVector* delayResids, // fcDELRESID
1879  const QVector<QString>& vlb1FileNames, // fcVLB1FILE
1880  const QVector<QString>& tapeIds_1, // fcTAPEID
1881  const QVector<QString>& tapeIds_2, // fcTAPEID
1882  const QVector< QVector<int> >& epochsOfCorrelations, // fcUTCCorr
1883  const QVector< QVector<int> >& epochsOfCentrals, // fcUTCMidObs
1884  const QVector< QVector<int> >& epochsOfFourfitings, // fcFOURFUTC
1885  const QVector< QVector<int> >& epochsOfNominalScanTime, // fcUTCScan
1886  const SgMatrix* corrClocks, // fcCORCLOCK
1887  const SgMatrix* mDlys, // fcDLYEPOm1, fcDLYEPOCH, fcDLYEPOp1
1888  const SgMatrix* mAux // fcAPCLOFST, fcTOTPCENT, fcRATOBSVM,
1889  // fcUTCVLB2, fcDELOBSVM
1890  )
1891 {
1892  if (!bandDataByName_.contains(band))
1893  {
1895  "::storeObsCorrelatorInfo(): the band \"" + band + "\" is not registered");
1896  return false;
1897  };
1898  if (originType == SgVlbiSessionInfo::OT_UNKNOWN)
1899  {
1901  "::storeObsCorrelatorInfo(): the data origin type is unknown");
1902  return false;
1903  };
1904 
1905  SgVdbVariable &var=bandDataByName_[band].vCorrInfo_;
1906  // adjust the stub:
1907  if (originType == SgVlbiSessionInfo::OT_KOMB)
1908  var.setStub("CorrInfo-GSI");
1909  else if ( originType == SgVlbiSessionInfo::OT_MK4 ||
1910  originType == SgVlbiSessionInfo::OT_AGV)
1911  var.setStub("CorrInfo-difx");
1912  //
1913  SgNetCdf ncdf(path2RootDir_ + "/" +
1915  sessionCode_, "", band);
1916  //
1917  if (numOfObs_ != fourfitOutputFName.size())
1918  {
1920  "::storeObsCorrelatorInfo(): fourfitOutputFName vector size mismatch: " +
1921  QString("").sprintf("%d vs %d", numOfObs_, fourfitOutputFName.size()));
1922  return false;
1923  };
1924  //
1925  int ffStrLength;
1926  ffStrLength = 0;
1927  for (int i=0; i<numOfObs_; i++)
1928  if (ffStrLength < fourfitOutputFName.at(i).size())
1929  ffStrLength = fourfitOutputFName.at(i).size();
1930  if (fcFOURFFIL.dims()[1] < ffStrLength)
1931  fcFOURFFIL.alternateDimension(1, ffStrLength);
1932  else if (fcFOURFFIL.dims()[1] > ffStrLength)
1933  ffStrLength = fcFOURFFIL.dims()[1];
1934  //
1935  //
1937  if (originType == SgVlbiSessionInfo::OT_KOMB)
1938  fcfCorrInfo=fcfCorrInfoKomb;
1939  //
1940  //
1941  if (!setupFormat(fcfCorrInfo, ncdf, "", band))
1942  {
1944  "::storeObsCorrelatorInfo(): format description failed");
1945  return false;
1946  };
1948  ncdf.setServiceVars(var.getStub(), "Data are extracted from correlator output", "Obs", "TimeUTC.nc");
1949  //
1950  //
1951  // common:
1952  char *pFOURFFIL=ncdf.lookupVar(fcFOURFFIL.name())->data2char();
1953  char *pFRQGROUP=ncdf.lookupVar(fcFRQGROUP.name())->data2char();
1954  short *pDBEDITVE=ncdf.lookupVar(fcDBEDITVE.name())->data2short();
1955  double *pDELTAEPO=ncdf.lookupVar(fcDELTAEPO.name())->data2double();
1956  double *pSRCHPAR=ncdf.lookupVar(fcSRCHPAR.name())->data2double();
1957  char *pCORBASCD=ncdf.lookupVar(fcCORBASCD.name())->data2char();
1958  char *pTapeCode=ncdf.lookupVar(fcTapeCode.name())->data2char();
1959  double *pSBRESID=ncdf.lookupVar(fcSBRESID.name())->data2double();
1960  double *pRATRESID=ncdf.lookupVar(fcRATRESID.name())->data2double();
1961  double *pEffectiveDuration=
1963  double *pStartSec=ncdf.lookupVar(fcStartSec.name())->data2double();
1964  double *pStopSec=ncdf.lookupVar(fcStopSec.name())->data2double();
1965  double *pDISCARD=ncdf.lookupVar(fcDISCARD.name())->data2double();
1966 
1967  double *pGeocResidPhase=ncdf.lookupVar(fcGeocResidPhase.name())->data2double();
1968  double *pProbFalseDetection=
1970  double *pABASRATE=ncdf.lookupVar(fcABASRATE.name())->data2double();
1971  double *pABASDEL=ncdf.lookupVar(fcABASDEL.name())->data2double();
1972  double *pABASACCE=ncdf.lookupVar(fcABASACCE.name())->data2double();
1973  double *pGeocPhase=ncdf.lookupVar(fcGeocPhase.name())->data2double();
1974  double *pINCOHAMP=ncdf.lookupVar(fcINCOHAMP.name())->data2double();
1975  double *pINCOH2=ncdf.lookupVar(fcINCOH2.name())->data2double();
1976  double *pDELRESID=ncdf.lookupVar(fcDELRESID.name())->data2double();
1977  short *pUTCCorr=ncdf.lookupVar(fcUTCCorr.name())->data2short();
1978  short *pUTCMidObs=ncdf.lookupVar(fcUTCMidObs.name())->data2short();
1979  // Mk4 specific:
1980  char *pFRNGERR=NULL;
1981  short *pCORELVER=NULL;
1982  short *pStartOffset=NULL;
1983  short *pFOURFVER=NULL;
1984  double *pURVR=NULL;
1985  double *pIDELAY=NULL;
1986  double *pSTARELEV=NULL;
1987  double *pZDELAY=NULL;
1988  short *pStopOffset=NULL;
1989  short *pHopsRevNum=NULL;
1990  double *pQBFACTOR=NULL;
1991  double *pGeocSBD=NULL;
1992  double *pGeocRate=NULL;
1993  double *pGeocMBD=NULL;
1994  short *pFOURFUTC=NULL;
1995  short *pUTCScan=NULL;
1996  char *pTAPEID=NULL;
1997  double *pCORCLOCK=NULL;
1998  // KOMB specific:
1999  short *pFRNGERR4S2=NULL;
2000  char *pVLB1FILE=NULL;
2001  short *pRECSETUP=NULL;
2002  double *pDLYEPOp1=NULL;
2003  double *pDLYEPOCH=NULL;
2004  double *pDLYEPOm1=NULL;
2005  double *pAPCLOFST=NULL;
2006  double *pTOTPCENT=NULL;
2007  double *pRATOBSVM=NULL;
2008  double *pDELOBSVM=NULL;
2009  //
2010  //
2011  // Mk4 extension:
2012  if (originType == SgVlbiSessionInfo::OT_MK4 ||
2013  originType == SgVlbiSessionInfo::OT_AGV)
2014  {
2015  pFRNGERR = ncdf.lookupVar(fcFRNGERR.name())->data2char();
2016  pCORELVER = ncdf.lookupVar(fcCORELVER.name())->data2short();
2017  pStartOffset = ncdf.lookupVar(fcStartOffset.name())->data2short();
2018  pFOURFVER = ncdf.lookupVar(fcFOURFVER.name())->data2short();
2019  pURVR = ncdf.lookupVar(fcURVR.name())->data2double();
2020  pIDELAY = ncdf.lookupVar(fcIDELAY.name())->data2double();
2021  pSTARELEV = ncdf.lookupVar(fcSTARELEV.name())->data2double();
2022  pZDELAY = ncdf.lookupVar(fcZDELAY.name())->data2double();
2023  pStopOffset = ncdf.lookupVar(fcStopOffset.name())->data2short();
2024  pHopsRevNum = ncdf.lookupVar(fcHopsRevNum.name())->data2short();
2025  pQBFACTOR = ncdf.lookupVar(fcQBFACTOR.name())->data2double();
2026  pGeocSBD = ncdf.lookupVar(fcGeocSBD.name())->data2double();
2027  pGeocRate = ncdf.lookupVar(fcGeocRate.name())->data2double();
2028  pGeocMBD = ncdf.lookupVar(fcGeocMBD.name())->data2double();
2029  pFOURFUTC = ncdf.lookupVar(fcFOURFUTC.name())->data2short();
2030  pUTCScan = ncdf.lookupVar(fcUTCScan.name())->data2short();
2031  pTAPEID = ncdf.lookupVar(fcTAPEID.name())->data2char();
2032  pCORCLOCK = ncdf.lookupVar(fcCORCLOCK.name())->data2double();
2033  }
2034  else if (originType == SgVlbiSessionInfo::OT_KOMB)
2035  {
2036  pFRNGERR4S2 = ncdf.lookupVar(fcFRNGERR4S2.name())->data2short();
2037  pVLB1FILE = ncdf.lookupVar(fcVLB1FILE.name())->data2char();
2038  pRECSETUP = ncdf.lookupVar(fcRECSETUP.name())->data2short();
2039  pDLYEPOp1 = ncdf.lookupVar(fcDLYEPOp1.name())->data2double();
2040  pDLYEPOCH = ncdf.lookupVar(fcDLYEPOCH.name())->data2double();
2041  pDLYEPOm1 = ncdf.lookupVar(fcDLYEPOm1.name())->data2double();
2042  pAPCLOFST = ncdf.lookupVar(fcAPCLOFST.name())->data2double();
2043  pTOTPCENT = ncdf.lookupVar(fcTOTPCENT.name())->data2double();
2044  pRATOBSVM = ncdf.lookupVar(fcRATOBSVM.name())->data2double();
2045  pDELOBSVM = ncdf.lookupVar(fcDELOBSVM.name())->data2double();
2046  // just use another vgosDb variable:
2047  pFOURFUTC = ncdf.lookupVar(fcUTCVLB2.name())->data2short();
2048  };
2049  //
2050  //
2051  for (int i=0; i<numOfObs_; i++)
2052  {
2053  strncpy(pFOURFFIL + ffStrLength*i, qPrintable(fourfitOutputFName.at(i)), ffStrLength);
2054  //
2055  if (dbeditVersion.at(i).size()==3)
2056  {
2057  pDBEDITVE [3*i ] = dbeditVersion.at(i).at(0);
2058  pDBEDITVE [3*i+1] = dbeditVersion.at(i).at(1);
2059  pDBEDITVE [3*i+2] = dbeditVersion.at(i).at(2);
2060  };
2061 // pREFCLKER [i ] = refClkErr->getElement(i);
2062  pSBRESID [i] = sbdResids->getElement(i);
2063  pRATRESID [i] = rateResids->getElement(i);
2064  pEffectiveDuration [i] = effDurations->getElement(i);
2065  pStartSec [i] = startSeconds->getElement(i);
2066  pStopSec [i] = stopSeconds->getElement(i);
2067  pDISCARD [i] = percentOfDiscards->getElement(i);
2068  pGeocResidPhase [i] = geocenterPhaseResids->getElement(i);
2069  pGeocPhase [i] = geocenterPhaseTotals->getElement(i);
2070  pProbFalseDetection [i] = probOfFalses->getElement(i);
2071  pABASRATE [i] = corrAprioriRates->getElement(i);
2072  pABASDEL [i] = corrAprioriDelays->getElement(i);
2073  pABASACCE [i] = corrAprioriAccs->getElement(i);
2074  pINCOHAMP [i] = incohAmps->getElement(i);
2075  pINCOH2 [i] = incohAmps2->getElement(i);
2076  pDELRESID [i] = delayResids->getElement(i);
2077  //fcDELTAEPO:
2078  pDELTAEPO [i] = deltaEpochs->getElement(i);
2079  //
2080  for (int j=0; j<6; j++)
2081  pSRCHPAR [6*i + j] = searchParams->getElement(i,j);
2082  //
2083  if (epochsOfCorrelations.at(i).size()==6 &&
2084  epochsOfCentrals.at(i).size()==6 &&
2085  epochsOfFourfitings.at(i).size()==6 )
2086  for (int j=0; j<6; j++)
2087  {
2088  pUTCCorr [6*i + j] = epochsOfCorrelations.at(i).at(j);
2089  pUTCMidObs[6*i + j] = epochsOfCentrals.at(i).at(j);
2090  pFOURFUTC [6*i + j] = epochsOfFourfitings.at(i).at(j);
2091  }
2092  else
2094  "::storeObsCorrelatorInfo(): Warning: one of epochs (Correlations, Centrals or Fourfitings} "
2095  "has wrong dimensions");
2096  //
2097  strncpy(pFRQGROUP + 2*i, qPrintable(frqGrpCodes.at(i)), 2);
2098  strncpy(pCORBASCD + 2*i, qPrintable(baselineCodes.at(i)), 2);
2099  strncpy(pTapeCode + 6*i, qPrintable(tapeQualityCodes.at(i)), 6);
2100  //
2101  if (originType == SgVlbiSessionInfo::OT_MK4 ||
2102  originType == SgVlbiSessionInfo::OT_AGV)
2103  {
2104  strncpy(pFRNGERR + i, qPrintable(fourfitErrorCodes.at(i)), 1);
2105  //fcCORELVER:
2106  pCORELVER[i] = corelVersions.at(i);
2107  //fcFOURFVER:
2108  if (fourfitVersions.at(i).size()==2)
2109  {
2110  pFOURFVER[2*i ] = fourfitVersions.at(i).at(0);
2111  pFOURFVER[2*i+1] = fourfitVersions.at(i).at(1);
2112  };
2113  //fcStartOffset:
2114  pStartOffset[i] = startOffsets.at(i);
2115  //fcStopOffset:
2116  pStopOffset [i] = stopOffsets[i];
2117  pHopsRevNum [i] = hopsRevisionNumbers[i];
2118  //fcGeocSBD:
2119  pGeocSBD [i] = geocenterSbDelays->getElement(i);
2120  //fcGeocMBD:
2121 // pGeocMBD [i] = geocenterDelayRates->getElement(i);
2122  pGeocMBD [i] = geocenterGrDelays->getElement(i);
2123  //fcGeocRate:
2124 // pGeocRate [i] = geocenterGrDelays->getElement(i);
2125  pGeocRate [i] = geocenterDelayRates->getElement(i);
2126  //fcQBFACTOR:
2127  pQBFACTOR [i] = uniformityFactors->getElement(i);
2128  //fcZDELAY:
2129  pZDELAY [2*i ] = zenithDelays->getElement(i,0);
2130  pZDELAY [2*i+1] = zenithDelays->getElement(i,1);
2131  //fcIDELAY:
2132  pIDELAY [2*i ] = instrDelays->getElement(i,0);
2133  pIDELAY [2*i+1] = instrDelays->getElement(i,1);
2134  //fcURVR:
2135  pURVR [2*i ] = urvrs->getElement(i,0);
2136  pURVR [2*i+1] = urvrs->getElement(i,1);
2137  //fcSTARELEV:
2138  pSTARELEV [2*i ] = starElev->getElement(i,0);
2139  pSTARELEV [2*i+1] = starElev->getElement(i,1);
2140  //fcCORCLOCK:
2141  pCORCLOCK[4*i ] = corrClocks->getElement(i, 0);
2142  pCORCLOCK[4*i + 1 ] = corrClocks->getElement(i, 1);
2143  pCORCLOCK[4*i + 2 ] = corrClocks->getElement(i, 2);
2144  pCORCLOCK[4*i + 3 ] = corrClocks->getElement(i, 3);
2145  //fcUTCScan:
2146  if (epochsOfNominalScanTime.at(i).size() == 6)
2147  for (int j=0; j<6; j++)
2148  pUTCScan [6*i + j] = epochsOfNominalScanTime.at(i).at(j);
2149  else
2151  "::storeObsCorrelatorInfo(): Warning: epochsOfNominalScanTime has wrong dimensions");
2152  //fcTAPEID:
2153  strncpy(pTAPEID + 2*8*i, qPrintable(tapeIds_1.at(i)), 8);
2154  strncpy(pTAPEID + 2*8*i + 8, qPrintable(tapeIds_2.at(i)), 8);
2155  }
2156  else if (originType == SgVlbiSessionInfo::OT_KOMB)
2157  {
2158  if (fourfitErrorCodes.at(i) == "" || fourfitErrorCodes.at(i).simplified() == "")
2159  pFRNGERR4S2[i] = 0;
2160  else
2161  pFRNGERR4S2[i] = 1;
2162  //fcRECSETUP:
2163  pRECSETUP[3*i+0] = round(sampleRate->getElement(i)*1.0e-3);
2164  pRECSETUP[3*i+1] = 1;
2165  pRECSETUP[3*i+2] = 1;
2166  pDLYEPOm1[i] = mDlys->getElement(i, 0);
2167  pDLYEPOCH[i] = mDlys->getElement(i, 1);
2168  pDLYEPOp1[i] = mDlys->getElement(i, 2);
2169 
2170  pAPCLOFST[i] = mAux->getElement(i, 0);
2171  pTOTPCENT[i] = mAux->getElement(i, 1);
2172  pRATOBSVM[i] = mAux->getElement(i, 2);
2173  pDELOBSVM[2*i + 1] = modf(mAux->getElement(i, 3)*1.0e6, &pDELOBSVM[2*i]);
2174 
2175  strncpy(pVLB1FILE + 6*i, qPrintable(vlb1FileNames.at(i)), 6);
2176  };
2177  };
2178  // write data:
2180  if (!ncdf.putData())
2181  {
2183  "::storeObsCorrelatorInfo(): cannot put data into " + ncdf.getFileName());
2184  return false;
2185  };
2188  "::storeObsCorrelatorInfo(): the data were successfully stored in " + ncdf.getFileName());
2189  return true;
2190 };
2191 
2192 
2193 
2194 //
2196 {
2198  SgNetCdf ncdf(path2RootDir_ + "/" +
2200  sessionCode_);
2201  //
2202  if (numOfObs_ != (int)v->n())
2203  {
2205  "::storeObsDelayTheoretical(): vector v size mismatch: " +
2206  QString("").sprintf("%d vs %d", numOfObs_, v->n()));
2207  return false;
2208  };
2209  //
2210  if (!setupFormat(fcfDelayTheoretical, ncdf))
2211  {
2213  "::storeObsDelayTheoretical(): format description failed");
2214  return false;
2215  };
2216  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2217  "Obs", "TimeUTC.nc");
2218  //
2219  double *p=ncdf.lookupVar(fcDelayTheoretical.name())->data2double();
2220  for (int i=0; i<numOfObs_; i++)
2221  p[i] = v->getElement(i);
2222  // write data:
2224  if (!ncdf.putData())
2225  {
2227  "::storeObsDelayTheoretical(): cannot put data into " + ncdf.getFileName());
2228  return false;
2229  };
2232  "::storeObsDelayTheoretical(): the data were successfully stored in " + ncdf.getFileName());
2233  return true;
2234 };
2235 
2236 
2237 
2238 //
2240 {
2242  SgNetCdf ncdf(path2RootDir_ + "/" +
2244  sessionCode_);
2245  //
2246  if (numOfObs_ != (int)v->n())
2247  {
2249  "::storeObsRateTheoretical(): vector v size mismatch: " +
2250  QString("").sprintf("%d vs %d", numOfObs_, v->n()));
2251  return false;
2252  };
2253  //
2254  if (!setupFormat(fcfRateTheoretical, ncdf))
2255  {
2257  "::storeObsRateTheoretical(): format description failed");
2258  return false;
2259  };
2260  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2261  "Obs", "TimeUTC.nc");
2262  //
2263  double *p=ncdf.lookupVar(fcRateTheoretical.name())->data2double();
2264  for (int i=0; i<numOfObs_; i++)
2265  p[i] = v->getElement(i);
2266  // write data:
2268  if (!ncdf.putData())
2269  {
2271  "::storeObsRateTheoretical(): cannot put data into " + ncdf.getFileName());
2272  return false;
2273  };
2276  "::storeObsRateTheoretical(): the data were successfully stored in " + ncdf.getFileName());
2277  return true;
2278 };
2279 
2280 
2281 
2282 //
2283 bool SgVgosDb::storeObsStd1Contribution(const QString& varName, const SgMatrix* contrib,
2284  SgVdbVariable& var, const QList<SgVgosDb::FmtChkVar*>& fcf)
2285 {
2286  SgNetCdf ncdf(path2RootDir_ + "/" +
2288  sessionCode_);
2289  //
2290  if (numOfObs_ != (int)contrib->nRow())
2291  {
2293  "::storeObsStd1Contribution(): " + varName + ": matrix contrib size mismatch: " +
2294  QString("").sprintf("%d vs %d", numOfObs_, contrib->nRow()));
2295  return false;
2296  };
2297  if (2 != (int)contrib->nCol())
2298  {
2300  "::storeObsStd1Contribution(): " + varName + ": matrix contrib size is unexpected: " +
2301  QString("").setNum(contrib->nCol()) + ", should be 2");
2302  return false;
2303  };
2304  if (fcf.size() != 1)
2305  {
2307  "::storeObsStd1Contribution(): " + varName + ": FCF list size is unexpected: " +
2308  QString("").setNum(fcf.size()) + ", should be 1");
2309  return false;
2310  };
2311  const SgVgosDb::FmtChkVar *fc=fcf.at(0);
2312  //
2313  if (!setupFormat(fcf, ncdf))
2314  {
2316  "::storeObsStd1Contribution(): " + varName + ": format description failed");
2317  return false;
2318  };
2319  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2320  "Obs", "TimeUTC.nc");
2321  //
2322  double *p=ncdf.lookupVar(fc->name())->data2double();
2323  for (int i=0; i<numOfObs_; i++)
2324  {
2325  p[2*i ] = contrib->getElement(i, 0);
2326  p[2*i + 1] = contrib->getElement(i, 1);
2327  };
2328  // write data:
2330  if (!ncdf.putData())
2331  {
2333  "::storeObsStd1Contribution(): " + varName + ": cannot put data into " + ncdf.getFileName());
2334  return false;
2335  };
2338  "::storeObsStd1Contribution(): " + varName + ": the data were successfully stored in " +
2339  ncdf.getFileName());
2340  return true;
2341 };
2342 
2343 
2344 
2345 //
2346 bool SgVgosDb::storeObsStd2Contribution(const QString& varName, const QList<const SgMatrix*> &contribs,
2347  SgVdbVariable& var, const QList<SgVgosDb::FmtChkVar*>& fcf)
2348 {
2349  //
2350  // order in contribs corresponds to the order in fcf
2351  //
2352  SgNetCdf ncdf(path2RootDir_ + "/" +
2354  sessionCode_);
2355  int numEl;
2356  //
2357  if ((numEl=contribs.size()) != fcf.size())
2358  {
2360  "::storeObsStd2Contribution(): " + varName + ": sizes of the lists mismatch: " +
2361  QString("").sprintf("%d vs %d", numEl, fcf.size()));
2362  return false;
2363  };
2364  // check consistency of the sizes:
2365  for (int i=0; i<contribs.size(); i++)
2366  {
2367  const SgMatrix *m=contribs.at(i);
2368  FmtChkVar *fc=fcf.at(i);
2369  if (numOfObs_ != (int)m->nRow())
2370  {
2372  "::storeObsStd2Contribution(): " + varName + ": matrix contribs[" + QString("").setNum(i) +
2373  "] size mismatch: " + QString("").sprintf("%d vs %d", numOfObs_, m->nRow()));
2374  return false;
2375  };
2376  if (2 != (int)m->nCol())
2377  {
2379  "::storeObsStd2Contribution(): " + varName + ": matrix contribs[" + QString("").setNum(i) +
2380  "] size is unexpected: " + QString("").setNum(m->nCol()) + ", should be 2");
2381  return false;
2382  };
2383  if (SD_NumObs!=fc->dims().at(0) || 2!=fc->dims().at(1))
2384  {
2386  "::storeObsStd2Contribution(): " + varName + ": FC[" + QString("").setNum(i) +
2387  "] sizes are unexpected: " + QString("").sprintf("%d:%d", fc->dims().at(0), fc->dims().at(1)) +
2388  ", should be " + QString("").setNum(numOfObs_) + ":2");
2389  return false;
2390  };
2391  };
2392  //
2393  if (!setupFormat(fcf, ncdf))
2394  {
2396  "::storeObsStd2Contribution(): " + varName + ": format description failed");
2397  return false;
2398  };
2399  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2400  "Obs", "TimeUTC.nc");
2401  //
2402  for (int i=0; i<numEl; i++)
2403  {
2404  const FmtChkVar *fc=fcf.at(i);
2405  const SgMatrix *m=contribs.at(i);
2406  double *p=ncdf.lookupVar(fc->name())->data2double();
2407  for (int i=0; i<numOfObs_; i++)
2408  {
2409  p[2*i ] = m->getElement(i, 0);
2410  p[2*i + 1] = m->getElement(i, 1);
2411  };
2412  };
2413  // write data:
2415  if (!ncdf.putData())
2416  {
2418  "::storeObsStd2Contribution(): " + varName + ": cannot put data into " + ncdf.getFileName());
2419  return false;
2420  };
2423  "::storeObsStd2Contribution(): " + varName + ": the data were successfully stored in " +
2424  ncdf.getFileName());
2425  return true;
2426 };
2427 
2428 
2429 
2430 //
2431 bool SgVgosDb::storeObsCalEarthTide(const SgMatrix* contrib, const QString& kind)
2432 {
2433  vCal_EarthTide_.setKind(kind);
2434  return storeObsStd1Contribution("Cal_EarthTide", contrib, vCal_EarthTide_, fcfCalEarthTide);
2435 };
2436 
2437 
2438 
2439 //
2441 {
2442  return storeObsStd1Contribution("Cal_FeedCorrection", contrib, vCal_FeedCorrection_,
2444 };
2445 
2446 
2447 
2448 //
2450 {
2451  return storeObsStd1Contribution("Cal_OceanLoad", contrib, vCal_OceanLoad_, fcfCalOceanLoad);
2452 };
2453 
2454 
2455 
2456 //
2458 {
2459  return storeObsStd1Contribution("Cal_OceanLoadOld", contrib, vCal_OceanLoadOld_, fcfCalOceanLoadOld);
2460 };
2461 
2462 
2463 
2464 //
2466 {
2467  return storeObsStd1Contribution("Cal_OceanPoleTideLoad", contrib, vCal_OceanPoleTideLoad_,
2469 };
2470 
2471 
2472 
2473 //
2474 bool SgVgosDb::storeObsCalPoleTide(const SgMatrix* contrib, const QString& kind)
2475 {
2476  vCal_PoleTide_.setKind(kind);
2477  return storeObsStd1Contribution("Cal_PoleTide", contrib, vCal_PoleTide_, fcfCalPoleTide);
2478 };
2479 
2480 
2481 
2482 //
2484 {
2485  return storeObsStd1Contribution("Cal_PoleTideOldRestore", contrib, vCal_PoleTideOldRestore_,
2487 };
2488 
2489 
2490 
2491 //
2493 {
2494  return storeObsStd1Contribution("Cal_TiltRemover", contrib, vCal_TiltRemover_, fcfCalTiltRemover);
2495 };
2496 
2497 
2498 
2499 //
2501 {
2502  return storeObsStd1Contribution("Cal_Bend", contrib, vCal_Bend_, fcfCalBend);
2503 };
2504 
2505 
2506 
2507 //
2509 {
2510  return storeObsStd1Contribution("Cal_BendSun", contrib, vCal_BendSun_, fcfCalBendSun);
2511 };
2512 
2513 
2514 
2515 //
2517 {
2518  return storeObsStd1Contribution("Cal_BendSunHigher", contrib, vCal_BendSunHigher_,
2520 };
2521 
2522 
2523 
2524 //
2526 {
2527  return storeObsStd1Contribution("Cal_Parallax", contrib, vCal_Parallax_, fcfCalParallax);
2528 };
2529 
2530 
2531 
2532 //
2533 bool SgVgosDb::storeObsCalHiFyErp(const SgMatrix* mUt1, const SgMatrix* mPxy, const QString& kind)
2534 {
2535  vCal_HfErp_.setKind(kind);
2536  return storeObsStd2Contribution("Cal_HfErp",
2537  QList<const SgMatrix*>() << mUt1 << mPxy, vCal_HfErp_, fcfCalHiFyErp);
2538 };
2539 
2540 
2541 
2542 //
2543 bool SgVgosDb::storeObsCalHiFyLibration(const SgMatrix* mUt1, const SgMatrix* mPxy, const QString& kind)
2544 {
2546  return storeObsStd2Contribution("Cal_HiFreqLibration",
2548 };
2549 
2550 
2551 
2552 //
2553 bool SgVgosDb::storeObsCalWobble(const SgMatrix* mPx, const SgMatrix* mPy)
2554 {
2555  return storeObsStd2Contribution("Cal_Wobble",
2557 };
2558 
2559 
2560 
2561 //
2563 {
2565  SgNetCdf ncdf(path2RootDir_ + "/" +
2567  sessionCode_, "", "");
2568  if (numOfObs_ != (int)v->n())
2569  {
2571  "::storeObsCalUnphase(): vector size mismatch: " +
2572  QString("").sprintf("%d vs %d", numOfObs_, v->n()));
2573  return false;
2574  };
2575  if (!setupFormat(fcfFractC, ncdf))
2576  {
2578  "::storeObsFractC(): format description failed");
2579  return false;
2580  };
2581  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2582  "Obs", "TimeUTC.nc");
2583  //
2584  double *p=ncdf.lookupVar(fcFractC.name())->data2double();
2585  for (int i=0; i<numOfObs_; i++)
2586  p[i] = v->getElement(i);
2587  // write data:
2589  if (!ncdf.putData())
2590  {
2592  "::storeObsFractC(): cannot put data into " + ncdf.getFileName());
2593  return false;
2594  };
2597  "::storeObsFractC(): the data were successfully stored in " + ncdf.getFileName());
2598  return true;
2599 };
2600 
2601 
2602 
2603 //
2604 bool SgVgosDb::storeObsCalUnphase(const QString &band,
2605  const SgMatrix* phaseCal_1, const SgMatrix* phaseCal_2)
2606 {
2607  if (!bandDataByName_.contains(band))
2608  {
2610  "::storeObsCalUnphase(): the band \"" + band + "\" is not registered");
2611  return false;
2612  };
2613  SgVdbVariable &var=bandDataByName_[band].vCal_Unphase_;
2614  SgNetCdf ncdf(path2RootDir_ + "/" +
2616  sessionCode_, "", band);
2617  //
2618  if (numOfObs_ != (int)phaseCal_1->nRow())
2619  {
2621  "::storeObsCalUnphase(): matrix size mismatch: " +
2622  QString("").sprintf("%d vs %d", numOfObs_, phaseCal_1->nRow()));
2623  return false;
2624  };
2625  //
2626  if (!setupFormat(fcfCalUnphase, ncdf, "", band))
2627  {
2629  "::storeObsCalUnphase(): format description failed");
2630  return false;
2631  };
2632  ncdf.setServiceVars(var.getStub(), "Data are calculated from correlator output", "Obs", "TimeUTC.nc");
2633  //
2634  double *p=ncdf.lookupVar(fcCalUnPhase.name())->data2double();
2635  for (int i=0; i<numOfObs_; i++)
2636  {
2637  p[4*i ] = phaseCal_1->getElement(i, 0);
2638  p[4*i + 1] = phaseCal_2->getElement(i, 0);
2639  p[4*i + 2] = phaseCal_1->getElement(i, 1);
2640  p[4*i + 3] = phaseCal_2->getElement(i, 1);
2641  };
2642  // write data:
2644  if (!ncdf.putData())
2645  {
2647  "::storeObsCalUnphase(): cannot put data into " + ncdf.getFileName());
2648  return false;
2649  };
2652  "::storeObsCalUnphase(): the data were successfully stored in " + ncdf.getFileName());
2653  return true;
2654 };
2655 
2656 
2657 
2658 
2659 //
2661 {
2663  SgNetCdf ncdf(path2RootDir_ + "/" +
2665  sessionCode_);
2666  //
2667  if (numOfObs_ != (int)partBend->nRow())
2668  {
2670  "::storeObsPartBend(): matrix partBend size mismatch: " +
2671  QString("").sprintf("%d vs %d", numOfObs_, partBend->nRow()));
2672  return false;
2673  };
2674  //
2675  if (!setupFormat(fcfPart_Bend, ncdf))
2676  {
2678  "::storeObsPartBend(): format description failed");
2679  return false;
2680  };
2681  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2682  "Obs", "TimeUTC.nc");
2683  //
2684  double *p=ncdf.lookupVar(fcPartBend.name())->data2double();
2685  for (int i=0; i<numOfObs_; i++)
2686  {
2687  p[2*i ] = partBend->getElement(i, 0);
2688  p[2*i + 1] = partBend->getElement(i, 1);
2689  };
2690  // write data:
2692  if (!ncdf.putData())
2693  {
2695  "::storeObsPartBend(): cannot put data into " + ncdf.getFileName());
2696  return false;
2697  };
2700  "::storeObsPartBend(): the data were successfully stored in " + ncdf.getFileName());
2701  return true;
2702 };
2703 
2704 
2705 
2706 //
2707 bool SgVgosDb::storeObsPartEOP(const SgMatrix* dV_dPx, const SgMatrix* dV_dPy, const SgMatrix* dV_dUT1)
2708 {
2710  SgNetCdf ncdf(path2RootDir_ + "/" +
2712  sessionCode_);
2713  //
2714  if (numOfObs_ != (int)dV_dPx->nRow())
2715  {
2717  "::storeObsPartEOP(): matrix dV_dPx size mismatch: " +
2718  QString("").sprintf("%d vs %d", numOfObs_, dV_dPx->nRow()));
2719  return false;
2720  };
2721  if (numOfObs_ != (int)dV_dPy->nRow())
2722  {
2724  "::storeObsPartEOP(): matrix dV_dPy size mismatch: " +
2725  QString("").sprintf("%d vs %d", numOfObs_, dV_dPy->nRow()));
2726  return false;
2727  };
2728  if (numOfObs_ != (int)dV_dUT1->nRow())
2729  {
2731  "::storeObsPartEOP(): matrix dV_dUT1 size mismatch: " +
2732  QString("").sprintf("%d vs %d", numOfObs_, dV_dUT1->nRow()));
2733  return false;
2734  };
2735  //
2736  if (!setupFormat(fcfPart_Erp, ncdf))
2737  {
2739  "::storeObsPartEOP(): format description failed");
2740  return false;
2741  };
2742  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2743  "Obs", "TimeUTC.nc");
2744  //
2745  double *pP=ncdf.lookupVar(fcPartWobble.name())->data2double();
2746  double *pU=ncdf.lookupVar(fcPartUt1.name())->data2double();
2747  for (int i=0; i<numOfObs_; i++)
2748  {
2749  pP[4*i ] = dV_dPx->getElement(i, 0);
2750  pP[4*i + 1] = dV_dPy->getElement(i, 0);
2751  pP[4*i + 2] = dV_dPx->getElement(i, 1);
2752  pP[4*i + 3] = dV_dPy->getElement(i, 1);
2753 
2754  pU[4*i ] = dV_dUT1->getElement(i, 0);
2755  pU[4*i + 1] = dV_dUT1->getElement(i, 1);
2756  pU[4*i + 2] = dV_dUT1->getElement(i, 2);
2757  pU[4*i + 3] = dV_dUT1->getElement(i, 3);
2758  };
2759  // write data:
2761  if (!ncdf.putData())
2762  {
2764  "::storeObsPartEOP(): cannot put data into " + ncdf.getFileName());
2765  return false;
2766  };
2769  "::storeObsPartEOP(): the data were successfully stored in " + ncdf.getFileName());
2770  return true;
2771 };
2772 
2773 
2774 
2775 //
2776 bool SgVgosDb::storeObsPartNut2KXY(const SgMatrix* dV_dCipX, const SgMatrix* dV_dCipY,
2777  const QString& kind)
2778 {
2780  //
2781  var.setKind(kind); // empty is ok too
2782  //
2783  SgNetCdf ncdf(path2RootDir_ + "/" +
2785  sessionCode_);
2786  //
2787  if (numOfObs_ != (int)dV_dCipX->nRow())
2788  {
2790  "::storeObsPartNut2KXY(): matrix dV_dCipX size mismatch: " +
2791  QString("").sprintf("%d vs %d", numOfObs_, dV_dCipX->nRow()));
2792  return false;
2793  };
2794  if (numOfObs_ != (int)dV_dCipY->nRow())
2795  {
2797  "::storeObsPartNut2KXY(): matrix dV_dCipY size mismatch: " +
2798  QString("").sprintf("%d vs %d", numOfObs_, dV_dCipY->nRow()));
2799  return false;
2800  };
2801  //
2802  if (!setupFormat(fcfPart_NutationNro, ncdf))
2803  {
2805  "::storeObsPartNut2KXY(): format description failed");
2806  return false;
2807  };
2808  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2809  "Obs", "TimeUTC.nc");
2810  //
2811  double *p=ncdf.lookupVar(fcPartNutationNro.name())->data2double();
2812  for (int i=0; i<numOfObs_; i++)
2813  {
2814  p[4*i ] = dV_dCipX->getElement(i, 0);
2815  p[4*i + 1] = dV_dCipY->getElement(i, 0);
2816  p[4*i + 2] = dV_dCipX->getElement(i, 1);
2817  p[4*i + 3] = dV_dCipY->getElement(i, 1);
2818  };
2819  // write data:
2821  if (!ncdf.putData())
2822  {
2824  "::storeObsPartNut2KXY(): cannot put data into " + ncdf.getFileName());
2825  return false;
2826  };
2829  "::storeObsPartNut2KXY(): the data were successfully stored in " + ncdf.getFileName());
2830  return true;
2831 };
2832 
2833 
2834 
2835 //
2836 bool SgVgosDb::storeObsPartRaDec(const SgMatrix* dV_dRA, const SgMatrix* dV_dDN)
2837 {
2839  SgNetCdf ncdf(path2RootDir_ + "/" +
2841  sessionCode_);
2842  //
2843  if (numOfObs_ != (int)dV_dRA->nRow())
2844  {
2846  "::storeObsPartRaDec(): matrix dV_dRA size mismatch: " +
2847  QString("").sprintf("%d vs %d", numOfObs_, dV_dRA->nRow()));
2848  return false;
2849  };
2850  if (numOfObs_ != (int)dV_dDN->nRow())
2851  {
2853  "::storeObsPartRaDec(): matrix dV_dDN size mismatch: " +
2854  QString("").sprintf("%d vs %d", numOfObs_, dV_dDN->nRow()));
2855  return false;
2856  };
2857  //
2858  if (!setupFormat(fcfPart_RaDec, ncdf))
2859  {
2861  "::storeObsPartRaDec(): format description failed");
2862  return false;
2863  };
2864  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2865  "Obs", "TimeUTC.nc");
2866  //
2867  double *p=ncdf.lookupVar(fcPartRaDec.name())->data2double();
2868  for (int i=0; i<numOfObs_; i++)
2869  {
2870  p[4*i ] = dV_dRA->getElement(i, 0);
2871  p[4*i + 1] = dV_dDN->getElement(i, 0);
2872  p[4*i + 2] = dV_dRA->getElement(i, 1);
2873  p[4*i + 3] = dV_dDN->getElement(i, 1);
2874  };
2875  // write data:
2877  if (!ncdf.putData())
2878  {
2880  "::storeObsPartRaDec(): cannot put data into " + ncdf.getFileName());
2881  return false;
2882  };
2885  "::storeObsPartRaDec(): the data were successfully stored in " + ncdf.getFileName());
2886  return true;
2887 };
2888 
2889 
2890 
2891 //dTau_dR_2 = -dTau_dR_1
2892 bool SgVgosDb::storeObsPartXYZ(const SgMatrix* dDel_dR_1, const SgMatrix* dRat_dR_1)
2893 {
2895  SgNetCdf ncdf(path2RootDir_ + "/" +
2897  sessionCode_);
2898  //
2899  if (numOfObs_ != (int)dDel_dR_1->nRow())
2900  {
2902  "::storeObsPartXYZ(): matrix dDel_dR_1 size mismatch: " +
2903  QString("").sprintf("%d vs %d", numOfObs_, dDel_dR_1->nRow()));
2904  return false;
2905  };
2906  if (numOfObs_ != (int)dRat_dR_1->nRow())
2907  {
2909  "::storeObsPartXYZ(): matrix dRat_dR_1 size mismatch: " +
2910  QString("").sprintf("%d vs %d", numOfObs_, dRat_dR_1->nRow()));
2911  return false;
2912  };
2913  //
2914  if (!setupFormat(fcfPart_Xyz, ncdf))
2915  {
2917  "::storeObsPartXYZ(): format description failed");
2918  return false;
2919  };
2920  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2921  "Obs", "TimeUTC.nc");
2922  //
2923  double *p=ncdf.lookupVar(fcPartXyz.name())->data2double();
2924  for (int i=0; i<numOfObs_; i++)
2925  {
2926  p[6*i ] = dDel_dR_1->getElement(i, 0);
2927  p[6*i + 1] = dDel_dR_1->getElement(i, 1);
2928  p[6*i + 2] = dDel_dR_1->getElement(i, 2);
2929  p[6*i + 3] = dRat_dR_1->getElement(i, 0);
2930  p[6*i + 4] = dRat_dR_1->getElement(i, 1);
2931  p[6*i + 5] = dRat_dR_1->getElement(i, 2);
2932  };
2933  // write data:
2935  if (!ncdf.putData())
2936  {
2938  "::storeObsPartXYZ(): cannot put data into " + ncdf.getFileName());
2939  return false;
2940  };
2943  "::storeObsPartXYZ(): the data were successfully stored in " + ncdf.getFileName());
2944  return true;
2945 };
2946 
2947 
2948 
2949 //
2951 {
2953  SgNetCdf ncdf(path2RootDir_ + "/" +
2955  sessionCode_);
2956  //
2957  if (numOfObs_ != (int)part->nRow())
2958  {
2960  "::storeObsPartGamma(): matrix part size mismatch: " +
2961  QString("").sprintf("%d vs %d", numOfObs_, part->nRow()));
2962  return false;
2963  };
2964  //
2965  if (!setupFormat(fcfPart_Gamma, ncdf))
2966  {
2968  "::storeObsPartGamma(): format description failed");
2969  return false;
2970  };
2971  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
2972  "Obs", "TimeUTC.nc");
2973  //
2974  double *p=ncdf.lookupVar(fcPartGamma.name())->data2double();
2975  for (int i=0; i<numOfObs_; i++)
2976  {
2977  p[2*i ] = part->getElement(i, 0);
2978  p[2*i + 1] = part->getElement(i, 1);
2979  };
2980  // write data:
2982  if (!ncdf.putData())
2983  {
2985  "::storeObsPartGamma(): cannot put data into " + ncdf.getFileName());
2986  return false;
2987  };
2990  "::storeObsPartGamma(): the data were successfully stored in " + ncdf.getFileName());
2991  return true;
2992 };
2993 
2994 
2995 
2996 //
2998 {
3000  SgNetCdf ncdf(path2RootDir_ + "/" +
3002  sessionCode_);
3003  //
3004  if (numOfObs_ != (int)part->nRow())
3005  {
3007  "::storeObsPartParallax(): matrix part size mismatch: " +
3008  QString("").sprintf("%d vs %d", numOfObs_, part->nRow()));
3009  return false;
3010  };
3011  //
3012  if (!setupFormat(fcfPart_Parallax, ncdf))
3013  {
3015  "::storeObsPartParallax(): format description failed");
3016  return false;
3017  };
3018  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
3019  "Obs", "TimeUTC.nc");
3020  //
3021  double *p=ncdf.lookupVar(fcPartParallax.name())->data2double();
3022  for (int i=0; i<numOfObs_; i++)
3023  {
3024  p[2*i ] = part->getElement(i, 0);
3025  p[2*i + 1] = part->getElement(i, 1);
3026  };
3027  // write data:
3029  if (!ncdf.putData())
3030  {
3032  "::storeObsPartParallax(): cannot put data into " + ncdf.getFileName());
3033  return false;
3034  };
3037  "::storeObsPartParallax(): the data were successfully stored in " + ncdf.getFileName());
3038  return true;
3039 };
3040 
3041 
3042 
3043 //
3044 bool SgVgosDb::storeObsPartPoleTides(const SgMatrix* dV_dPtdX, const SgMatrix* dV_dPtdY,
3045  const QString& kind)
3046 {
3048  //
3049  var.setKind(kind); // empty is ok too
3050  //
3051  SgNetCdf ncdf(path2RootDir_ + "/" +
3053  sessionCode_);
3054  //
3055  if (numOfObs_ != (int)dV_dPtdX->nRow())
3056  {
3058  "::storeObsPartPoleTides(): matrix dV_dPtdX size mismatch: " +
3059  QString("").sprintf("%d vs %d", numOfObs_, dV_dPtdX->nRow()));
3060  return false;
3061  };
3062  if (numOfObs_ != (int)dV_dPtdY->nRow())
3063  {
3065  "::storeObsPartPoleTides(): matrix dV_dPtdY size mismatch: " +
3066  QString("").sprintf("%d vs %d", numOfObs_, dV_dPtdY->nRow()));
3067  return false;
3068  };
3069  //
3070  if (!setupFormat(fcfPart_PolarTide, ncdf))
3071  {
3073  "::storeObsPartPoleTides(): format description failed");
3074  return false;
3075  };
3076  ncdf.setServiceVars(var.getStub(), "Data are provided by CALC or similar software",
3077  "Obs", "TimeUTC.nc");
3078  //
3079  double *p=ncdf.lookupVar(fcPartPolarTide.name())->data2double();
3080  for (int i=0; i<numOfObs_; i++)
3081  {
3082  p[4*i ] = dV_dPtdX->getElement(i, 0);
3083  p[4*i + 1] = dV_dPtdY->getElement(i, 0);
3084  p[4*i + 2] = dV_dPtdX->getElement(i, 1);
3085  p[4*i + 3] = dV_dPtdY->getElement(i, 1);
3086  };
3087  // write data:
3089  if (!ncdf.putData())
3090  {
3092  "::storeObsPartPoleTides(): cannot put data into " + ncdf.getFileName());
3093  return false;
3094  };
3097  "::storeObsPartPoleTides(): the data were successfully stored in " + ncdf.getFileName());
3098  return true;
3099 };
3100 
3101 
3102 
3103 
3104 
3105 
3106 /*=====================================================================================================*/
3107 
@ SD_NumObs
Definition: SgIoDriver.h:53
@ SD_Any
Definition: SgIoDriver.h:62
SgLogger * logger
Definition: SgLogger.cpp:231
QList< SgVgosDb::FmtChkVar * > fcfEdit_v1002
Definition: SgVgosDb.cpp:2666
SgVgosDb::FmtChkVar fcPhaseFlag("PhaseFlag", NC_SHORT, false, QList< int >()<< SD_NumObs, "PHSUFLAG", "")
QList< SgVgosDb::FmtChkVar * > fcfNumGroupAmbig
Definition: SgVgosDb.cpp:2669
QList< SgVgosDb::FmtChkVar * > fcfCalSlantPathIonoGroup
Definition: SgVgosDb.cpp:2657
QList< SgVgosDb::FmtChkVar * > fcfIonoBits
Definition: SgVgosDb.cpp:2659
SgVgosDb::FmtChkVar fcSecond("Second", NC_DOUBLE, true, QList< int >()<< SD_Any, "SEC TAG ", "Seconds part of UTC TAG.........", "second")
SgVgosDb::FmtChkVar fcYmdhm("YMDHM", NC_SHORT, true, QList< int >()<< SD_Any<< 5, "UTC TAG ", "Epoch UTC YMDHM.................")
QList< SgVgosDb::FmtChkVar * > fcfNumPhaseAmbig
Definition: SgVgosDb.cpp:2671
QList< SgVgosDb::FmtChkVar * > fcfNumGroupAmbigE
Definition: SgVgosDb.cpp:2670
SgVgosDb::FmtChkVar fcRateFlag("RateFlag", NC_SHORT, true, QList< int >()<< SD_NumObs, "RATUFLAG", "Delay rate unweight flag........")
SgVgosDb::FmtChkVar fcNumGroupAmbig("NumGroupAmbig", NC_SHORT, true, QList< int >()<< SD_NumObs, "# AMBIG ", "Number of group delay ambiguities", "", "?")
SgVgosDb::FmtChkVar fcCalIonoGroupSigma("Cal-SlantPathIonoGroupSigma", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "IONRMS ", "Ion correction to sigma. sec", "second", "?")
QList< SgVgosDb::FmtChkVar * > fcfTimeUTC
Definition: SgVgosDb.cpp:2655
QList< SgVgosDb::FmtChkVar * > fcfUserSup
Definition: SgVgosDb.cpp:2667
SgVgosDb::FmtChkVar fcNumPhaseAmbig("NumPhaseAmbig", NC_INT, true, QList< int >()<< SD_NumObs, "#PAMBIG ", "Number of phase delay ambiguities", "", "?")
SgVgosDb::FmtChkVar fcIonoBits("IonoBits", NC_SHORT, true, QList< int >()<< SD_NumObs, "ION_BITS", "ICORR for full ion tracking.")
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")
QList< SgVgosDb::FmtChkVar * > fcfGroupRate
Definition: SgVgosDb.h:2029
SgVgosDb::FmtChkVar fcAPCLOFST
Definition: SgVgosDb.h:1974
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoMk3
Definition: SgVgosDb.h:2040
QList< SgVgosDb::FmtChkVar * > fcfCalHiFreqLibration
Definition: SgVgosDb.h:2052
SgVgosDb::FmtChkVar fcDELRESID
Definition: SgVgosDb.h:1970
SgVgosDb::FmtChkVar fcPartBend
Definition: SgVgosDb.h:1961
SgVgosDb::FmtChkVar fcPolarization
Definition: SgVgosDb.h:1972
SgVgosDb::FmtChkVar fcPartXyz
Definition: SgVgosDb.h:1962
SgVgosDb::FmtChkVar fcObs2Scan
Definition: SgVgosDb.h:1943
SgVgosDb::FmtChkVar fcStation2Scan
Definition: SgVgosDb.h:1946
SgVgosDb::FmtChkVar fcSampleRate
Definition: SgVgosDb.h:1953
SgVgosDb::FmtChkVar fcBITSAMPL
Definition: SgVgosDb.h:1966
SgVgosDb::FmtChkVar fcVLB1FILE
Definition: SgVgosDb.h:1974
SgVgosDb::FmtChkVar fcCalFeedCorrection
Definition: SgVgosDb.h:1957
SgVgosDb::FmtChkVar fcABASDEL
Definition: SgVgosDb.h:1970
SgVgosDb::FmtChkVar fcFRQGROUP
Definition: SgVgosDb.h:1965
SgVgosDb::FmtChkVar fcScan2Source
Definition: SgVgosDb.h:1944
QList< SgVgosDb::FmtChkVar * > fcfCalFeedCorrection
Definition: SgVgosDb.h:2050
SgVgosDb::FmtChkVar fcFractC
Definition: SgVgosDb.h:1942
QList< SgVgosDb::FmtChkVar * > fcfObsCrossRef
Definition: SgVgosDb.h:2028
QList< SgVgosDb::FmtChkVar * > fcfPart_Parallax
Definition: SgVgosDb.h:2054
SgVgosDb::FmtChkVar fcUTCCorr
Definition: SgVgosDb.h:1971
SgVgosDb::FmtChkVar fcPhaseCalRate
Definition: SgVgosDb.h:1954
SgVgosDb::FmtChkVar fcFreqPhaseIonEqWgts
Definition: SgVgosDb.h:1950
QList< SgVgosDb::FmtChkVar * > fcfPart_Erp
Definition: SgVgosDb.h:2053
QList< SgVgosDb::FmtChkVar * > fcfCalOceanLoadOld
Definition: SgVgosDb.h:2050
QList< SgVgosDb::FmtChkVar * > fcfBaseline
SgVgosDb::FmtChkVar fcChannelID
Definition: SgVgosDb.h:1972
SgVgosDb::FmtChkVar fcScan2Station
Definition: SgVgosDb.h:1946
SgVgosDb::FmtChkVar fcFreqGroupIonEqWgts
Definition: SgVgosDb.h:1950
SgVgosDb::FmtChkVar fcUTCScan
Definition: SgVgosDb.h:1971
SgVgosDb::FmtChkVar fcFreqGroupIon
Definition: SgVgosDb.h:1949
SgVgosDb::FmtChkVar fcQBFACTOR
Definition: SgVgosDb.h:1969
SgVgosDb::FmtChkVar fcHopsRevNum
Definition: SgVgosDb.h:1968
SgVgosDb::FmtChkVar fcGroupRateSig
Definition: SgVgosDb.h:1947
SgVgosDb::FmtChkVar fcGeocRate
Definition: SgVgosDb.h:1969
QList< SgVgosDb::FmtChkVar * > fcfSNR
Definition: SgVgosDb.h:2031
SgVgosDb::FmtChkVar fcURVR
Definition: SgVgosDb.h:1967
SgVgosDb::FmtChkVar fcDBEDITVE
Definition: SgVgosDb.h:1967
QList< SgVgosDb::FmtChkVar * > fcfUVFperAsec
Definition: SgVgosDb.h:2031
SgVgosDb::FmtChkVar fcFOURFVER
Definition: SgVgosDb.h:1966
QList< SgVgosDb::FmtChkVar * > fcfAmbigSize
Definition: SgVgosDb.h:2031
SgVgosDb::FmtChkVar fcGroupDelayFull
Definition: SgVgosDb.h:1948
SgVgosDb::FmtChkVar fcDELTAEPO
Definition: SgVgosDb.h:1967
QList< SgVgosDb::FmtChkVar * > fcfPart_RaDec
Definition: SgVgosDb.h:2054
SgVgosDb::FmtChkVar fcPhaseCalFreq
Definition: SgVgosDb.h:1954
QList< SgVgosDb::FmtChkVar * > fcfFractC
Definition: SgVgosDb.h:2026
SgVgosDb::FmtChkVar fcPhase
Definition: SgVgosDb.h:1948
SgVgosDb::FmtChkVar fcTOTPCENT
Definition: SgVgosDb.h:1975
SgVgosDb::FmtChkVar fcPartRaDec
Definition: SgVgosDb.h:1962
QList< SgVgosDb::FmtChkVar * > fcfPart_Gamma
Definition: SgVgosDb.h:2053
SgVgosDb::FmtChkVar fcPartPolarTide
Definition: SgVgosDb.h:1963
SgVgosDb::FmtChkVar fcSTARELEV
Definition: SgVgosDb.h:1967
QList< SgVgosDb::FmtChkVar * > fcfCalParallax
Definition: SgVgosDb.h:2053
SgVgosDb::FmtChkVar fcBaseline
SgVgosDb::FmtChkVar fcDLYEPOp1
Definition: SgVgosDb.h:1974
SgVgosDb::FmtChkVar fcIDELAY
Definition: SgVgosDb.h:1967
SgVgosDb::FmtChkVar fcUTCMidObs
Definition: SgVgosDb.h:1971
SgVgosDb::FmtChkVar fcSBDelaySig
Definition: SgVgosDb.h:1947
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoKomb
Definition: SgVgosDb.h:2048
SgVgosDb::FmtChkVar fcSNR
Definition: SgVgosDb.h:1952
SgVgosDb::FmtChkVar fcPartWobble
Definition: SgVgosDb.h:1962
SgVgosDb::FmtChkVar fcPartGamma
Definition: SgVgosDb.h:1962
SgVgosDb::FmtChkVar fcPhaseDelayFull
Definition: SgVgosDb.h:1948
SgVgosDb::FmtChkVar fcPhaseCalOffset
Definition: SgVgosDb.h:1954
SgVgosDb::FmtChkVar fcNumAp
Definition: SgVgosDb.h:1953
SgVgosDb::FmtChkVar fcERRORATE
Definition: SgVgosDb.h:1972
QList< SgVgosDb::FmtChkVar * > fcfCalBendSun
Definition: SgVgosDb.h:2052
SgVgosDb::FmtChkVar fcUVFperAsec
Definition: SgVgosDb.h:1952
SgVgosDb::FmtChkVar fcRefFreq
Definition: SgVgosDb.h:1948
SgVgosDb::FmtChkVar fcAmbigSize
Definition: SgVgosDb.h:1951
QList< SgVgosDb::FmtChkVar * > fcfRateTheoretical
Definition: SgVgosDb.h:2032
SgVgosDb::FmtChkVar fcCORCLOCK
Definition: SgVgosDb.h:1971
SgVgosDb::FmtChkVar fcNumScansPerStation
Definition: SgVgosDb.h:1946
SgVgosDb::FmtChkVar fcGeocSBD
Definition: SgVgosDb.h:1969
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfoMk4
Definition: SgVgosDb.h:2041
SgVgosDb::FmtChkVar fcSRCHPAR
Definition: SgVgosDb.h:1967
SgVgosDb::FmtChkVar fcCORELVER
Definition: SgVgosDb.h:1965
QList< SgVgosDb::FmtChkVar * > fcfCalBendSunHigher
Definition: SgVgosDb.h:2053
SgVgosDb::FmtChkVar fcPartUt1
Definition: SgVgosDb.h:1962
SgVgosDb::FmtChkVar fcStopOffset
Definition: SgVgosDb.h:1968
SgVgosDb::FmtChkVar fcCalUnPhase
Definition: SgVgosDb.h:1959
QList< SgVgosDb::FmtChkVar * > fcfCalOceanLoad
Definition: SgVgosDb.h:2050
SgVgosDb::FmtChkVar fcSBDelay
Definition: SgVgosDb.h:1947
SgVgosDb::FmtChkVar fcZDELAY
Definition: SgVgosDb.h:1967
QList< SgVgosDb::FmtChkVar * > fcfGroupDelay
Definition: SgVgosDb.h:2029
SgVgosDb::FmtChkVar fcINCOHAMP
Definition: SgVgosDb.h:1970
QList< SgVgosDb::FmtChkVar * > fcfRefFreq
Definition: SgVgosDb.h:2030
SgVgosDb::FmtChkVar fcRATRESID
Definition: SgVgosDb.h:1968
SgVgosDb::FmtChkVar fcFRNGERR
SgVgosDb::FmtChkVar fcStartOffset
Definition: SgVgosDb.h:1965
SgVgosDb::FmtChkVar fcFRNGERR4S2
Definition: SgVgosDb.h:1965
QList< SgVgosDb::FmtChkVar * > fcfCalBend
Definition: SgVgosDb.h:2052
QList< SgVgosDb::FmtChkVar * > fcfPhase
Definition: SgVgosDb.h:2029
QList< SgVgosDb::FmtChkVar * > fcfCalHiFyErp
Definition: SgVgosDb.h:2050
SgVgosDb::FmtChkVar fcBBCIndex
Definition: SgVgosDb.h:1972
QList< SgVgosDb::FmtChkVar * > fcfCorrInfoMk4
Definition: SgVgosDb.h:2048
SgVgosDb::FmtChkVar fcProbFalseDetection
Definition: SgVgosDb.h:1969
SgVgosDb::FmtChkVar fcObs2Baseline
Definition: SgVgosDb.h:1943
SgVgosDb::FmtChkVar fcCorrelation
Definition: SgVgosDb.h:1951
QList< SgVgosDb::FmtChkVar * > fcfPart_PolarTide
Definition: SgVgosDb.h:2054
SgVgosDb::FmtChkVar fcPhaseCalAmp
Definition: SgVgosDb.h:1954
SgVgosDb::FmtChkVar fcEffectiveDuration
Definition: SgVgosDb.h:1968
SgVgosDb::FmtChkVar fcPartNutationNro
Definition: SgVgosDb.h:1962
SgVgosDb::FmtChkVar fcFreqRateIonEqWgts
Definition: SgVgosDb.h:1950
SgVgosDb::FmtChkVar fcDelayTheoretical
Definition: SgVgosDb.h:1952
QList< SgVgosDb::FmtChkVar * > fcfPhaseDelayFull
Definition: SgVgosDb.h:2030
SgVgosDb::FmtChkVar fcDISCARD
Definition: SgVgosDb.h:1969
SgVgosDb::FmtChkVar fcNumChannels
Definition: SgVgosDb.h:1953
SgVgosDb::FmtChkVar fcGroupDelay
Definition: SgVgosDb.h:1947
SgVgosDb::FmtChkVar fcStopSec
Definition: SgVgosDb.h:1970
SgVgosDb::FmtChkVar fcNumSamples
Definition: SgVgosDb.h:1956
SgVgosDb::FmtChkVar fcTAPEID
Definition: SgVgosDb.h:1971
SgVgosDb::FmtChkVar fcChanAmpPhase
Definition: SgVgosDb.h:1956
SgVgosDb::FmtChkVar fcGroupDelaySig
Definition: SgVgosDb.h:1947
SgVgosDb::FmtChkVar fcDELOBSVM
Definition: SgVgosDb.h:1975
SgVgosDb::FmtChkVar fcDLYEPOm1
Definition: SgVgosDb.h:1974
SgVgosDb::FmtChkVar fcSource
Definition: SgVgosDb.h:1943
SgVgosDb::FmtChkVar fcCrossRefSourceList
Definition: SgVgosDb.h:1943
SgVgosDb::FmtChkVar fcABASRATE
Definition: SgVgosDb.h:1970
SgVgosDb::FmtChkVar fcPhaseCalPhase
Definition: SgVgosDb.h:1954
QList< SgVgosDb::FmtChkVar * > fcfQualityCode
Definition: SgVgosDb.h:2031
SgVgosDb::FmtChkVar fcChannelFreq
Definition: SgVgosDb.h:1956
QList< SgVgosDb::FmtChkVar * > fcfGroupDelayFull
Definition: SgVgosDb.h:2029
SgVgosDb::FmtChkVar fcDataFlag
Definition: SgVgosDb.h:1952
QList< SgVgosDb::FmtChkVar * > fcfCalPoleTide
Definition: SgVgosDb.h:2051
SgVgosDb::FmtChkVar fcGeocPhase
Definition: SgVgosDb.h:1970
QList< SgVgosDb::FmtChkVar * > fcfSBDelay
Definition: SgVgosDb.h:2029
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoMk4
Definition: SgVgosDb.h:2038
SgVgosDb::FmtChkVar fcGroupRate
Definition: SgVgosDb.h:1947
QList< SgVgosDb::FmtChkVar * > fcfCalTiltRemover
Definition: SgVgosDb.h:2051
SgVgosDb::FmtChkVar fcRECSETUP
SgVgosDb::FmtChkVar fcINDEXNUM
Definition: SgVgosDb.h:1972
QList< SgVgosDb::FmtChkVar * > fcfEffFreq
Definition: SgVgosDb.h:2030
SgVgosDb::FmtChkVar fcDLYEPOCH
Definition: SgVgosDb.h:1974
SgVgosDb::FmtChkVar fcFreqRateIon
Definition: SgVgosDb.h:1949
QList< SgVgosDb::FmtChkVar * > fcfDelayTheoretical
Definition: SgVgosDb.h:2032
QList< SgVgosDb::FmtChkVar * > fcfStationCrossRef
Definition: SgVgosDb.h:2029
SgVgosDb::FmtChkVar fcFreqPhaseIon
Definition: SgVgosDb.h:1949
SgVgosDb::FmtChkVar fcGeocMBD
Definition: SgVgosDb.h:1969
QList< SgVgosDb::FmtChkVar * > fcfPhaseCalInfo
Definition: SgVgosDb.h:2043
QList< SgVgosDb::FmtChkVar * > fcfChannelInfoKomb
Definition: SgVgosDb.h:2038
SgVgosDb::FmtChkVar fcGeocResidPhase
Definition: SgVgosDb.h:1969
SgVgosDb::FmtChkVar fcFOURFUTC
Definition: SgVgosDb.h:1971
SgVgosDb::FmtChkVar fcCrossRefStationList
Definition: SgVgosDb.h:1946
SgVgosDb::FmtChkVar fcDtecStdErr
Definition: SgVgosDb.h:1949
SgVgosDb::FmtChkVar fcLOFreq
Definition: SgVgosDb.h:1973
SgVgosDb::FmtChkVar fcABASACCE
Definition: SgVgosDb.h:1970
QList< SgVgosDb::FmtChkVar * > fcfPart_NutationNro
Definition: SgVgosDb.h:2053
SgVgosDb::FmtChkVar fcTapeCode
Definition: SgVgosDb.h:1968
QList< SgVgosDb::FmtChkVar * > fcfCalEarthTide
Definition: SgVgosDb.h:2050
SgVgosDb::FmtChkVar fcPartParallax
Definition: SgVgosDb.h:1962
SgVgosDb::FmtChkVar fcUTCVLB2
Definition: SgVgosDb.h:1975
QList< SgVgosDb::FmtChkVar * > fcfCalOceanPoleTideLoad
Definition: SgVgosDb.h:2051
SgVgosDb::FmtChkVar fcINCOH2
Definition: SgVgosDb.h:1970
QList< SgVgosDb::FmtChkVar * > fcfSource
Definition: SgVgosDb.h:2028
QList< SgVgosDb::FmtChkVar * > fcfCalUnphase
Definition: SgVgosDb.h:2051
SgVgosDb::FmtChkVar fcFOURFFIL
Definition: SgVgosDb.h:1953
QList< SgVgosDb::FmtChkVar * > fcfSourceCrossRef
Definition: SgVgosDb.h:2028
SgVgosDb::FmtChkVar fcPhaseSig
Definition: SgVgosDb.h:1948
QList< SgVgosDb::FmtChkVar * > fcfPart_Bend
Definition: SgVgosDb.h:2053
SgVgosDb::FmtChkVar fcRateTheoretical
Definition: SgVgosDb.h:1952
QList< SgVgosDb::FmtChkVar * > fcfCalPoleTideOldRestore
Definition: SgVgosDb.h:2051
QList< SgVgosDb::FmtChkVar * > fcfDataFlag
Definition: SgVgosDb.h:2031
SgVgosDb::FmtChkVar fcStartSec
Definition: SgVgosDb.h:1968
QList< SgVgosDb::FmtChkVar * > fcfDTec
Definition: SgVgosDb.h:2030
SgVgosDb::FmtChkVar fcDtec
Definition: SgVgosDb.h:1948
QList< SgVgosDb::FmtChkVar * > fcfEffFreqEqWgts
Definition: SgVgosDb.h:2030
SgVgosDb::FmtChkVar fcPhaseDelaySigFull
Definition: SgVgosDb.h:1948
QList< SgVgosDb::FmtChkVar * > fcfCorrelation
Definition: SgVgosDb.h:2031
SgVgosDb::FmtChkVar fcCORBASCD
Definition: SgVgosDb.h:1967
SgVgosDb::FmtChkVar fcSBRESID
Definition: SgVgosDb.h:1968
SgVgosDb::FmtChkVar fcQualityCode
Definition: SgVgosDb.h:1951
SgVgosDb::FmtChkVar fcRATOBSVM
Definition: SgVgosDb.h:1975
QList< SgVgosDb::FmtChkVar * > fcfCalWobble
Definition: SgVgosDb.h:2052
QList< SgVgosDb::FmtChkVar * > fcfPart_Xyz
Definition: SgVgosDb.h:2054
const SgIdentities * currentIdentities_
Definition: SgIoDriver.h:133
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_NCDF
Definition: SgLogger.h:66
unsigned int nRow() const
Definition: SgMatrix.h:352
double getElement(unsigned int i, unsigned int j) const
Definition: SgMatrix.h:385
unsigned int nCol() const
Definition: SgMatrix.h:360
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 double * data2double() const
Definition: SgNetCdf.cpp:525
SgNcdfVariable * lookupVar(const QString &name) const
Definition: SgNetCdf.h:395
void setServiceVars(const QString &stub, const QString &dataOrigin, const QString &timeTag, const QString &timeTagFile)
Definition: SgNetCdf.cpp:1263
bool putData()
Definition: SgNetCdf.cpp:1357
const QString & getFileName() const
Definition: SgNetCdf.h:497
@ OM_REGULAR
Definition: SgNetCdf.h:324
void setOperationMode(OperationMode om)
Definition: SgNetCdf.h:381
QString name4export(const QString &rootDir, SgNetCdf::OperationMode om, const QString &aBand="")
Definition: SgVgosDb.cpp:167
void setKind(const QString &str)
Definition: SgVgosDb.h:104
const QString & getStub() const
Definition: SgVgosDb.h:93
void setStub(const QString &str)
Definition: SgVgosDb.h:103
unsigned int n() const
Definition: SgVector.h:327
double getElement(unsigned int i) const
Definition: SgVector.h:362
const QList< int > & dims() const
Definition: SgVgosDb.h:217
const QString & name() const
Definition: SgVgosDb.h:213
void alternateDimension(int i, int num)
Definition: SgVgosDb.h:222
bool storeObsCalOcean(const SgMatrix *)
SgVdbVariable vDiffTec_
Definition: SgVgosDb.h:1473
SgVdbVariable vCal_EarthTide_
Definition: SgVgosDb.h:1478
SgVdbVariable vSourceCrossRef_
Definition: SgVgosDb.h:1438
bool storeEpochs4Obs(const QList< SgMJD > &)
bool storeObsGroupDelaysFull(const QString &band, const SgVector *groupDelays)
bool storeObsObjectNames(const QList< QString > &stations_1, const QList< QString > &stations_2, const QList< QString > &sources)
bool storeObsCalPoleTideOldRestore(const SgMatrix *cals)
bool storeObsCrossRefs(const QList< int > &obs2scan, const QList< int > &obs2stn_1, const QList< int > &obs2stn_2)
bool storeObsEffFreqs(const QString &band, const SgMatrix *freqs, bool areEqWgts=false)
static const QString className()
Definition: SgVgosDb.cpp:251
SgVdbVariable vCal_Wobble_
Definition: SgVgosDb.h:1488
SgVdbVariable vPart_Erp_
Definition: SgVgosDb.h:1509
bool setupFormat(const QList< FmtChkVar * > &, SgNetCdf &, const QString &stationKey=QString(""), const QString &bandKey=QString(""))
Definition: SgVgosDb.cpp:2336
bool storeObsQualityCodes(const QString &band, const QVector< char > &qualityCodes)
bool storeObsSingleBandDelays(const QString &band, const SgMatrix *singleBandDelays)
bool storeSourceCrossRefs(const QList< QString > &sources, const QList< int > &scan2src)
bool storeObsPartRaDec(const SgMatrix *dV_dRA, const SgMatrix *dV_dDN)
bool storeObsPartParallax(const SgMatrix *part)
bool storeObsGroupDelays(const QString &band, const SgMatrix *groupDelays, const QString &kind)
bool storeObsRefFreqs(const QString &band, const SgVector *rf)
SgVdbVariable vPart_NutationNro_
Definition: SgVgosDb.h:1511
bool storeObsCalBendSun(const SgMatrix *cals)
SgVdbVariable vSource_
Definition: SgVgosDb.h:1467
SgVdbVariable vBaseline_
Definition: SgVgosDb.h:1466
@ CT_VLBA
Definition: SgVgosDb.h:190
@ CT_Difx
Definition: SgVgosDb.h:196
@ CT_Mk4
Definition: SgVgosDb.h:194
bool storeObsCalPoleTide(const SgMatrix *, const QString &kind)
SgVdbVariable vCal_PoleTideOldRestore_
Definition: SgVgosDb.h:1486
SgNetCdf::OperationMode operationMode_
Definition: SgVgosDb.h:1530
SgVdbVariable vCal_BendSun_
Definition: SgVgosDb.h:1476
SgVdbVariable vPart_Parallax_
Definition: SgVgosDb.h:1512
bool storeObsCalBendSunHigher(const SgMatrix *cals)
bool storeObsPhaseCalInfo(const QString &band, SgVlbiSessionInfo::OriginType originType, const SgMatrix *phCalFrqs_1ByChan, const SgMatrix *phCalAmps_1ByChan, const SgMatrix *phCalPhss_1ByChan, const SgMatrix *phCalOffs_1ByChan, const SgVector *phCalRates_1, const SgMatrix *phCalFrqs_2ByChan, const SgMatrix *phCalAmps_2ByChan, const SgMatrix *phCalPhss_2ByChan, const SgMatrix *phCalOffs_2ByChan, const SgVector *phCalRates_2)
bool storeObsCalUnphase(const QString &band, const SgMatrix *phaseCal_1, const SgMatrix *phaseCal_2)
bool storeObsStd1Contribution(const QString &varName, const SgMatrix *contrib, SgVdbVariable &var, const QList< SgVgosDb::FmtChkVar * > &fcf)
CorrelatorType correlatorType_
Definition: SgVgosDb.h:1391
bool storeObsCalEarthTide(const SgMatrix *, const QString &kind)
SgVdbVariable vPart_PoleTide_
Definition: SgVgosDb.h:1513
SgVdbVariable vCal_BendSunHigher_
Definition: SgVgosDb.h:1477
bool storeObsStd2Contribution(const QString &varName, const QList< const SgMatrix * > &contribs, SgVdbVariable &var, const QList< SgVgosDb::FmtChkVar * > &fcf)
bool storeObsCorrelation(const QString &band, const SgVector *correlations)
bool storeObsCalIonGroup(const QString &band, const SgMatrix *ionCals, const SgMatrix *ionSigmas, const QVector< int > &ionDataFlag)
bool storeObsCalParallax(const SgMatrix *cals)
SgVdbVariable vPart_Xyz_
Definition: SgVgosDb.h:1516
bool storeObsCalWobble(const SgMatrix *, const SgMatrix *)
bool storeObsNumGroupAmbigs(const QString &band, const QVector< int > &numAmbigs, const QVector< int > &numSubAmbigs)
int numOfChan_
Definition: SgVgosDb.h:1387
bool storeObsSNR(const QString &band, const SgVector *snrs)
int numOfStn_
Definition: SgVgosDb.h:1388
bool storeObsUVFperAsec(const QString &band, const SgMatrix *uvfPerAsec)
SgVdbVariable vCal_HiFreqLibration_
Definition: SgVgosDb.h:1490
SgVdbVariable vObsCrossRef_
Definition: SgVgosDb.h:1497
bool storeObsCalBend(const SgMatrix *cals)
SgVdbVariable vEdit_
Definition: SgVgosDb.h:1493
bool storeObsPartBend(const SgMatrix *partBend)
SgVdbVariable vCal_OceanLoad_
Definition: SgVgosDb.h:1481
SgVdbVariable vPart_Bend_
Definition: SgVgosDb.h:1507
SgVdbVariable vStationCrossRef_
Definition: SgVgosDb.h:1437
SgVdbVariable vCal_HfErp_
Definition: SgVgosDb.h:1480
SgVdbVariable vCal_PoleTide_
Definition: SgVgosDb.h:1485
bool storeObsAmbigSpacing(const QString &band, const SgVector *ambigs)
bool storeObsRates(const QString &band, const SgMatrix *rates, const QString &kind)
bool storeObsCalHiFyErp(const SgMatrix *, const SgMatrix *, const QString &kind)
SgVdbVariable vCal_OceanPoleTideLoad_
Definition: SgVgosDb.h:1483
QString sessionCode_
Definition: SgVgosDb.h:1416
QMap< QString, BandData > bandDataByName_
Definition: SgVgosDb.h:1470
SgVdbVariable vCal_Bend_
Definition: SgVgosDb.h:1475
SgVdbVariable vCal_FeedCorrection_
Definition: SgVgosDb.h:1479
bool storeObsPartXYZ(const SgMatrix *dDel_dR_1, const SgMatrix *dRat_dR_1)
bool storeIonoBits(const QVector< int > &ionoBits)
bool storeObsCalHiFyLibration(const SgMatrix *, const SgMatrix *, const QString &kind)
QString outputFormatId_
Definition: SgVgosDb.h:1402
SgVdbVariable vPart_Gamma_
Definition: SgVgosDb.h:1508
bool storeObsDelayTheoretical(const SgVector *v)
bool storeObsDtec(const SgVector *dTec, const SgVector *dTecStdDev)
bool storeObsCalOceanOld(const SgMatrix *)
ProgramSolveDescriptor progSolveDescriptor_
Definition: SgVgosDb.h:1524
bool storeObsEditData(const QVector< int > &delUFlag, const QVector< int > &phsUFlag, const QVector< int > &ratUFlag, const QVector< int > &uAcSup)
SgVdbVariable vRateTheoretical_
Definition: SgVgosDb.h:1504
int numOfObs_
Definition: SgVgosDb.h:1385
bool storeObsPhaseDelaysFull(const QString &band, const SgVector *groupDelays, const SgVector *phaseDelaySigs)
SgVdbVariable vCal_OceanLoadOld_
Definition: SgVgosDb.h:1482
int numOfSrc_
Definition: SgVgosDb.h:1389
bool storeObsRateTheoretical(const SgVector *v)
QString path2RootDir_
Definition: SgVgosDb.h:1394
SgVdbVariable vObservationTimeUTC_
Definition: SgVgosDb.h:1465
bool storeObsCalOceanPoleTideLoad(const SgMatrix *)
int numOfScans_
Definition: SgVgosDb.h:1386
bool storeObsPartNut2KXY(const SgMatrix *dV_dCipX, const SgMatrix *dV_dCipY, const QString &kind)
bool storeObsCorrelatorInfo(const QString &band, SgVlbiSessionInfo::OriginType originType, const QVector< QString > &fourfitOutputFName, const QVector< QString > &fourfitErrorCodes, const QVector< QString > &frqGrpCodes, const QVector< int > &corelVersions, const QVector< int > &startOffsets, const QVector< QVector< int > > &fourfitVersions, const QVector< QVector< int > > &dbeditVersion, const SgVector *deltaEpochs, const SgMatrix *urvrs, const SgMatrix *instrDelays, const SgMatrix *starElev, const SgMatrix *zenithDelays, const SgMatrix *searchParams, const QVector< QString > &baselineCodes, const QVector< QString > &tapeQualityCodes, const QVector< int > &stopOffsets, const QVector< int > &hopsRevisionNumbers, const SgVector *sampleRate, const SgVector *sbdResids, const SgVector *rateResids, const SgVector *effDurations, const SgVector *startSeconds, const SgVector *stopSeconds, const SgVector *percentOfDiscards, const SgVector *uniformityFactors, const SgVector *geocenterPhaseResids, const SgVector *geocenterPhaseTotals, const SgVector *geocenterSbDelays, const SgVector *geocenterGrDelays, const SgVector *geocenterDelayRates, const SgVector *probOfFalses, const SgVector *corrAprioriDelays, const SgVector *corrAprioriRates, const SgVector *corrAprioriAccs, const SgVector *incohAmps, const SgVector *incohAmps2, const SgVector *delayResids, const QVector< QString > &vlb1FileNames, const QVector< QString > &tapeIds_1, const QVector< QString > &tapeIds_2, const QVector< QVector< int > > &epochsOfCorrelations, const QVector< QVector< int > > &epochsOfCentrals, const QVector< QVector< int > > &epochsOfFourfitings, const QVector< QVector< int > > &epochsOfNominalScanTime, const SgMatrix *corrClocks, const SgMatrix *mDlys, const SgMatrix *mAux)
SgVdbVariable vPart_RaDec_
Definition: SgVgosDb.h:1515
bool storeObsPartEOP(const SgMatrix *dV_dPx, const SgMatrix *dV_dPy, const SgMatrix *dV_dUT1)
bool storeObsUserSup(const QVector< int > &uAcSup)
bool storeObsFractC(const SgVector *v)
bool storeObsDataFlag(const QString &band, const QVector< int > &dataFlags)
bool storeObsPhase(const QString &band, const SgMatrix *phases)
bool storeObsNumPhaseAmbigs(const QString &band, const QVector< int > &numAmbigs)
bool storeObsPartPoleTides(const SgMatrix *dV_dPtdX, const SgMatrix *dV_dPtdY, const QString &kind)
bool storeObsPartGamma(const SgMatrix *part)
bool storeObsCalFeedCorr(const SgMatrix *)
SgVdbVariable vCal_TiltRemover_
Definition: SgVgosDb.h:1487
bool storeStationCrossRefs(const QList< int > &numScansPerStation, const QList< QString > &stations, const QMap< QString, QList< int > > &station2scan, const QMap< QString, QList< int > > &scan2station)
SgVdbVariable vCal_Parallax_
Definition: SgVgosDb.h:1484
bool storeObsCalTiltRmvr(const SgMatrix *cals)
bool storeObsChannelInfo(const QString &band, SgVlbiSessionInfo::OriginType originType, const QVector< QString > &channelIds, const QVector< QString > &polarizations, const QVector< int > &numOfChannels, const QVector< int > &bitsPerSamples, const QVector< QVector< int > > &errorRates_1, const QVector< QVector< int > > &errorRates_2, const QVector< QVector< int > > &bbcIdxs_1, const QVector< QVector< int > > &bbcIdxs_2, const QVector< QVector< int > > &corelIdxNumbersUsb, const QVector< QVector< int > > &corelIdxNumbersLsb, const SgVector *sampleRate, const SgMatrix *residFringeAmplByChan, const SgMatrix *residFringePhseByChan, const SgMatrix *refFreqByChan, const SgMatrix *numOfSamplesByChan_USB, const SgMatrix *numOfSamplesByChan_LSB, const SgMatrix *numOfAccPeriodsByChan_USB, const SgMatrix *numOfAccPeriodsByChan_LSB, const SgMatrix *loFreqs_1, const SgMatrix *loFreqs_2)
SgVdbVariable vDelayTheoretical_
Definition: SgVgosDb.h:1503
@ OT_MK4
observations are from Mk4-compatible correlator output;
@ OT_AGV
observations are in AGV format;
@ OT_KOMB
observations are from KOMB output (generated by NICT, Japan);
@ OT_UNKNOWN
unknown (=all others) source of import;