General Purpose Geodetic Library
SgVgosDb.cpp
Go to the documentation of this file.
1 /*
2  *
3  * This file is a part of Space Geodetic Library. The library is used by
4  * nuSolve, a part of CALC/SOLVE system, and designed to make analysis of
5  * geodetic VLBI observations.
6  * Copyright (C) 2010-2020 Sergei Bolotin.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 
25 #include <math.h>
26 #include <netcdf.h>
27 
28 
29 #include <QtCore/QDateTime>
30 #include <QtCore/QDir>
31 #include <QtCore/QFile>
32 #include <QtCore/QFileInfo>
33 #include <QtCore/QRegExp>
34 #include <QtCore/QTextStream>
35 
36 
37 
38 #include <SgIdentities.h>
39 #include <SgLogger.h>
40 #include <SgVgosDb.h>
41 #include <SgVlbiObservation.h>
42 #include <SgVlbiSession.h>
43 #include <SgVlbiStationInfo.h>
44 
45 
46 
47 
48 /*=====================================================================================================*/
49 /* */
50 /* SgVdbVariable implementation */
51 /* */
52 /*=====================================================================================================*/
53 //
54 // static first:
55 const QString SgVdbVariable::className()
56 {
57  return "SgVdbVariable";
58 };
59 
60 
61 
62 //
63 SgVdbVariable::SgVdbVariable(const QString& stdStub, const QString& stdSubDir) :
64  stub_(""),
65  type_(""),
66  band_(""),
67  kind_(""),
68  institution_(""),
69  stdStub_(stdStub),
70  currentInstitution_(""),
71  subDir_(""),
72  fileName_(""),
73  stdSubDir_(stdSubDir),
74  fileName4Output_("")
75 {
76  version_ = 0;
78 };
79 
80 
81 
82 //
84  stub_(v.getStub()),
85  type_(v.type_),
86  band_(v.getBand()),
87  kind_(v.getKind()),
88  institution_(v.getInstitution()),
89  stdStub_(v.stdStub_),
90  currentInstitution_(v.getCurrentInstitution()),
91  subDir_(v.getSubDir()),
92  fileName_(v.getFileName()),
93  stdSubDir_(v.stdSubDir_),
94  fileName4Output_(v.fileName4Output_)
95 {
96  version_ = v.getVersion();
98 };
99 
100 
101 
102 //
104 {
105  QString str(stub_);
106  if (type_.size())
107  str += "_t" + type_;
108  if (kind_.size())
109  str += "_k" + kind_;
110  if (band_.size())
111  str += "_b" + band_;
112  if (institution_.size())
113  str += "_i" + institution_;
114  if (version_>0)
115  str += "_V" + QString("").sprintf("%03d", version_);
116  return str;
117 };
118 
119 
120 
121 //
122 void SgVdbVariable::parseString(const QString& str)
123 {
124  QStringList fields=str.split("_");
125  if (!fields.size())
126  {
128  "::parseString(): the list of fields is empty, the string: [" + str + "]");
129  return;
130  };
131  stub_ = fields.at(0);
132  for (int i=1; i<fields.size(); i++)
133  {
134  if (fields.at(i).left(1).contains("t", Qt::CaseInsensitive))
135  type_ = fields.at(i).mid(1);
136  else if (fields.at(i).left(1).contains("b", Qt::CaseInsensitive))
137  band_ = fields.at(i).mid(1);
138  else if (fields.at(i).left(1).contains("k", Qt::CaseInsensitive))
139  kind_ = fields.at(i).mid(1);
140  else if (fields.at(i).left(1).contains("i", Qt::CaseInsensitive))
141  institution_ = fields.at(i).mid(1);
142  else if (fields.at(i).left(1).contains("v", Qt::CaseInsensitive))
143  {
144  bool isOk;
145  version_ = fields.at(i).mid(1).toInt(&isOk);
146  if (!isOk)
148  "::parseString(): cannot convert version to int: [" + fields.at(i).mid(1) + "]");
149  }
150  else
152  "::parseString(): unparsed part of the name: [" + fields.at(i) + "]");
153  };
154 };
155 
156 
157 
158 //
160 {
161  return stub_.isEmpty();
162 };
163 
164 
165 
166 //
167 QString SgVdbVariable::name4export(const QString& rootDir, SgNetCdf::OperationMode om,
168  const QString& aBand)
169 {
170  QString str("");
171  if (stub_.size())
172  str = stub_;
173  else
174  {
175  str = stdStub_;
176  stub_ = stdStub_;
177  };
178  if (type_.size())
179  str += "_t" + type_;
180  if (kind_.size())
181  str += "_k" + kind_;
182  if (band_.size())
183  str += "_b" + band_;
184  else if (aBand.size())
185  str += "_b" + aBand;
186  if (institution_.size() && currentInstitution_.size())
187  str += "_i" + currentInstitution_;
188 
189  // check existing file:
190  QString path2file(rootDir), baseStr(str), actualSubDir(subDir_);
191  if (!actualSubDir.size())
192  {
193  actualSubDir = stdSubDir_;
195  };
196  if (actualSubDir.size())
197  {
198  actualSubDir += "/";
199  path2file += "/" + actualSubDir;
200  }
201  else
202  path2file += "/";
203  //
204  // if it is necessary, create a subdir:
205  if (om == SgNetCdf::OM_REGULAR) // regular output:
206  {
207  QDir dir(path2file);
208  if (!dir.exists())
209  {
210  if (!dir.mkpath(path2file))
212  "::name4export(): cannot create a path to the directory \"" + path2file + "\"");
213  else
214  {
216  "::name4export(): a directory \"" + path2file + "\" has been created");
218  {
219  QFile::Permissions perm=QFile::permissions(path2file);
220  if (!QFile::setPermissions(path2file, perm | QFile::WriteGroup | QFile::ExeGroup))
222  "::name4export(): cannot change permissions of the directory \"" + path2file + "\"");
223  };
224  };
225  };
226  };
227  //
228  int n=version_;
229  while (QFile(path2file + str + ".nc").exists() && n<1000000)
230  str.sprintf("%s_V%03d", qPrintable(baseStr), ++n);
231  if (n>=1000000)
233  "::name4export(): version overflow: " + compositeName());
234  //
235  fileName4Output_ = str + ".nc";
236  return actualSubDir + fileName4Output_;
237 };
238 /*=====================================================================================================*/
239 
240 
241 
242 
243 
244 /*=====================================================================================================*/
245 /* */
246 /* SgVgosDb implementation */
247 /* */
248 /*=====================================================================================================*/
249 //
250 // static first:
251 const QString SgVgosDb::className()
252 {
253  return "SgVgosDb";
254 };
255 
256 
257 
258 //
260  stationName_(""),
261  stationKey_(""),
262  vTimeUTC_("TimeUTC", ""),
263  vMet_("Met", ""),
264  vAzEl_("AzEl", ""),
265  vFeedRotation_("FeedRotation", ""),
266  vCal_AxisOffset_("Cal-AxisOffset", ""),
267  vCal_Cable_("Cal-Cable", ""),
268  vCal_CableCorrections_("Cal-CableCorrections", ""), // tmp
269  vCal_CblCorrections_("Cal-CblCorrections", ""),
270  vCal_SlantPathTropDry_("Cal-SlantPathTropDry", ""),
271  vCal_SlantPathTropWet_("Cal-SlantPathTropWet", ""),
272  vCal_OceanLoad_("Cal-StationOceanLoad", ""),
273  vPart_AxisOffset_("Part-AxisOffset", ""),
274  vPart_ZenithPathTropDry_("Part-ZenithPathTropDry", ""),
275  vPart_ZenithPathTropWet_("Part-ZenithPathTropWet", ""),
276  vPart_HorizonGrad_("Part-HorizonGrad", ""),
277  vDis_OceanLoad_("Dis-OceanLoad", ""),
278  vRefClockOffset_("RefClockOffset", ""),
279  vTsys_("Tsys", "")
280 {
281  numOfPts_ = 0;
282 };
283 
284 
285 
286 //
288 {
289  vTimeUTC_.setSubDir(stationKey_);
290  vMet_.setSubDir(stationKey_);
291  vAzEl_.setSubDir(stationKey_);
292  vFeedRotation_.setSubDir(stationKey_);
293  vCal_AxisOffset_.setSubDir(stationKey_);
294  vCal_Cable_.setSubDir(stationKey_);
295  vCal_CableCorrections_.setSubDir(stationKey_); // tmp
296  vCal_CblCorrections_.setSubDir(stationKey_);
297  vCal_SlantPathTropDry_.setSubDir(stationKey_);
298  vCal_SlantPathTropWet_.setSubDir(stationKey_);
299  vCal_OceanLoad_.setSubDir(stationKey_);
300  vPart_AxisOffset_.setSubDir(stationKey_);
301  vPart_ZenithPathTropDry_.setSubDir(stationKey_);
302  vPart_ZenithPathTropWet_.setSubDir(stationKey_);
303  vPart_HorizonGrad_.setSubDir(stationKey_);
304  vDis_OceanLoad_.setSubDir(stationKey_);
305  vRefClockOffset_.setSubDir(stationKey_);
306  vTsys_.setSubDir(stationKey_);
307 };
308 
309 
310 
311 //
313  processName_(""),
314  epochOfCreation_(tZero),
315  creator_(""),
316  defaultDir_("History"),
317  historyFileName_(""),
318  inputWrapperFileName_(""),
319  version_("")
320 {
321  isMk3Compatible_ = false;
322 };
323 
324 
325 
326 //
328  programName_(""),
329  content_()
330 {
331 };
332 
333 
334 
335 //
337  programName_("Solve"),
338  // Session:
339  vCalcInfo_("CalcInfo", "Solve"),
340  vCalibrationSetup_("CalibrationSetup", "Solve"),
341  vAtmSetup_("AtmSetup", "Solve"),
342  vClockSetup_("ClockSetup", "Solve"),
343  vErpSetup_("ERPSetup", "Solve"),
344  vIonoSetup_("IonoSetup", "Solve"),
345  vCalcErp_("CalcERP", "Solve"),
346  vBaselineClockSetup_("BaselineClockSetup", "Solve"),
347  vSelectionStatus_("SelectionStatus", "Solve"),
348  // Scan:
349  vScanTimeMJD_("ScanTimeMJD", "Solve"),
350  // Observation:
351  vIonoBits_("IonoBits", "Solve"),
352  vFractC_("FractC", "Solve"),
353  vUnPhaseCalFlag_("UnPhaseCalFlag", "Solve"),
354  vUserSup_("UserSup", "Solve"),
355  vdbVars_()
356 {
360 };
361 
362 
363 
364 //
366 {
367  bool has=false;
368  for (int i=0; i<vdbVars_.size(); i++)
369  if (!vdbVars_.at(i)->isEmpty())
370  has = true;
371  return has;
372 };
373 
374 
375 
376 //
378  bandName_(""),
379  //
380  vChannelInfo_ ("ChannelInfo", "Observables"),
381  vPhaseCalInfo_ ("PhaseCalInfo", "Observables"),
382  vCorrInfo_ ("CorrInfo", "Observables"),
383  vQualityCode_ ("QualityCode", "Observables"),
384  vRefFreq_ ("RefFreq", "Observables"),
385  vAmbigSize_ ("AmbigSize", "Observables"),
386  vSNR_ ("SNR", "Observables"),
387  vCorrelation_ ("Correlation", "Observables"),
388  vPhase_ ("Phase", "Observables"),
389  vSBDelay_ ("SBDelay", "Observables"),
390  vGroupDelay_ ("GroupDelay", "Observables"),
391  vGroupRate_ ("GroupRate", "Observables"),
392  vDelayDataFlag_ ("DelayDataFlag", "Observables"),
393  vDataFlag_ ("DataFlag", "Observables"),
394  //
395 // vPhaseDelayFull_ ("PhaseDelayFull", "ObsDerived"), ???
396  vPhaseDelayFull_ ("PhaseDelayFull", "ObsEdit"),
397  vUVFperAsec_ ("UVFperAsec", "ObsDerived"),
398  vEffFreq_EqWt_ ("EffFreq_kEqWt", "ObsDerived"),
399  vEffFreq_ ("EffFreq", "ObsDerived"),
400  vCal_SlantPathIonoGroup_("Cal-SlantPathIonoGroup", "ObsDerived"),
401  //
402  vCal_FeedCorrection_ ("Cal-FeedCorrection", "ObsCalTheo"),
403  vCal_Unphase_ ("Cal-Unphase", "ObsCalTheo"),
404  //
405  vNumGroupAmbig_ ("NumGroupAmbig", "ObsEdit"),
406  vNumPhaseAmbig_ ("NumPhaseAmbig", "ObsEdit"),
407  vGroupDelayFull_ ("GroupDelayFull", "ObsEdit"),
408  //
409  vMiscFourFit_ ("MiscFourFit", "Session")
410 {
411 };
412 
413 
414 
415 //
420 // outputFormatEpoch_(2016, 4, 2),
421  outputFormatEpoch_(2017, 10, 2),
422  outputFormatId_(""),
423 //historyDescriptorByName_(), localHistory_(),
426 // creator_(""), software4creation_(""), historyFileName_(""), historyFileName4Output_(""),
427  sessionCode_(""), sessionName_(""),
428  // section SESSION:
429  vHead_("Head", ""), vGroupBLWeights_("GroupBLWeights", "Session"),
430  vClockBreak_("ClockBreak", "Session"), vLeapSecond_("LeapSecond", "Session"),
431  vMiscFourFit_("MiscFourFit", "Session"), vMiscCable_("MiscCable", "Session"),
432  vStationApriori_("Station", "Apriori"), vSourceApriori_("Source", "Apriori"),
433  vClockApriori_("Clock", "Apriori"),
434  vAntennaApriori_("Antenna", "Apriori"), vEccentricity_("Eccentricity", "Apriori"),
435  vStationCrossRef_("StationCrossRef", "CrossReference"),
436  vSourceCrossRef_("SourceCrossRef", "CrossReference"),
437  // section STATION:
440  // section SCAN:
441  vScanTimeUTC_("TimeUTC", "Scan"), vScanName_("ScanName", "Scan"), vErpApriori_("ERPApriori", "Scan"),
442  vEphemeris_("Ephemeris", "Scan"), vNutationEqx_kWahr_("NutationEQX_kWahr", "Scan"),
443  vNutationEqx_("NutationEQX", "Scan"),
444  vNutationNro_("NutationNRO", "Scan"),
445  vRot_CF2J2K_("Rot-CF2J2K", "Scan"),
446  vCorrRootFile_("CorrRootFile", "Scan"),
447  // section OBSERVATION:
448  vObservationTimeUTC_("TimeUTC", "Observables"), vBaseline_("Baseline", "Observables"),
449  vSource_("Source", "Observables"),
450  //
451  //
452  bandDataByName_(),
453  //
454  //
455  vDiffTec_("DiffTec", "Observables"),
456  //
457  vCal_Bend_("Cal-Bend", "ObsCalTheo"), vCal_BendSun_("Cal-BendSun", "ObsCalTheo"),
458  vCal_BendSunHigher_("Cal-BendSunHigher", "ObsCalTheo"),
459  vCal_EarthTide_("Cal-EarthTide", "ObsCalTheo"),
460  vCal_FeedCorrection_("Cal-FeedCorrection", "ObsCalTheo"),
461  vCal_HfErp_("Cal-HiFreqERP", "ObsCalTheo"),
462  vCal_OceanLoad_("Cal-OceanLoad", "ObsCalTheo"), vCal_OceanLoadOld_("Cal-OceanLoadOld", "ObsCalTheo"),
463  vCal_OceanPoleTideLoad_("Cal-OceanPoleTideLoad", "ObsCalTheo"),
464  vCal_Parallax_("Cal-Parallax", "ObsCalTheo"),
465  vCal_PoleTide_("Cal-PoleTide", "ObsCalTheo"),
466  vCal_PoleTideOldRestore_("Cal-PoleTideOldRestore", "ObsCalTheo"),
467  vCal_TiltRemover_("Cal-TiltRemover", "ObsCalTheo"),
468  vCal_Wobble_("Cal-Wobble", "ObsCalTheo"),
469  vCal_HfLibration_("Cal-HiFreqLibration", "ObsCalTheo"),
470  vCal_HiFreqLibration_("Cal-HiFreqLibration", "ObsCalTheo"),
471  //
472  vEdit_("Edit", "ObsEdit"), vNGSQualityFlag_("NGSQualityFlag", "ObsEdit"),
473  vObsCrossRef_("ObsCrossRef", "CrossReference"), vFeedRotNet_("FeedRotNet", "ObsDerived"),
474  vDelayTheoretical_("DelayTheoretical", "ObsTheoretical"),
475  vRateTheoretical_("RateTheoretical", "ObsTheoretical"),
476  vPart_Bend_("Part-Bend", "ObsPart"), vPart_Gamma_("Part-Gamma", "ObsPart"),
477  vPart_Erp_("Part-ERP", "ObsPart"), vPart_NutationEqx_("Part-NutationEQX", "ObsPart"),
478  vPart_NutationNro_("Part-NutationNRO", "ObsPart"), vPart_Parallax_("Part-Parallax", "ObsPart"),
479  vPart_PoleTide_("Part-Poletide", "ObsPart"), vPart_Precession_("Part-Precession", "ObsPart"),
480  vPart_RaDec_("Part-RaDec", "ObsPart"), vPart_Xyz_("Part-XYZ", "ObsPart"),
484 
485  vdbVariables_()
486 {
488  isNewFile_ = true;
490  numOfObs_ = 0;
491  numOfScans_ = 0;
492  currentVersion_ = 0;
493  numOfChan_ = 0;
494  numOfStn_ = 0;
495  numOfSrc_ = 0;
496  inputFormatVersion_ = 0.0;
497  outputFormatVersion_ = 1.002;
498  have2redoLeapSecond_ = false;
501  << &vAntennaApriori_
505  << &vBaseline_ << &vSource_ << &vDiffTec_
514  << &vPart_RaDec_ << &vPart_Xyz_;
516  // form the string:
517  outputFormatId_.sprintf("%.3f ", outputFormatVersion_);
520 };
521 
522 
523 
524 //
526 {
527  activeVars_.clear();
528  //
529  for (int i=0; i<obsUserCorrections_.size(); i++)
530  delete obsUserCorrections_.at(i);
531  obsUserCorrections_.clear();
532  //
533 };
534 
535 
536 
537 //
538 bool SgVgosDb::init(const QString path, const QString fileName)
539 {
540  bool isOk(false);
541  QString str;
542  path2RootDir_ = path;
543  wrapperFileName_ = fileName;
544  QFile f(path2RootDir_ + "/" + wrapperFileName_);
545  if (!f.exists())
546  {
548  "::init(): the wrapper file [" + f.fileName() + "] does not exist");
549  return false;
550  };
551  //
552  int numOfParsedStrings;
553  bool isHistoryBlockParsed, isSessionBlockParsed,
554  isScanBlockParsed, isObservationBlockParsed;
555  isHistoryBlockParsed = isSessionBlockParsed = isScanBlockParsed = isObservationBlockParsed = false;
556  numOfParsedStrings = 0;
557  //
559  //
560  if (f.open(QFile::ReadOnly))
561  {
562  QTextStream s(&f);
563  while (!s.atEnd())
564  {
565  str = s.readLine();
566  if (str.size()>0 && str.at(0) != '!' && str.at(0) != '#')
567  {
568  if (numOfParsedStrings==0 && str.contains("VERSION", Qt::CaseInsensitive)) // first string only?
569  {
570  numOfParsedStrings += parseVersionBlock(s, str);
571  // check for versions:
573  {
575  "::init(): the input wrapper file contains a version (" +
576  QString("").setNum(inputFormatVersion_) + " of " +
577  inputFormatEpoch_.toString(SgMJD::F_Date) + ") that is newer than the software knows (" +
578  QString("").setNum(outputFormatVersion_) + " of " +
580  f.close();
581  s.setDevice(NULL);
582  return false;
583  }
584  else if (inputFormatVersion_ == 1.001)
585  {
587  }
588  else
589  {
591  };
592  }
593  else if (!isHistoryBlockParsed && str.contains("Begin History", Qt::CaseInsensitive))
594  {
595  numOfParsedStrings += parseHistoryBlock(s);
596  isHistoryBlockParsed = true;
597  }
598  else if (!isSessionBlockParsed && str.contains("Begin Session", Qt::CaseInsensitive))
599  {
600  numOfParsedStrings += parseSessionBlock(s);
601  isSessionBlockParsed = true;
602  }
603  else if (str.contains("Begin Station", Qt::CaseInsensitive))
604  {
605  numOfParsedStrings += parseStationBlock(s, str.mid(14));
606  }
607  else if (!isScanBlockParsed && str.contains("Begin Scan", Qt::CaseInsensitive))
608  {
609  numOfParsedStrings += parseScanBlock(s);
610  isScanBlockParsed = true;
611  }
612  else if (!isObservationBlockParsed && str.contains("Begin Observation", Qt::CaseInsensitive))
613  {
614  numOfParsedStrings += parseObservationBlock(s);
615  isObservationBlockParsed = true;
616  }
617  else if (str.contains("Begin Program", Qt::CaseInsensitive))
618  {
619  numOfParsedStrings += parseProgramBlock(s, str.mid(14));
620  }
621  else
622  {
624  "::init(): got an unexpected string in the wrapper file: [" + str +
625  "]; skipped");
626  numOfParsedStrings++;
627  };
628  };
629  };
630  f.close();
631  s.setDevice(NULL);
632  isOk = true;
633  QFileInfo fi(f);
634  QDateTime dateTime(fi.created());
635  dateOfCreation_ = SgMJD(dateTime.date().year(), dateTime.date().month(), dateTime.date().day(),
636  dateTime.time().hour(), dateTime.time().minute(),
637  dateTime.time().second()+dateTime.time().msec()*0.001);
638  }
639  else
640  {
642  "::init(): cannot open the wrapper file [" + f.fileName() + "] for read access");
643  return false;
644  };
645  if (isOk)
647  "::init(): parsed " + QString("").setNum(numOfParsedStrings) +
648  " strings from the wrapper file [" + f.fileName() + "]");
649 //dump2stdout();
650  //
651  isOk = isValidNcFiles();
652  //
653  if (currentIdentities_)
654  for (int i=0; i<vdbVariables_.size(); i++)
655  vdbVariables_.at(i)->setCurrentInstitution(currentIdentities_->getAcAbbName());
656 
657  corrTypeId_ = "Corr"; //generic name
658  isNewFile_ = false;
659 
660  // check for [polular] missed data:
661  if (bandDataByName_.contains("S"))
662  {
663  const BandData &bd=bandDataByName_["S"];
664  if (bd.vQualityCode_.isEmpty())
666  "::init(): no data provided for the Quality Code on the secondary band of " +
667  sessionName_ + ": " + f.fileName());
668  if (bd.vAmbigSize_.isEmpty())
670  "::init(): no data provided for the Ambiguity Size on the secondary band of " +
671  sessionName_ + ": " + f.fileName());
672  if (bd.vGroupRate_.isEmpty())
674  "::init(): no data provided for the Group Delay Rate on the secondary band of " +
675  sessionName_ + ": " + f.fileName());
676 /*
677  if (bd.vEffFreq_.isEmpty())
678  logger->write(SgLogger::ERR, SgLogger::IO_TXT, className() +
679  "::init(): no data provided for the Effective Frequency on the secondary band of " +
680  sessionName_ + ": " + f.fileName());
681 */
682  if (bd.vSBDelay_.isEmpty())
684  "::init(): no data provided for the Single Band Delay on the secondary band of " +
685  sessionName_ + ": " + f.fileName());
686  };
687  //
688  //
690  //
692  //
693  //
694  return isOk;
695 };
696 
697 
698 
699 //
701 {
702  // inits data for a new (not represented in VGOS format) session.
703  numOfObs_ = session->observations().size();
704  // number of scans?
705  QMap<QString, SgVlbiObservation*>
706  obsByScan;
707  for (int i=0; i<numOfObs_; i++)
708  {
709  SgVlbiObservation* obs=session->observations().at(i);
710 //4KOMB:
711 //std::cout << " -- - - " << qPrintable(QString("").sprintf("%3d(%3d)", i, obsByScan.size()))
712 // << qPrintable(obs->getScanId()) << " : "
713 // << qPrintable(obs->getKey()) << " : " << qPrintable(obs->getScanName())
714 // << qPrintable(obs->toString())
715 // << " \n";
716 // if (!obsByScan.contains(obs->getScanName()))
717 // obsByScan.insert(obs->getScanName(), obs);
718  if (!obsByScan.contains(obs->getScanId()))
719  obsByScan.insert(obs->getScanId(), obs);
720  };
721  numOfScans_ = obsByScan.size();
722  obsByScan.clear();
723  numOfChan_ = 0;
724  numOfStn_ = session->stationsByName().size();
725  numOfSrc_ = session->sourcesByName().size();
726 // QList<SgVdbVariable*> activeVars_;
727  if (session->getOriginType()==SgVlbiSession::OT_MK4 ||
729  corrTypeId_ = "Mk4";
730  else if (session->getOriginType()==SgVlbiSession::OT_KOMB)
731  corrTypeId_ = "Komb";
732  else
733  corrTypeId_ = "Corr"; //generic name
734 
735  setSessionName(session->getName());
736  setSessionCode(session->getSessionCode());
737 
738  stnDescriptorByKey_.clear();
739  stnDescriptorByName_.clear();
740  for (StationsByName_it it=session->stationsByName().begin(); it!=session->stationsByName().end(); ++it)
741  {
742  SgVlbiStationInfo *stn=it.value();
743  QString key=stn->getKey();
744  key = key.simplified();
745  key.replace(' ', '_');
747  sd.stationKey_ = key;
748  sd.stationName_= stn->getKey();
749  // fill the map:
751  //
752  sd.numOfPts_ = stn->auxObservationByScanId()->size();
753  //
754  procNcString("TimeUTC.nc", key, sd.vTimeUTC_);
755  vdbVariables_ << &sd.vTimeUTC_;
756  if (false &&
757  ( session->getOriginType()==SgVlbiSession::OT_MK4 ||
758  session->getOriginType()==SgVlbiSession::OT_KOMB ) )
759  {
760  procNcString("AzEl_k" + corrTypeId_ + ".nc", key, sd.vAzEl_);
761  vdbVariables_ << &sd.vAzEl_;
762  };
763  if (session->getOriginType()==SgVlbiSession::OT_KOMB)
764  {
765  procNcString("RefClockOffset.nc", key, sd.vRefClockOffset_);
767  };
768  sd.propagateStnKey();
769  };
770  //
771  for (QMap<QString, SgVlbiBand*>::iterator it=session->bandByKey().begin();
772  it!=session->bandByKey().end(); ++it)
773  {
774  BandData &bd=bandDataByName_[it.key()];
776  << &bd.vRefFreq_ << &bd.vAmbigSize_ << &bd.vSNR_ << &bd.vCorrelation_ << &bd.vPhase_
777  << &bd.vSBDelay_ << &bd.vGroupDelay_ << &bd.vGroupRate_ << &bd.vDelayDataFlag_
778  << &bd.vDataFlag_ << &bd.vPhaseDelayFull_ << &bd.vUVFperAsec_ << &bd.vEffFreq_EqWt_
780  << &bd.vCal_Unphase_ << &bd.vNumGroupAmbig_ << &bd.vNumPhaseAmbig_
781  << &bd.vGroupDelayFull_ << &bd.vMiscFourFit_;
782  };
783  if (currentIdentities_)
784  for (int i=0; i<vdbVariables_.size(); i++)
785  vdbVariables_.at(i)->setCurrentInstitution(currentIdentities_->getAcAbbName());
786 
787  isNewFile_ = true;
788  return true;
789 };
790 
791 
792 
793 //
794 int SgVgosDb::parseVersionBlock(QTextStream&, const QString& str)
795 {
796  QRegExp reFmtVer("^VERSION\\s+([+-\\.\\d]+)\\s+(\\d{4}\\w{3}\\d{2})\\s*",
797  Qt::CaseInsensitive);
798  bool isOk=false;
799  if (reFmtVer.indexIn(str) != -1)
800  {
801  double d=reFmtVer.cap(1).toDouble(&isOk);
802  if (isOk)
803  {
804  SgMJD t_tmp(tZero);
805  if (t_tmp.fromString(SgMJD::F_YYYYMonDD, reFmtVer.cap(2)))
806  {
807  inputFormatEpoch_ = t_tmp;
810  "::parseVersionBlock(): found format version " + QString("").setNum(inputFormatVersion_) +
811  " of " + inputFormatEpoch_.toString());
812  }
813  else
815  "::parseVersionBlock(): cannot get an epoch from VERSION string: [" + str + "]");
816  }
817  else
819  "::parseVersionBlock(): cannot convert value to double from VERSION string: [" + str + "]");
820  }
821  else
823  "::parseVersionBlock(): got an unexpected VERSION string: [" + str + "]");
824  // currently, it is just one string:
825  return 1;
826 };
827 
828 
829 
830 //
831 int SgVgosDb::parseHistoryBlock(QTextStream &s)
832 {
833  int numOfStrs;
834  numOfStrs = 0;
835  const QString eob("End History");
836  QString bosb("Begin Program");
837  QString str;
838 
839  if (1.0 <= inputFormatVersion_)
840  bosb = "Begin Process";
841 
842  while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
843  {
844  str = s.readLine();
845  if (str.at(0) != '!' && str.at(0) != '#' && str.size()>0)
846  {
847  if (str.contains(bosb, Qt::CaseInsensitive))
848  {
849  numOfStrs += parseHistoryProcessSubBlock(s, str.mid(14));
850  }
851  else if (str.contains(eob, Qt::CaseInsensitive))
852  numOfStrs++;
853  else
854  {
856  "::parseHistoryBlock(): got an unknown string in the history block of wrapper file: [" +
857  str + "]; skipped");
858  numOfStrs++;
859  };
860  };
861  };
862  return numOfStrs;
863 };
864 
865 
866 
867 //
868 int SgVgosDb::parseHistoryProcessSubBlock(QTextStream& s, const QString& progName)
869 {
870  int numOfStrs;
871  numOfStrs = 0;
872  QString eosb("End Program");
873  QString str, subDir(""), key(progName);
874 
875  if (1.0 <= inputFormatVersion_)
876  eosb = "End Process";
877 
878  //
880  hd.processName_ = progName;
881  while (!str.contains(eosb, Qt::CaseInsensitive) && !s.atEnd())
882  {
883  str = s.readLine();
884  if (str.at(0) != '!' && str.at(0) != '#' && str.size()>0)
885  {
886  if (str.contains("Default_Dir", Qt::CaseInsensitive))
887  {
888  //Default_dir History
889  subDir = str.mid(12);
890  hd.defaultDir_ = subDir;
891  numOfStrs++;
892  }
893  else if (str.contains("RunTimeTag", Qt::CaseInsensitive))
894  {
895  //RunTimeTag 2014/02/10 08:28:53
896  //RunTimeTag 2014/02/10 08:28:53 UTC
897  bool isUtc=false;
898  str = str.mid(11).simplified();
899  if (str.endsWith("UTC"))
900  {
901  str.chop(3);
902  isUtc = true;
903  };
906  "::parseHistoryProcessSubBlock(): cannot get proper creation epoch: [" +
907  str + "]; skipped");
908  else if (!isUtc)
910  numOfStrs++;
911  }
912  else if (str.contains("Createdby ", Qt::CaseInsensitive))
913  {
914  //CreatedBy John M. Gipson
915  hd.creator_ = str.mid(10);
916  numOfStrs++;
917  }
918  else if (str.contains("History ", Qt::CaseInsensitive))
919  {
920  //History 11MAR31XE_V004.hist
921  //History 08AUG12XA_kMK3DB_V004.hist
922  hd.historyFileName_ = str.mid(8).simplified();
923  numOfStrs++;
924  }
925  else if (str.contains("InputWrapper ", Qt::CaseInsensitive))
926  {
927  //InputWrapper 15JUL28BB_V001_kall.wrp
928  hd.inputWrapperFileName_ = str.mid(13).simplified();
929  numOfStrs++;
930  }
931  else if (str.contains("Version", Qt::CaseInsensitive))
932  {
933  //Version Mixed
934  //Version 2014Feb08
935  hd.version_ = str.mid(8).simplified();
936  numOfStrs++;
937  if (hd.version_.contains("Mixed", Qt::CaseInsensitive))
938  hd.isMk3Compatible_ = true;
939  }
940  else if (str.contains(eosb, Qt::CaseInsensitive))
941  numOfStrs++;
942  else
943  {
945  "::parseHistoryProcessSubBlock(): got an unknown string in "
946  "the history block of wrapper file: [" + str + "]; skipped");
947  numOfStrs++;
948 std::cout << " Fix me: HISTORY need to add a parser for the string [" << qPrintable(str) << "]\n";
949  };
950  };
951  };
952  historyDescriptors_ << hd;
953  return numOfStrs;
954 };
955 
956 
957 
958 //
959 int SgVgosDb::parseSessionBlock(QTextStream &s)
960 {
961  int numOfStrs;
962  numOfStrs = 0;
963  const QString eob("End Session");
964  QString str, subDir("");
965  QString bandKey(""), bKey("");
966 
967  while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
968  {
969  str = s.readLine();
970  parseBandKey(str, bandKey);
971  bKey = bandKey==""?"X":bandKey;
972 
973  if (str.at(0) != '!' && str.at(0) != '#' && str.size()>0)
974  {
975  if (str.contains("Default_Dir", Qt::CaseInsensitive))
976  {
977  //Default_Dir Session
978  subDir = str.mid(12);
979  numOfStrs++;
980  }
981  else if (str.contains("Session ", Qt::CaseInsensitive))
982  {
983  //Session R4476
984  sessionCode_ = str.mid(8);
985  numOfStrs++;
986  }
987  else if (str.contains("AltSessionId ", Qt::CaseInsensitive))
988  {
989  //AltSessionId 11MAR31XE
990  sessionName_ = str.mid(13);
991  numOfStrs++;
992  }
993  else if ( str.contains("Head", Qt::CaseInsensitive) &&
994  str.contains(".nc", Qt::CaseInsensitive))
995  numOfStrs += procNcString(str, subDir, vHead_);
996  else if ( str.contains("GroupBLWeights", Qt::CaseInsensitive) &&
997  str.contains(".nc", Qt::CaseInsensitive))
998  numOfStrs += procNcString(str, subDir, vGroupBLWeights_);
999  else if ( str.contains("ClockBreak", Qt::CaseInsensitive) &&
1000  str.contains(".nc", Qt::CaseInsensitive))
1001  numOfStrs += procNcString(str, subDir, vClockBreak_);
1002  else if ( str.contains("LeapSecond", Qt::CaseInsensitive) &&
1003  str.contains(".nc", Qt::CaseInsensitive))
1004  numOfStrs += procNcString(str, subDir, vLeapSecond_);
1005  else if ( str.contains("MiscFourFit", Qt::CaseInsensitive) &&
1006  str.contains("_b", Qt::CaseInsensitive) &&
1007  str.contains(".nc", Qt::CaseInsensitive))
1008  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vMiscFourFit_);
1009  else if ( str.contains("MiscFourFit", Qt::CaseInsensitive) &&
1010  str.contains(".nc", Qt::CaseInsensitive))
1011  numOfStrs += procNcString(str, subDir, vMiscFourFit_);
1012  else if ( str.contains("MiscCable", Qt::CaseInsensitive) &&
1013  str.contains(".nc", Qt::CaseInsensitive))
1014  numOfStrs += procNcString(str, subDir, vMiscCable_);
1015  else if ( str.contains("StationCrossRef", Qt::CaseInsensitive) &&
1016  str.contains(".nc", Qt::CaseInsensitive))
1017  numOfStrs += procNcString(str, subDir, vStationCrossRef_);
1018  else if ( str.contains("BaselineClockSetup", Qt::CaseInsensitive) &&
1019  str.contains(".nc", Qt::CaseInsensitive))
1020  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vBaselineClockSetup_);
1021  else if ( str.contains("ClockSetup", Qt::CaseInsensitive) &&
1022  str.contains(".nc", Qt::CaseInsensitive))
1023  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vClockSetup_);
1024  else if ( str.contains("Station", Qt::CaseInsensitive) &&
1025  str.contains(".nc", Qt::CaseInsensitive))
1026  numOfStrs += procNcString(str, subDir, vStationApriori_);
1027  else if ( str.contains("SourceCrossRef", Qt::CaseInsensitive) &&
1028  str.contains(".nc", Qt::CaseInsensitive))
1029  numOfStrs += procNcString(str, subDir, vSourceCrossRef_);
1030  else if ( str.contains("Source", Qt::CaseInsensitive) &&
1031  str.contains(".nc", Qt::CaseInsensitive))
1032  numOfStrs += procNcString(str, subDir, vSourceApriori_);
1033  else if ( str.contains("Clock", Qt::CaseInsensitive) &&
1034  str.contains(".nc", Qt::CaseInsensitive))
1035  numOfStrs += procNcString(str, subDir, vClockApriori_);
1036  else if ( str.contains("Eccentricity", Qt::CaseInsensitive) &&
1037  str.contains(".nc", Qt::CaseInsensitive))
1038  numOfStrs += procNcString(str, subDir, vEccentricity_);
1039  else if ( str.contains("Antenna", Qt::CaseInsensitive) &&
1040  str.contains(".nc", Qt::CaseInsensitive))
1041  numOfStrs += procNcString(str, subDir, vAntennaApriori_);
1042  else if ( str.contains("CalcInfo", Qt::CaseInsensitive) &&
1043  str.contains(".nc", Qt::CaseInsensitive))
1044  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vCalcInfo_);
1045  else if ( str.contains("CalcErp", Qt::CaseInsensitive) &&
1046  str.contains(".nc", Qt::CaseInsensitive))
1047  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vCalcErp_);
1048  else if ( str.contains("AtmSetup", Qt::CaseInsensitive) &&
1049  str.contains(".nc", Qt::CaseInsensitive))
1050  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vAtmSetup_);
1051  else if ( str.contains("ErpSetup", Qt::CaseInsensitive) &&
1052  str.contains(".nc", Qt::CaseInsensitive))
1053  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vErpSetup_);
1054  else if ( str.contains("CalibrationSetup", Qt::CaseInsensitive) &&
1055  str.contains(".nc", Qt::CaseInsensitive))
1056  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vCalibrationSetup_);
1057  else if ( str.contains("IonoSetup", Qt::CaseInsensitive) &&
1058  str.contains(".nc", Qt::CaseInsensitive))
1059  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vIonoSetup_);
1060  else if ( str.contains("SelectionStatus", Qt::CaseInsensitive) &&
1061  str.contains(".nc", Qt::CaseInsensitive))
1062  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vSelectionStatus_);
1063  // just ignore it:
1064  else if ( str.contains("PhaseBLWeights", Qt::CaseInsensitive))
1065  numOfStrs++;
1066  // end of parsing
1067  else if (str.contains(eob, Qt::CaseInsensitive))
1068  numOfStrs++;
1069  else
1070  {
1072  "::parseSessionBlock(): got an unexpected string in the session block of wrapper file: [" +
1073  str + "]; skipped");
1074  numOfStrs++;
1075 std::cout << " Fix me: SESSION need to add a parser for the string [" << qPrintable(str) << "]\n";
1076  };
1077  };
1078  };
1079 
1080  // update vdbVariables_:
1081  for (QMap<QString, BandData>::iterator it=bandDataByName_.begin(); it!=bandDataByName_.end(); ++it)
1082  {
1083  BandData &bd=it.value();
1085  };
1086  return numOfStrs;
1087 };
1088 
1089 
1090 
1091 //
1092 int SgVgosDb::parseStationBlock(QTextStream &s, const QString& stnName)
1093 {
1094  int numOfStrs;
1095  numOfStrs = 0;
1096  const QString eob("End Station");
1097  QString str, subDir(""), key;
1098  key = stnName;
1099 
1100 // key.sprintf("%-8s", qPrintable(stnName));
1101 // key.replace('_', ' ');
1102 
1103  //StationDescriptor
1104  if (stnDescriptorByKey_.contains(key) &&
1105  !stnDescriptorByKey_.value(key).vTimeUTC_.isEmpty())
1106  {
1108  "::parseStationBlock(): got a duplicate of the station [" + stnName + "]; skipped");
1109  while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1110  {
1111  str = s.readLine();
1112  numOfStrs++;
1113  };
1114  return numOfStrs;
1115  };
1117  sd.stationKey_ = stnName;
1118  while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1119  {
1120  str = s.readLine();
1121  if (str.at(0) != '!' && str.at(0) != '#' && str.size()>0)
1122  {
1123  if (str.contains("Default_Dir", Qt::CaseInsensitive))
1124  {
1125  //Default_Dir Session
1126  subDir = str.mid(12);
1127  numOfStrs++;
1128  }
1129  else if ( str.contains("TimeUTC", Qt::CaseInsensitive) &&
1130  str.contains(".nc", Qt::CaseInsensitive))
1131  numOfStrs += procNcString(str, subDir, sd.vTimeUTC_);
1132  else if ( str.contains("Met", Qt::CaseInsensitive) &&
1133  str.contains(".nc", Qt::CaseInsensitive))
1134  numOfStrs += procNcString(str, subDir, sd.vMet_);
1135  else if ( str.contains("AzEl", Qt::CaseInsensitive) &&
1136  str.contains(".nc", Qt::CaseInsensitive))
1137  numOfStrs += procNcString(str, subDir, sd.vAzEl_);
1138  else if ( str.contains("FeedRotation", Qt::CaseInsensitive) &&
1139  str.contains(".nc", Qt::CaseInsensitive))
1140  numOfStrs += procNcString(str, subDir, sd.vFeedRotation_);
1141  else if ( str.contains("Cal-AxisOffset", Qt::CaseInsensitive) &&
1142  str.contains(".nc", Qt::CaseInsensitive))
1143  numOfStrs += procNcString(str, subDir, sd.vCal_AxisOffset_);
1144  else if ( str.contains("Cal-CableCorrections", Qt::CaseInsensitive) &&
1145  str.contains(".nc", Qt::CaseInsensitive))
1146  numOfStrs += procNcString(str, subDir, sd.vCal_CableCorrections_);
1147  else if ( str.contains("Cal-CblCorrections", Qt::CaseInsensitive) &&
1148  str.contains(".nc", Qt::CaseInsensitive))
1149  numOfStrs += procNcString(str, subDir, sd.vCal_CblCorrections_);
1150  else if ( str.contains("Cal-Cable", Qt::CaseInsensitive) &&
1151  str.contains(".nc", Qt::CaseInsensitive))
1152  numOfStrs += procNcString(str, subDir, sd.vCal_Cable_);
1153  else if ( str.contains("Cal-SlantPathTropDry", Qt::CaseInsensitive) &&
1154  str.contains(".nc", Qt::CaseInsensitive))
1155  numOfStrs += procNcString(str, subDir, sd.vCal_SlantPathTropDry_);
1156  else if ( str.contains("Cal-SlantPathTropWet", Qt::CaseInsensitive) &&
1157  str.contains(".nc", Qt::CaseInsensitive))
1158  numOfStrs += procNcString(str, subDir, sd.vCal_SlantPathTropWet_);
1159  else if ( str.contains("Cal-StationOceanLoad", Qt::CaseInsensitive) &&
1160  str.contains(".nc", Qt::CaseInsensitive))
1161  numOfStrs += procNcString(str, subDir, sd.vCal_OceanLoad_);
1162  else if ( str.contains("Part-AxisOffset", Qt::CaseInsensitive) &&
1163  str.contains(".nc", Qt::CaseInsensitive))
1164  numOfStrs += procNcString(str, subDir, sd.vPart_AxisOffset_);
1165  else if ( str.contains("Part-ZenithPathTropDry", Qt::CaseInsensitive) &&
1166  str.contains(".nc", Qt::CaseInsensitive))
1167  numOfStrs += procNcString(str, subDir, sd.vPart_ZenithPathTropDry_);
1168  else if ( str.contains("Part-ZenithPathTropWet", Qt::CaseInsensitive) &&
1169  str.contains(".nc", Qt::CaseInsensitive))
1170  numOfStrs += procNcString(str, subDir, sd.vPart_ZenithPathTropWet_);
1171  else if ( str.contains("Part-HorizonGrad", Qt::CaseInsensitive) &&
1172  str.contains(".nc", Qt::CaseInsensitive))
1173  numOfStrs += procNcString(str, subDir, sd.vPart_HorizonGrad_);
1174  else if ( str.contains("Dis-OceanLoad", Qt::CaseInsensitive) &&
1175  str.contains(".nc", Qt::CaseInsensitive))
1176  numOfStrs += procNcString(str, subDir, sd.vDis_OceanLoad_);
1177  // KOMB:
1178  else if ( str.contains("RefClockOffset", Qt::CaseInsensitive) &&
1179  str.contains(".nc", Qt::CaseInsensitive))
1180  numOfStrs += procNcString(str, subDir, sd.vRefClockOffset_);
1181  // TSYS:
1182  else if ( str.contains("Tsys", Qt::CaseInsensitive) &&
1183  str.contains(".nc", Qt::CaseInsensitive))
1184  numOfStrs += procNcString(str, subDir, sd.vTsys_);
1185  // end of parsing
1186  else if (str.contains(eob, Qt::CaseInsensitive))
1187  numOfStrs++;
1188  else
1189  {
1191  "::parseStationBlock(): got an unknown string in the station block of wrapper file: [" +
1192  str + "]; skipped");
1193  numOfStrs++;
1194 std::cout << " Fix me: STATION need to add a parser for the string [" << qPrintable(str) << "]\n";
1195  };
1196  };
1197  };
1198  vdbVariables_ << &sd.vTimeUTC_ << &sd.vMet_ << &sd.vAzEl_ << &sd.vFeedRotation_
1199  << &sd.vCal_AxisOffset_ << &sd.vCal_Cable_ << &sd.vCal_CableCorrections_ // tmp
1200  << &sd.vCal_CblCorrections_
1204  << &sd.vTsys_;
1205 
1206  return numOfStrs;
1207 };
1208 
1209 
1210 
1211 //
1212 int SgVgosDb::parseScanBlock(QTextStream &s)
1213 {
1214  int numOfStrs;
1215  numOfStrs = 0;
1216  const QString eob("End Scan");
1217  QString str, subDir("");
1218 
1219  while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1220  {
1221  str = s.readLine();
1222  if (str.at(0) != '!' && str.at(0) != '#' && str.size()>0)
1223  {
1224  if (str.contains("Default_Dir", Qt::CaseInsensitive))
1225  {
1226  //Default_Dir Session
1227  subDir = str.mid(12);
1228  numOfStrs++;
1229  }
1230  // begin of parsing:
1231  else if ( str.contains("TimeUTC", Qt::CaseInsensitive) &&
1232  str.contains(".nc", Qt::CaseInsensitive))
1233  numOfStrs += procNcString(str, subDir, vScanTimeUTC_);
1234  else if ( str.contains("ScanName", Qt::CaseInsensitive) &&
1235  str.contains(".nc", Qt::CaseInsensitive))
1236  numOfStrs += procNcString(str, subDir, vScanName_);
1237  else if ( str.contains("ERPApriori", Qt::CaseInsensitive) &&
1238  str.contains(".nc", Qt::CaseInsensitive))
1239  numOfStrs += procNcString(str, subDir, vErpApriori_);
1240  else if ( str.contains("Ephemeris", Qt::CaseInsensitive) &&
1241  str.contains(".nc", Qt::CaseInsensitive))
1242  numOfStrs += procNcString(str, subDir, vEphemeris_);
1243  else if ( str.contains("NutationEQX_kWahr", Qt::CaseInsensitive) &&
1244  str.contains(".nc", Qt::CaseInsensitive))
1245  numOfStrs += procNcString(str, subDir, vNutationEqx_kWahr_);
1246  else if ( str.contains("NutationEQX", Qt::CaseInsensitive) &&
1247  str.contains(".nc", Qt::CaseInsensitive))
1248  numOfStrs += procNcString(str, subDir, vNutationEqx_);
1249  else if ( str.contains("NutationNRO", Qt::CaseInsensitive) &&
1250  str.contains(".nc", Qt::CaseInsensitive))
1251  numOfStrs += procNcString(str, subDir, vNutationNro_);
1252  else if ( str.contains("Rot-CF2J2K", Qt::CaseInsensitive) &&
1253  str.contains(".nc", Qt::CaseInsensitive))
1254  numOfStrs += procNcString(str, subDir, vRot_CF2J2K_);
1255  else if ( str.contains("CorrRootFile", Qt::CaseInsensitive) &&
1256  str.contains(".nc", Qt::CaseInsensitive))
1257  numOfStrs += procNcString(str, subDir, vCorrRootFile_);
1258  // pre 1.000 format version:
1259  else if ( str.contains("ScanTimeMJD", Qt::CaseInsensitive) &&
1260  str.contains(".nc", Qt::CaseInsensitive))
1261  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vScanTimeMJD_);
1262  //
1263  // end of parsing
1264  else if (str.contains(eob, Qt::CaseInsensitive))
1265  numOfStrs++;
1266  else
1267  {
1269  "::parseScanBlock(): got an unknown string in the scan block of wrapper file: [" +
1270  str + "]; skipped");
1271 std::cout << " Fix me: SCAN need to add a parser for the string [" << qPrintable(str) << "]\n";
1272  numOfStrs++;
1273  };
1274  };
1275  };
1276 
1277  return numOfStrs;
1278 };
1279 
1280 
1281 
1282 //
1283 void SgVgosDb::parseBandKey(const QString& str, QString& key)
1284 {
1285  QRegExp reBand("_b(\\w).*", Qt::CaseInsensitive);
1286  if (reBand.indexIn(str) != -1)
1287  key = reBand.cap(1);
1288  else
1289  key = "";
1290 };
1291 
1292 
1293 
1294 //
1296 {
1297  int numOfStrs;
1298  numOfStrs = 0;
1299  const QString eob("End Observation");
1300  QString str(""), subDir("");
1301  QString bandKey(""), bKey("");
1302 
1303  while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1304  {
1305  str = s.readLine();
1306  parseBandKey(str, bandKey);
1307  bKey = bandKey==""?"X":bandKey;
1308 
1309  if (str.at(0) != '!' && str.at(0) != '#' && str.size()>0)
1310  {
1311  if (str.contains("Default_Dir", Qt::CaseInsensitive))
1312  {
1313  //Default_Dir Session
1314  subDir = str.mid(12);
1315  numOfStrs++;
1316  }
1317  else if ( str.contains("TimeUTC", Qt::CaseInsensitive) &&
1318  str.contains(".nc", Qt::CaseInsensitive))
1319  numOfStrs += procNcString(str, subDir, vObservationTimeUTC_);
1320  else if ( str.contains("Baseline", Qt::CaseInsensitive) &&
1321  str.contains(".nc", Qt::CaseInsensitive))
1322  numOfStrs += procNcString(str, subDir, vBaseline_);
1323  else if ( str.contains("Source", Qt::CaseInsensitive) &&
1324  str.contains(".nc", Qt::CaseInsensitive))
1325  numOfStrs += procNcString(str, subDir, vSource_);
1326  //
1327  //
1328  // per band:
1329  else if ( str.contains("GroupDelayFull", Qt::CaseInsensitive) &&
1330  str.contains(".nc", Qt::CaseInsensitive))
1331  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vGroupDelayFull_);
1332  else if ( str.contains("ChannelInfo", Qt::CaseInsensitive) &&
1333  str.contains(".nc", Qt::CaseInsensitive))
1334  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vChannelInfo_);
1335  else if ( str.contains("PhaseCalInfo", Qt::CaseInsensitive) &&
1336  str.contains(".nc", Qt::CaseInsensitive))
1337  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vPhaseCalInfo_);
1338  else if ( str.contains("CorrInfo", Qt::CaseInsensitive) &&
1339  str.contains(".nc", Qt::CaseInsensitive))
1340  {
1341  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vCorrInfo_);
1342  if (str.contains("-Mk3", Qt::CaseInsensitive))
1344  else if (str.contains("-VLBA", Qt::CaseInsensitive))
1346  else if (str.contains("-CRL", Qt::CaseInsensitive))
1348  else if (str.contains("-GSI", Qt::CaseInsensitive))
1350  else if (str.contains("-K5", Qt::CaseInsensitive))
1352  else if (str.contains("-S2", Qt::CaseInsensitive))
1354  else if (str.contains("-Mk4", Qt::CaseInsensitive))
1356  else if (str.contains("-Haystack", Qt::CaseInsensitive))
1358  else if (str.contains("-difx", Qt::CaseInsensitive))
1360  else
1363  "::parseObservationBlock(): the correlator type is set to " +
1364  QString("").setNum(correlatorType_));
1365  }
1366  else if ( str.contains("QualityCode", Qt::CaseInsensitive) &&
1367  str.contains(".nc", Qt::CaseInsensitive))
1368  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vQualityCode_);
1369  else if ( str.contains("EffFreq", Qt::CaseInsensitive) &&
1370  str.contains("_kEqWt", Qt::CaseInsensitive) &&
1371  str.contains(".nc", Qt::CaseInsensitive) &&
1372  !str.contains("_kDB", Qt::CaseInsensitive))
1373  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vEffFreq_EqWt_);
1374  else if ( str.contains("EffFreq", Qt::CaseInsensitive) &&
1375  str.contains(".nc", Qt::CaseInsensitive) &&
1376  !str.contains("_kDB", Qt::CaseInsensitive))
1377  {
1378  if (bandDataByName_[bandKey].vEffFreq_.isEmpty() || !str.contains("_kDB", Qt::CaseInsensitive))
1379  {
1380  bandDataByName_[bandKey].vEffFreq_.empty();
1381  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vEffFreq_);
1382  };
1383  }
1384  else if ( str.contains("RefFreq", Qt::CaseInsensitive) &&
1385  str.contains(".nc", Qt::CaseInsensitive))
1386  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vRefFreq_);
1387  else if ( str.contains("AmbigSize", Qt::CaseInsensitive) &&
1388  str.contains(".nc", Qt::CaseInsensitive))
1389  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vAmbigSize_);
1390  else if ( str.contains("SNR", Qt::CaseInsensitive) &&
1391  str.contains(".nc", Qt::CaseInsensitive))
1392  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vSNR_);
1393  else if ( str.contains("Correlation", Qt::CaseInsensitive) &&
1394  str.contains(".nc", Qt::CaseInsensitive))
1395  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vCorrelation_);
1396  else if ( str.contains("UVFperAsec", Qt::CaseInsensitive) &&
1397  str.contains(".nc", Qt::CaseInsensitive))
1398  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vUVFperAsec_);
1399  else if ( str.contains("PhaseDelayFull", Qt::CaseInsensitive) &&
1400  str.contains(".nc", Qt::CaseInsensitive))
1401  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vPhaseDelayFull_);
1402  else if ( str.contains("SBDelay", Qt::CaseInsensitive) &&
1403  str.contains(".nc", Qt::CaseInsensitive))
1404  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vSBDelay_);
1405  else if ( str.contains("GroupDelay", Qt::CaseInsensitive) &&
1406  str.contains(".nc", Qt::CaseInsensitive))
1407  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vGroupDelay_);
1408  else if ( str.contains("GroupRate", Qt::CaseInsensitive) &&
1409  str.contains(".nc", Qt::CaseInsensitive))
1410  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vGroupRate_);
1411  else if ( str.contains("DelayDataFlag", Qt::CaseInsensitive) &&
1412  str.contains(".nc", Qt::CaseInsensitive))
1413  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vDelayDataFlag_);
1414  else if ( str.contains("DataFlag", Qt::CaseInsensitive) &&
1415  str.contains(".nc", Qt::CaseInsensitive))
1416  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vDataFlag_);
1417  // VGOS:
1418  else if ( str.contains("DiffTec", Qt::CaseInsensitive) &&
1419  str.contains(".nc", Qt::CaseInsensitive))
1420  numOfStrs += procNcString(str, subDir, vDiffTec_);
1421  // Theoretical Calibrations:
1422  else if ( str.contains("Cal-BendSunHigher", Qt::CaseInsensitive) &&
1423  str.contains(".nc", Qt::CaseInsensitive))
1424  numOfStrs += procNcString(str, subDir, vCal_BendSunHigher_);
1425  else if ( str.contains("Cal-BendSun", Qt::CaseInsensitive) &&
1426  str.contains(".nc", Qt::CaseInsensitive))
1427  numOfStrs += procNcString(str, subDir, vCal_BendSun_);
1428  else if ( str.contains("Cal-Bend", Qt::CaseInsensitive) &&
1429  str.contains(".nc", Qt::CaseInsensitive))
1430  numOfStrs += procNcString(str, subDir, vCal_Bend_);
1431  else if ( str.contains("Cal-EarthTide", Qt::CaseInsensitive) &&
1432  str.contains(".nc", Qt::CaseInsensitive))
1433  numOfStrs += procNcString(str, subDir, vCal_EarthTide_);
1434  else if ( str.contains("Cal-HiFreqERP", Qt::CaseInsensitive) &&
1435  str.contains(".nc", Qt::CaseInsensitive))
1436  numOfStrs += procNcString(str, subDir, vCal_HfErp_);
1437  else if ( str.contains("Cal-OceanLoadOld", Qt::CaseInsensitive) &&
1438  str.contains(".nc", Qt::CaseInsensitive))
1439  numOfStrs += procNcString(str, subDir, vCal_OceanLoadOld_);
1440  else if ( str.contains("Cal-OceanLoad", Qt::CaseInsensitive) &&
1441  str.contains(".nc", Qt::CaseInsensitive))
1442  numOfStrs += procNcString(str, subDir, vCal_OceanLoad_);
1443  else if ( str.contains("Cal-OceanPoleTideLoad", Qt::CaseInsensitive) &&
1444  str.contains(".nc", Qt::CaseInsensitive))
1445  numOfStrs += procNcString(str, subDir, vCal_OceanPoleTideLoad_);
1446  else if ( str.contains("Cal-Parallax", Qt::CaseInsensitive) &&
1447  str.contains(".nc", Qt::CaseInsensitive))
1448  numOfStrs += procNcString(str, subDir, vCal_Parallax_);
1449  else if ( str.contains("Cal-PoleTideOldRestore", Qt::CaseInsensitive) &&
1450  str.contains(".nc", Qt::CaseInsensitive))
1451  numOfStrs += procNcString(str, subDir, vCal_PoleTideOldRestore_);
1452  else if ( str.contains("Cal-PoleTide", Qt::CaseInsensitive) &&
1453  str.contains(".nc", Qt::CaseInsensitive))
1454  numOfStrs += procNcString(str, subDir, vCal_PoleTide_);
1455  else if ( str.contains("Cal-TiltRemover", Qt::CaseInsensitive) &&
1456  str.contains(".nc", Qt::CaseInsensitive))
1457  numOfStrs += procNcString(str, subDir, vCal_TiltRemover_);
1458  else if ( str.contains("Cal-FeedCorrection", Qt::CaseInsensitive) &&
1459  str.contains(".nc", Qt::CaseInsensitive))
1460  {
1461  numOfStrs += procNcString(str, subDir, bandDataByName_[bKey].vCal_FeedCorrection_);
1462  if (bandKey == "")
1463  {
1464  bandDataByName_[bKey].vCal_FeedCorrection_.setBand(bKey);
1466  "::parseObservationBlock(): got unbanded Feed Correction, the band key \"X\" is assumed");
1467  };
1468  }
1469  else if ( str.contains("Cal-Unphase", Qt::CaseInsensitive) &&
1470  str.contains(".nc", Qt::CaseInsensitive))
1471  {
1472  numOfStrs += procNcString(str, subDir, bandDataByName_[bKey].vCal_Unphase_);
1473  if (bandKey == "")
1474  {
1475  bandDataByName_[bKey].vCal_Unphase_.setBand(bKey);
1477  "::parseObservationBlock(): got unbanded Unphase Calibration, the band key \"X\" is assumed");
1478  };
1479  }
1480  else if ( str.contains("Cal-Wobble", Qt::CaseInsensitive) &&
1481  str.contains(".nc", Qt::CaseInsensitive))
1482  numOfStrs += procNcString(str, subDir, vCal_Wobble_);
1483  else if ( str.contains("Cal-HiFreqLibration", Qt::CaseInsensitive) &&
1484  str.contains(".nc", Qt::CaseInsensitive) &&
1485  str.contains("IERS2006", Qt::CaseInsensitive))
1486  numOfStrs += procNcString(str, subDir, vCal_HfLibration_);
1487  else if ( str.contains("Cal-HiFreqLibration", Qt::CaseInsensitive) &&
1488  str.contains(".nc", Qt::CaseInsensitive) &&
1489  str.contains("IERS2010", Qt::CaseInsensitive))
1490  numOfStrs += procNcString(str, subDir, vCal_HiFreqLibration_);
1491  // ObsEdit:
1492  else if ( str.contains("Edit", Qt::CaseInsensitive) &&
1493  str.contains(".nc", Qt::CaseInsensitive))
1494  numOfStrs += procNcString(str, subDir, vEdit_);
1495  else if ( str.contains("NGSQualityFlag", Qt::CaseInsensitive) &&
1496  str.contains(".nc", Qt::CaseInsensitive))
1497  numOfStrs += procNcString(str, subDir, vNGSQualityFlag_);
1498  else if ( str.contains("NumGroupAmbig", Qt::CaseInsensitive) &&
1499  str.contains(".nc", Qt::CaseInsensitive))
1500  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vNumGroupAmbig_);
1501  else if ( str.contains("NumPhaseAmbig", Qt::CaseInsensitive) &&
1502  str.contains(".nc", Qt::CaseInsensitive))
1503  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vNumPhaseAmbig_);
1504  // CrossRefs:
1505  else if ( str.contains("ObsCrossRef", Qt::CaseInsensitive) &&
1506  str.contains(".nc", Qt::CaseInsensitive))
1507  numOfStrs += procNcString(str, subDir, vObsCrossRef_);
1508  // ObsDerived:
1509  else if ( str.contains("FeedRotNet", Qt::CaseInsensitive) &&
1510  str.contains(".nc", Qt::CaseInsensitive))
1511  numOfStrs += procNcString(str, subDir, vFeedRotNet_);
1512  else if ( str.contains("Cal-SlantPathIonoGroup", Qt::CaseInsensitive) &&
1513  str.contains(".nc", Qt::CaseInsensitive))
1514  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vCal_SlantPathIonoGroup_);
1515  // ObsTheo:
1516  else if ( str.contains("DelayTheoretical", Qt::CaseInsensitive) &&
1517  str.contains(".nc", Qt::CaseInsensitive))
1518  numOfStrs += procNcString(str, subDir, vDelayTheoretical_);
1519  else if ( str.contains("RateTheoretical", Qt::CaseInsensitive) &&
1520  str.contains(".nc", Qt::CaseInsensitive))
1521  numOfStrs += procNcString(str, subDir, vRateTheoretical_);
1522  // ObsPartials:
1523  else if ( str.contains("Part-Bend", Qt::CaseInsensitive) &&
1524  str.contains(".nc", Qt::CaseInsensitive))
1525  numOfStrs += procNcString(str, subDir, vPart_Bend_);
1526  else if ( str.contains("Part-Gamma", Qt::CaseInsensitive) &&
1527  str.contains(".nc", Qt::CaseInsensitive))
1528  numOfStrs += procNcString(str, subDir, vPart_Gamma_);
1529  else if ( str.contains("Part-ERP", Qt::CaseInsensitive) &&
1530  str.contains(".nc", Qt::CaseInsensitive))
1531  numOfStrs += procNcString(str, subDir, vPart_Erp_);
1532  else if ( str.contains("Part-NutationEQX", Qt::CaseInsensitive) &&
1533  str.contains(".nc", Qt::CaseInsensitive))
1534  numOfStrs += procNcString(str, subDir, vPart_NutationEqx_);
1535  else if ( str.contains("Part-NutationNRO", Qt::CaseInsensitive) &&
1536  str.contains(".nc", Qt::CaseInsensitive))
1537  numOfStrs += procNcString(str, subDir, vPart_NutationNro_);
1538  else if ( str.contains("Part-Parallax", Qt::CaseInsensitive) &&
1539  str.contains(".nc", Qt::CaseInsensitive))
1540  numOfStrs += procNcString(str, subDir, vPart_Parallax_);
1541  else if ( str.contains("Part-Poletide", Qt::CaseInsensitive) &&
1542  str.contains(".nc", Qt::CaseInsensitive))
1543  numOfStrs += procNcString(str, subDir, vPart_PoleTide_);
1544  else if ( str.contains("Part-Precession", Qt::CaseInsensitive) &&
1545  str.contains(".nc", Qt::CaseInsensitive))
1546  numOfStrs += procNcString(str, subDir, vPart_Precession_);
1547  else if ( str.contains("Part-RaDec", Qt::CaseInsensitive) &&
1548  str.contains(".nc", Qt::CaseInsensitive))
1549  numOfStrs += procNcString(str, subDir, vPart_RaDec_);
1550  else if ( str.contains("Part-XYZ", Qt::CaseInsensitive) &&
1551  str.contains(".nc", Qt::CaseInsensitive))
1552  numOfStrs += procNcString(str, subDir, vPart_Xyz_);
1553  // pre 1.000 format version:
1554  else if ( str.contains("IonoBits", Qt::CaseInsensitive) &&
1555  str.contains(".nc", Qt::CaseInsensitive))
1556  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vIonoBits_);
1557  else if ( str.contains("UnPhaseCalFlag", Qt::CaseInsensitive) &&
1558  str.contains(".nc", Qt::CaseInsensitive))
1559  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vUnPhaseCalFlag_);
1560  else if ( str.contains("FractC", Qt::CaseInsensitive) &&
1561  str.contains(".nc", Qt::CaseInsensitive))
1562  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vFractC_);
1563  // special case:
1564  else if ( str.contains("StructureCorrections", Qt::CaseInsensitive) &&
1565  str.contains(".nc", Qt::CaseInsensitive))
1566  {
1567  SgVdbVariable *vUser=new SgVdbVariable("StructureCorrections", "ObsUserCorrections");
1568  numOfStrs += procNcStringSpec(str, subDir, *vUser);
1569  obsUserCorrections_.append(vUser);
1571  }
1572  //
1573  // skip this phaseDelays-dependants:
1574  // just ignore it:
1575  else if ( str.contains("Cal-SlantPathIonoPhase", Qt::CaseInsensitive))
1576  numOfStrs++;
1577  else if ( str.contains("NumPhaseAmbig", Qt::CaseInsensitive))
1578  numOfStrs++;
1579  // "phase" after all "*phase*" strings processed:
1580  else if ( str.startsWith("Phase", Qt::CaseInsensitive) && // should switch to RegExps
1581  str.contains(".nc", Qt::CaseInsensitive) &&
1582  !str.contains("Ambig", Qt::CaseInsensitive) )
1583  numOfStrs += procNcString(str, subDir, bandDataByName_[bandKey].vPhase_);
1584  // just ignore it:
1585  else if ( str.contains("Unavailable", Qt::CaseInsensitive) &&
1586  str.contains("band", Qt::CaseInsensitive))
1587  numOfStrs++;
1588  else if ( str.contains("Cal-EccentricityMap", Qt::CaseInsensitive))
1589  numOfStrs++;
1590  // end of parsing
1591  else if (str.contains(eob, Qt::CaseInsensitive))
1592  numOfStrs++;
1593  else
1594  {
1596  "::parseObservationBlock(): got an unknown string in the observation block of wrapper"
1597  " file: [" + str + "]; skipped");
1598 std::cout << " Fix me: OBS need to add a parser for the string [" << qPrintable(str) << "]\n";
1599  numOfStrs++;
1600  };
1601  };
1602  };
1603  //
1604  // check a special case:
1605  //
1606  QMap<QString, BandData>::iterator
1607  itt=bandDataByName_.begin();
1608 /*
1609  while (itt != bandDataByName_.end())
1610  {
1611  BandData &bd=itt.value();
1612  bool hasData=true;
1613  hasData = hasData && !bd.vChannelInfo_.isEmpty()
1614 // && !bd.vPhaseCalInfo_.isEmpty()
1615  && !bd.vCorrInfo_.isEmpty()
1616 // && !bd.vQualityCode_.isEmpty()
1617  && !bd.vRefFreq_.isEmpty()
1618  && !bd.vAmbigSize_.isEmpty()
1619 // && !bd.vSNR_.isEmpty()
1620 // && !bd.vCorrelation_.isEmpty()
1621  && !bd.vPhase_.isEmpty()
1622 // && !bd.vSBDelay_.isEmpty()
1623  && !bd.vGroupDelay_.isEmpty()
1624  && !bd.vGroupRate_.isEmpty()
1625 // && !bd.vDelayDataFlag_.isEmpty()
1626 // && !bd.vDataFlag_.isEmpty()
1627 // && !bd.vPhaseDelayFull_.isEmpty()
1628 // && !bd.vUVFperAsec_.isEmpty()
1629 // && !bd.vEffFreq_EqWt_.isEmpty()
1630 // && !bd.vEffFreq_.isEmpty()
1631 // && !bd.vCal_SlantPathIonoGroup_.isEmpty()
1632 // && !bd.vCal_FeedCorrection_.isEmpty()
1633 // && !bd.vCal_Unphase_.isEmpty()
1634 // && !bd.vNumGroupAmbig_.isEmpty()
1635 // && !bd.vNumPhaseAmbig_.isEmpty()
1636 // && !bd.vGroupDelayFull_.isEmpty()
1637  ;
1638  if (!hasData)
1639  {
1640  logger->write(SgLogger::WRN, SgLogger::IO_TXT, className() +
1641  "::parseObservationBlock(): the database missed essential data for " + itt.key() + "-band");
1642  itt = bandDataByName_.erase(itt);
1643  logger->write(SgLogger::WRN, SgLogger::IO_TXT, className() +
1644  "::parseObservationBlock(): the " + itt.key() + "-band is removed from the session");
1645  }
1646  else
1647  ++itt;
1648  };
1649 */
1650  //
1651  //
1652  // update vdbVariables_:
1653  for (itt=bandDataByName_.begin(); itt!=bandDataByName_.end(); ++itt)
1654  {
1655  BandData &bd=itt.value();
1657  << &bd.vRefFreq_ << &bd.vAmbigSize_ << &bd.vSNR_ << &bd.vCorrelation_ << &bd.vPhase_
1658  << &bd.vSBDelay_ << &bd.vGroupDelay_ << &bd.vGroupRate_ << &bd.vDelayDataFlag_
1659  << &bd.vDataFlag_ << &bd.vPhaseDelayFull_ << &bd.vUVFperAsec_ << &bd.vEffFreq_EqWt_
1661  << &bd.vCal_Unphase_ << &bd.vNumGroupAmbig_ << &bd.vNumPhaseAmbig_
1662  << &bd.vGroupDelayFull_;
1663  };
1664  //
1665  return numOfStrs;
1666 };
1667 
1668 
1669 
1670 //
1671 int SgVgosDb::parseProgramBlock(QTextStream &s, const QString &sProgName)
1672 {
1673  int numOfStrs;
1674  numOfStrs = 0;
1675  const QString eob("End Program");
1676  QString str(""), subDir(""), key;
1677  key = sProgName.simplified();
1678 
1679  if (key.compare("Solve", Qt::CaseInsensitive) == 0)
1680  {
1681  while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1682  {
1683  str = s.readLine();
1684  numOfStrs++;
1685  if (str.size()>0 && str.at(0) != '!' && str.at(0) != '#')
1686  {
1687  if (str.contains("Default_Dir", Qt::CaseInsensitive))
1688  subDir = str.mid(12);
1689  else if (str.contains("Begin Session", Qt::CaseInsensitive))
1690  {
1691  while (!str.contains("End Session", Qt::CaseInsensitive) && !s.atEnd())
1692  {
1693  str = s.readLine();
1694  if (str.size()>0 && str.at(0) != '!' && str.at(0) != '#')
1695  {
1696  if (str.contains("Default_Dir", Qt::CaseInsensitive))
1697  subDir = str.mid(12);
1698  else if ( str.contains("AtmSetup", Qt::CaseInsensitive) &&
1699  str.contains(".nc", Qt::CaseInsensitive))
1700  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vAtmSetup_);
1701  else if ( str.contains("BaselineClockSetup", Qt::CaseInsensitive) &&
1702  str.contains(".nc", Qt::CaseInsensitive))
1703  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vBaselineClockSetup_);
1704  else if ( str.contains("ClockSetup", Qt::CaseInsensitive) &&
1705  str.contains(".nc", Qt::CaseInsensitive))
1706  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vClockSetup_);
1707  else if ( str.contains("ErpSetup", Qt::CaseInsensitive) &&
1708  str.contains(".nc", Qt::CaseInsensitive))
1709  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vErpSetup_);
1710  else if ( str.contains("CalibrationSetup", Qt::CaseInsensitive) &&
1711  str.contains(".nc", Qt::CaseInsensitive))
1712  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vCalibrationSetup_);
1713  else if ( str.contains("IonoSetup", Qt::CaseInsensitive) &&
1714  str.contains(".nc", Qt::CaseInsensitive))
1715  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vIonoSetup_);
1716  else if ( str.contains("CalcErp", Qt::CaseInsensitive) &&
1717  str.contains(".nc", Qt::CaseInsensitive))
1718  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vCalcErp_);
1719  else if ( str.contains("SelectionStatus", Qt::CaseInsensitive) &&
1720  str.contains(".nc", Qt::CaseInsensitive))
1721  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vSelectionStatus_);
1722  else if ( str.contains("CalcInfo", Qt::CaseInsensitive) &&
1723  str.contains(".nc", Qt::CaseInsensitive))
1724  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vCalcInfo_);
1725  else if ( str.contains("End Session", Qt::CaseInsensitive) )
1726  numOfStrs++;
1727  else
1728  {
1730  "::parseProgramBlock(): got an unexpected string in the program block of"
1731  "wrapper file: [" + str + "]; skipped");
1732  numOfStrs++;
1733 std::cout << " Fix me: PROGRAM need to add a parser for the string [" << qPrintable(str) << "]\n";
1734  };
1735  };
1736  };
1737  }
1738  else if (str.contains("Begin Station", Qt::CaseInsensitive))
1739  {
1740  while (!str.contains("End Station", Qt::CaseInsensitive) && !s.atEnd())
1741  {
1742  str = s.readLine();
1743  if (str.size()>0 && str.at(0) != '!' && str.at(0) != '#')
1744  {
1745  // .... add here
1746  numOfStrs++;
1747  };
1748  };
1749  }
1750  else if (str.contains("Begin Scan", Qt::CaseInsensitive))
1751  {
1752  while (!str.contains("End Scan", Qt::CaseInsensitive) && !s.atEnd())
1753  {
1754  str = s.readLine();
1755  if (str.size()>0 && str.at(0) != '!' && str.at(0) != '#')
1756  {
1757  if (str.contains("Default_Dir", Qt::CaseInsensitive))
1758  subDir = str.mid(12);
1759  else if ( str.contains("ScanTimeMJD", Qt::CaseInsensitive) &&
1760  str.contains(".nc", Qt::CaseInsensitive))
1761  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vScanTimeMJD_);
1762  else if (str.contains("End Scan", Qt::CaseInsensitive))
1763  numOfStrs++;
1764  else
1765  {
1767  "::parseProgramBlock(): got an unexpected string in the program block of"
1768  "wrapper file: [" + str + "]; skipped");
1769  numOfStrs++;
1770 std::cout << " Fix me: PROGRAM need to add a parser for the string [" << qPrintable(str) << "]\n";
1771  };
1772  };
1773  };
1774  }
1775  else if (str.contains("Begin Observation", Qt::CaseInsensitive))
1776  {
1777  while (!str.contains("End Observation", Qt::CaseInsensitive) && !s.atEnd())
1778  {
1779  str = s.readLine();
1780  if (str.size()>0 && str.at(0) != '!' && str.at(0) != '#')
1781  {
1782  if (str.contains("Default_Dir", Qt::CaseInsensitive))
1783  subDir = str.mid(12);
1784  else if ( str.contains("IonoBits", Qt::CaseInsensitive) &&
1785  str.contains(".nc", Qt::CaseInsensitive))
1786  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vIonoBits_);
1787  else if ( str.contains("UnPhaseCalFlag", Qt::CaseInsensitive) &&
1788  str.contains(".nc", Qt::CaseInsensitive))
1789  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vUnPhaseCalFlag_);
1790  else if ( str.contains("FractC", Qt::CaseInsensitive) &&
1791  str.contains(".nc", Qt::CaseInsensitive))
1792  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vFractC_);
1793  else if ( str.contains("UserSup", Qt::CaseInsensitive) &&
1794  str.contains(".nc", Qt::CaseInsensitive))
1795  numOfStrs += procNcString(str, subDir, progSolveDescriptor_.vUserSup_);
1796  else if (str.contains("End Observation", Qt::CaseInsensitive))
1797  numOfStrs++;
1798  else
1799  {
1801  "::parseProgramBlock(): got an unexpected string in the program block of"
1802  "wrapper file: [" + str + "]; skipped");
1803  numOfStrs++;
1804 std::cout << " Fix me: PROGRAM need to add a parser for the string [" << qPrintable(str) << "]\n";
1805  };
1806  };
1807  };
1808  }
1809  else if (str.contains(eob, Qt::CaseInsensitive))
1810  numOfStrs++;
1811  else
1812  {
1814  "::parseProgramBlock(): got an unexpected string in the wrapper file: [" + str +
1815  "]; skipped");
1816  numOfStrs++;
1817  };
1818  };
1819  };
1820  }
1821  else if (progDescriptorByName_.contains(key))
1822  {
1824  "::parseProgramBlock(): got a duplicate of the Program section of [" +
1825  key + "]; skipped");
1826  while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1827  {
1828  str = s.readLine();
1829  if (str.size()>0 && str.at(0) != '!' && str.at(0) != '#')
1830  {
1831  // add here..
1832  numOfStrs++;
1833  };
1834  };
1835  return numOfStrs;
1836  }
1837  else
1838  {
1840  pgd.programName_ = key;
1841  while (!(str=s.readLine()).contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1842  {
1843  pgd.content_ << str;
1844  numOfStrs++;
1845  };
1846  };
1847  return numOfStrs;
1848 };
1849 
1850 
1851 
1852 //
1854 {
1855  for (QMap<QString, StationDescriptor>::iterator it=stnDescriptorByKey_.begin();
1856  it!=stnDescriptorByKey_.end(); ++it)
1857  {
1858  StationDescriptor &d=it.value();
1859  d.propagateStnKey();
1861  {
1862  if (!stnDescriptorByName_.contains(d.stationName_))
1863  {
1866  "::collectStationNames(): mapped the station name [" + d.stationName_ +
1867  "] to the station key [" + d.stationKey_ + "]");
1868  }
1869  else
1871  "::collectStationNames(): the station name [" + d.stationName_ + "] is already in the map");
1872  }
1873  else
1875  "::collectStationNames(): cannot find station name for the key [" + d.stationKey_ + "]");
1876 
1877  };
1878 };
1879 
1880 
1881 
1882 //
1883 int SgVgosDb::procNcString(const QString& str, const QString& subDir, SgVdbVariable& destination)
1884 {
1885  if (!destination.isEmpty())
1886  {
1888  "::procNcString(): duplicate: [" + destination.getStub() + "] vs [" + str + "]");
1889 std::cout << " Fix me: got a duplicate: was [" << qPrintable(destination.getStub())
1890  << "] became [" << qPrintable(str) << "]\n";
1891  };
1892  if (str.size() > 0)
1893  {
1894  QString name(str.simplified());
1895  if (name.right(3).contains(".nc", Qt::CaseInsensitive))
1896  name = name.left(name.size() - 3);
1897  destination.parseString(name);
1898  destination.setSubDir(subDir);
1899  destination.setFileName(subDir.size()==0 ? str.simplified() : subDir + "/" + str.simplified());
1900  destination.setFileName4Output(str.simplified());
1901  activeVars_ << &destination;
1902  };
1903  return 1;
1904 };
1905 
1906 
1907 
1908 //
1909 int SgVgosDb::procNcStringSpec(const QString& str, const QString& subDir, SgVdbVariable& destination)
1910 {
1911  if (!destination.isEmpty())
1912  {
1914  "::procNcStringSpec(): duplicate: [" + destination.getStub() + "] vs [" + str + "]");
1915 std::cout << " Fix me: got a duplicate: was [" << qPrintable(destination.getStub())
1916  << "] became [" << qPrintable(str) << "]\n";
1917  };
1918  if (str.size() > 0)
1919  {
1920  QString name(str.simplified());
1921  if (name.right(3).contains(".nc", Qt::CaseInsensitive))
1922  name = name.left(name.size() - 3);
1923  destination.parseString(name);
1924  destination.setSubDir(subDir);
1925  destination.setFileName(subDir.size()==0 ? str.simplified() : subDir + "/" + str.simplified());
1926  destination.setFileName4Output(str.simplified());
1927  activeVars_ << &destination;
1928  };
1929  return 1;
1930 };
1931 
1932 
1933 
1934 //
1935 bool SgVgosDb::isValidNcFile(const QString& fileName)
1936 {
1937  bool isOk(true);
1938  int ncid, rc;
1939 
1940  if ((rc=nc_open(qPrintable(fileName), 0, &ncid)) != NC_NOERR)
1941  {
1942  printf("%s\n", nc_strerror(rc));
1943  isOk = false;
1944  };
1945 
1946  if (isOk && (rc=nc_close(ncid)) != NC_NOERR)
1947  {
1948  printf("%s\n", nc_strerror(rc));
1949  isOk = false;
1950  };
1951 
1952  if (isOk)
1954  "::isValidNcFile(): the netCDF file " + fileName + " looks ok");
1955  else
1957  "::isValidNcFile(): got an error while staring at " + fileName);
1958 
1959  return isOk;
1960 };
1961 
1962 
1963 
1964 //
1966 {
1967  bool isOk;
1968  isOk = true;
1969  for (int i=0; i<activeVars_.size() && isOk; i++)
1970  isOk = isValidNcFile(path2RootDir_ + "/" + activeVars_.at(i)->getFileName());
1971  return isOk;
1972 };
1973 
1974 
1975 //
1977 {
1978  // individual items:
1979  std::cout
1980  << "Individual variables:\n"
1981  << " path2RootDir_ : [" << qPrintable(path2RootDir_) << "]\n"
1982  << " wrapperFileName_ : [" << qPrintable(wrapperFileName_) << "]\n"
1983  << " dateOfCreation_ : [" << qPrintable(dateOfCreation_.toString()) << "]\n";
1984 
1985  std::cout << "History part:\n";
1986 // QMap<QString, HistoryDescriptor>::iterator ith;
1987 // for (ith = historyDescriptorByName_.begin(); ith!= historyDescriptorByName_.end(); ++ith)
1988  for (int i=0; i<historyDescriptors_.size(); i++)
1989  {
1990 // const HistoryDescriptor &hd=ith.value();
1991  const HistoryDescriptor &hd=historyDescriptors_.at(i);
1992 // std::cout << " Process " << qPrintable(ith.key()) << "\n";
1993  std::cout << " Process " << qPrintable(hd.processName_) << "\n";
1994  std::cout
1995  << " processName_ : [" << qPrintable(hd.processName_) << "]\n"
1996  << " epochOfCreation_ : [" << qPrintable(hd.epochOfCreation_.toString()) << "]\n"
1997  << " creator_ : [" << qPrintable(hd.creator_) << "]\n"
1998  << " defaultDir_ : [" << qPrintable(hd.defaultDir_) << "]\n"
1999  << " historyFileName_ : [" << qPrintable(hd.historyFileName_) << "]\n"
2000  << " inputWrapperFileName_: [" << qPrintable(hd.inputWrapperFileName_) << "]\n"
2001  << " version_ : [" << qPrintable(hd.version_) << "]\n"
2002  << " isMk3Compatible_ : [" << (hd.isMk3Compatible_?"true":"false") << "]\n"
2003  ;
2004  };
2005  std::cout
2006  << " sessionCode_ : [" << qPrintable(sessionCode_) << "]\n"
2007  << " sessionName_ : [" << qPrintable(sessionName_) << "]\n"
2008  << " vHead_ : [" << qPrintable(vHead_.compositeName()) << "]\n"
2009  << " vGroupBLWeights_ : [" << qPrintable(vGroupBLWeights_.compositeName()) << "]\n"
2010  << " vClockBreak_ : [" << qPrintable(vClockBreak_.compositeName()) << "]\n"
2011  << " vLeapSecond_ : [" << qPrintable(vLeapSecond_.compositeName()) << "]\n"
2012  << " vMiscCable_ : [" << qPrintable(vMiscCable_.compositeName()) << "]\n"
2013  << " vMiscFourFit_ : [" << qPrintable(vMiscFourFit_.compositeName()) << "]\n"
2014  << " vStationApriori_ : [" << qPrintable(vStationApriori_.compositeName()) << "]\n"
2015  << " vSourceApriori_ : [" << qPrintable(vSourceApriori_.compositeName()) << "]\n"
2016  << " vClockApriori_ : [" << qPrintable(vClockApriori_.compositeName()) << "]\n"
2017  << " vEccentricity_ : [" << qPrintable(vEccentricity_.compositeName()) << "]\n"
2018  << " vAntennaApriori_ : [" << qPrintable(vAntennaApriori_.compositeName()) << "]\n"
2019  << " vStationCrossRef_ : [" << qPrintable(vStationCrossRef_.compositeName()) << "]\n"
2020  << " vSourceCrossRef_ : [" << qPrintable(vSourceCrossRef_.compositeName()) << "]\n"
2021  << " vScanTimeUTC_ : [" << qPrintable(vScanTimeUTC_.compositeName()) << "]\n"
2022  << " vScanName_ : [" << qPrintable(vScanName_.compositeName()) << "]\n"
2023  << " vERPApriori_ : [" << qPrintable(vErpApriori_.compositeName()) << "]\n"
2024  << " vEphemeris_ : [" << qPrintable(vEphemeris_.compositeName()) << "]\n"
2025  << " vNutationEqx_kWahr_ : [" << qPrintable(vNutationEqx_kWahr_.compositeName()) << "]\n"
2026  << " vNutationEqx_ : [" << qPrintable(vNutationEqx_.compositeName()) << "]\n"
2027  << " vNutationNro_ : [" << qPrintable(vNutationNro_.compositeName()) << "]\n"
2028  << " vRot_CF2J2K_ : [" << qPrintable(vRot_CF2J2K_.compositeName()) << "]\n"
2029  << " vCorrRootFile_ : [" << qPrintable(vCorrRootFile_.compositeName()) << "]\n"
2030  << " vObservationTimeUTC_ : [" << qPrintable(vObservationTimeUTC_.compositeName()) << "]\n"
2031  << " vBaseline_ : [" << qPrintable(vBaseline_.compositeName()) << "]\n"
2032  << " vSource_ : [" << qPrintable(vSource_.compositeName()) << "]\n"
2033  << " vDiffTec_ : [" << qPrintable(vDiffTec_.compositeName()) << "]\n"
2034  << " vCal_Bend_ : [" << qPrintable(vCal_Bend_.compositeName()) << "]\n"
2035  << " vCal_BendSun_ : [" << qPrintable(vCal_BendSun_.compositeName()) << "]\n"
2036  << " vCal_BendSunHigher_ : [" << qPrintable(vCal_BendSunHigher_.compositeName()) << "]\n"
2037  << " vCal_EarthTide_ : [" << qPrintable(vCal_EarthTide_.compositeName()) << "]\n"
2038  << " vCal_FeedCorrection_ : [" << qPrintable(vCal_FeedCorrection_.compositeName()) << "]\n"
2039  << " vCal_HfErp_ : [" << qPrintable(vCal_HfErp_.compositeName()) << "]\n"
2040  << " vCal_OceanLoad_ : [" << qPrintable(vCal_OceanLoad_.compositeName()) << "]\n"
2041  << " vCal_OceanLoadOld_ : [" << qPrintable(vCal_OceanLoadOld_.compositeName()) << "]\n"
2042  << " vCal_OceanPoleTideLoad_: [" << qPrintable(vCal_OceanPoleTideLoad_.compositeName()) << "]\n"
2043  << " vCal_Parallax_ : [" << qPrintable(vCal_Parallax_.compositeName()) << "]\n"
2044  << " vCal_PoleTide_ : [" << qPrintable(vCal_PoleTide_.compositeName()) << "]\n"
2045  << " vCal_PoleTideOldRestore_:[" << qPrintable(vCal_PoleTideOldRestore_.compositeName()) << "]\n"
2046  << " vCal_TiltRemover_ : [" << qPrintable(vCal_TiltRemover_.compositeName()) << "]\n"
2047  << " vCal_Wobble_ : [" << qPrintable(vCal_Wobble_.compositeName()) << "]\n"
2048  << " vCal_HfLibration_ : [" << qPrintable(vCal_HfLibration_.compositeName()) << "]\n"
2049  << " vCal_HiFreqLibration_ : [" << qPrintable(vCal_HiFreqLibration_.compositeName()) << "]\n"
2050  << " vEdit_ : [" << qPrintable(vEdit_.compositeName()) << "]\n"
2051  << " vNGSQualityFlag_ : [" << qPrintable(vNGSQualityFlag_.compositeName()) << "]\n"
2052  << " vObsCrossRef_ : [" << qPrintable(vObsCrossRef_.compositeName()) << "]\n"
2053  << " vFeedRotNet_ : [" << qPrintable(vFeedRotNet_.compositeName()) << "]\n"
2054  << " vDelayTheoretical_ : [" << qPrintable(vDelayTheoretical_.compositeName()) << "]\n"
2055  << " vRateTheoretical_ : [" << qPrintable(vRateTheoretical_.compositeName()) << "]\n"
2056  << " vPart_Bend_ : [" << qPrintable(vPart_Bend_.compositeName()) << "]\n"
2057  << " vPart_Gamma_ : [" << qPrintable(vPart_Gamma_.compositeName()) << "]\n"
2058  << " vPart_Erp_ : [" << qPrintable(vPart_Erp_.compositeName()) << "]\n"
2059  << " vPart_NutationEqx_ : [" << qPrintable(vPart_NutationEqx_.compositeName()) << "]\n"
2060  << " vPart_NutationNro_ : [" << qPrintable(vPart_NutationNro_.compositeName()) << "]\n"
2061  << " vPart_Parallax_ : [" << qPrintable(vPart_Parallax_.compositeName()) << "]\n"
2062  << " vPart_PoleTide_ : [" << qPrintable(vPart_PoleTide_.compositeName()) << "]\n"
2063  << " vPart_Precession_ : [" << qPrintable(vPart_Precession_.compositeName()) << "]\n"
2064  << " vPart_RaDec_ : [" << qPrintable(vPart_RaDec_.compositeName()) << "]\n"
2065  << " vPart_Xyz_ : [" << qPrintable(vPart_Xyz_.compositeName()) << "]\n"
2066  ;
2067  std::cout << " Program Solve: \n"
2068  << " vAtmSetup_ : [" << qPrintable(progSolveDescriptor_.
2069  vAtmSetup_.compositeName()) << "]\n"
2070  << " vClockSetup_ : [" << qPrintable(progSolveDescriptor_.
2071  vClockSetup_.compositeName()) << "]\n"
2072  << " vErpSetup_ : [" << qPrintable(progSolveDescriptor_.
2073  vErpSetup_.compositeName()) << "]\n"
2074  << " vIonoSetup_ : [" << qPrintable(progSolveDescriptor_.
2075  vIonoSetup_.compositeName()) << "]\n"
2076  << " vCalibrationSetup_ : [" << qPrintable(progSolveDescriptor_.
2077  vCalibrationSetup_.compositeName()) << "]\n"
2078  << " vBaselineClockSetup_ : [" << qPrintable(progSolveDescriptor_.
2079  vBaselineClockSetup_.compositeName()) << "]\n"
2080  << " vCalcErp_ : [" << qPrintable(progSolveDescriptor_.
2081  vCalcErp_.compositeName()) << "]\n"
2082  << " vSelectionStatus_ : [" << qPrintable(progSolveDescriptor_.
2083  vSelectionStatus_.compositeName()) << "]\n"
2084  << " vCalcInfo_ : [" << qPrintable(progSolveDescriptor_.
2085  vCalcInfo_.compositeName()) << "]\n"
2086  << " vScanTimeMJD_ : [" << qPrintable(progSolveDescriptor_.
2087  vScanTimeMJD_.compositeName()) << "]\n"
2088  << " vIonoBits_ : [" << qPrintable(progSolveDescriptor_.
2089  vIonoBits_.compositeName()) << "]\n"
2090  << " vUnPhaseCalFlag_ : [" << qPrintable(progSolveDescriptor_.
2091  vUnPhaseCalFlag_.compositeName()) << "]\n"
2092  << " vFractC_ : [" << qPrintable(progSolveDescriptor_.
2093  vFractC_.compositeName()) << "]\n"
2094  << " vUserSup_ : [" << qPrintable(progSolveDescriptor_.
2095  vUserSup_.compositeName()) << "]\n"
2096  ;
2097  //
2098  std::cout << "\nOn per band basis:\n";
2099  QMap<QString, BandData>::iterator itt;
2100  for (itt=bandDataByName_.begin(); itt!=bandDataByName_.end(); ++itt)
2101  {
2102  const BandData& bd=itt.value();
2103  std::cout << "Band \"" << qPrintable(itt.key()) << "\":\n";
2104  std::cout
2105  << " vChannelInfo : [" << qPrintable(bd.vChannelInfo_.compositeName()) << "]\n"
2106  << " vPhaseCalInfo : [" << qPrintable(bd.vPhaseCalInfo_.compositeName()) << "]\n"
2107  << " vCorrInfo : [" << qPrintable(bd.vCorrInfo_.compositeName()) << "]\n"
2108  << " vQualityCode : [" << qPrintable(bd.vQualityCode_.compositeName()) << "]\n"
2109  << " vRefFreq : [" << qPrintable(bd.vRefFreq_.compositeName()) << "]\n"
2110  << " vAmbigSize : [" << qPrintable(bd.vAmbigSize_.compositeName()) << "]\n"
2111  << " vSNR : [" << qPrintable(bd.vSNR_.compositeName()) << "]\n"
2112  << " vCorrelation : [" << qPrintable(bd.vCorrelation_.compositeName()) << "]\n"
2113  << " vPhase : [" << qPrintable(bd.vPhase_.compositeName()) << "]\n"
2114  << " vSBDelay : [" << qPrintable(bd.vSBDelay_.compositeName()) << "]\n"
2115  << " vGroupDelay : [" << qPrintable(bd.vGroupDelay_.compositeName()) << "]\n"
2116  << " vGroupRate : [" << qPrintable(bd.vGroupRate_.compositeName()) << "]\n"
2117  << " vDelayDataFlag : [" << qPrintable(bd.vDelayDataFlag_.compositeName()) << "]\n"
2118  << " vDataFlag : [" << qPrintable(bd.vDataFlag_.compositeName()) << "]\n"
2119  << " vPhaseDelayFull : [" << qPrintable(bd.vPhaseDelayFull_.compositeName()) << "]\n"
2120  << " vUVFperAsec : [" << qPrintable(bd.vUVFperAsec_.compositeName()) << "]\n"
2121  << " vEffFreq_EqWt : [" << qPrintable(bd.vEffFreq_EqWt_.compositeName()) << "]\n"
2122  << " vEffFreq : [" << qPrintable(bd.vEffFreq_.compositeName()) << "]\n"
2123  << " vCal_SlantPathIonoGroup: [" << qPrintable(bd.vCal_SlantPathIonoGroup_.compositeName()) << "]\n"
2124  << " vCal_FeedCorrection : [" << qPrintable(bd.vCal_FeedCorrection_.compositeName()) << "]\n"
2125  << " vCal_Unphase : [" << qPrintable(bd.vCal_Unphase_.compositeName()) << "]\n"
2126  << " vNumGroupAmbig : [" << qPrintable(bd.vNumGroupAmbig_.compositeName()) << "]\n"
2127  << " vNumPhaseAmbig : [" << qPrintable(bd.vNumPhaseAmbig_.compositeName()) << "]\n"
2128  << " vGroupDelayFull : [" << qPrintable(bd.vGroupDelayFull_.compositeName()) << "]\n\n"
2129  << " vMiscFourFit : [" << qPrintable(bd.vMiscFourFit_.compositeName()) << "]\n\n"
2130  ;
2131  };
2132  //
2133  std::cout << "On per station basis:\n";
2134  QMap<QString, StationDescriptor>::iterator it;
2135  for (it = stnDescriptorByKey_.begin(); it!= stnDescriptorByKey_.end(); ++it)
2136  {
2137  const StationDescriptor& sd=it.value();
2138  std::cout << "Station " << qPrintable(it.key()) << "\n";
2139  std::cout
2140  << " stationName : [" << qPrintable(sd.stationName_) << "]\n"
2141  << " vTimeUTC : [" << qPrintable(sd.vTimeUTC_.compositeName()) << "]\n"
2142  << " vPart-ZenithPathTropDry: [" << qPrintable(sd.vPart_ZenithPathTropDry_.compositeName()) << "]\n"
2143  << " vPart-ZenithPathTropWet: [" << qPrintable(sd.vPart_ZenithPathTropWet_.compositeName()) << "]\n"
2144  << " vPart-HorizonGrad : [" << qPrintable(sd.vPart_HorizonGrad_.compositeName()) << "]\n"
2145  << " vCal-SlantPathTropDry : [" << qPrintable(sd.vCal_SlantPathTropDry_.compositeName()) << "]\n"
2146  << " vCal-SlantPathTropWet : [" << qPrintable(sd.vCal_SlantPathTropWet_.compositeName()) << "]\n"
2147  << " vAzEl : [" << qPrintable(sd.vAzEl_.compositeName()) << "]\n"
2148  << " vPart-AxisOffset : [" << qPrintable(sd.vPart_AxisOffset_.compositeName()) << "]\n"
2149  << " vCal-AxisOffset : [" << qPrintable(sd.vCal_AxisOffset_.compositeName()) << "]\n"
2150  << " vFeedRotation : [" << qPrintable(sd.vFeedRotation_.compositeName()) << "]\n"
2151  << " vDis-OceanLoad : [" << qPrintable(sd.vDis_OceanLoad_.compositeName()) << "]\n"
2152  << " vRefClockOffset : [" << qPrintable(sd.vRefClockOffset_.compositeName()) << "]\n"
2153  << " vTsys : [" << qPrintable(sd.vTsys_.compositeName()) << "]\n"
2154  << " vCal-StationOceanLoad : [" << qPrintable(sd.vCal_OceanLoad_.compositeName()) << "]\n"
2155  << " vMet : [" << qPrintable(sd.vMet_.compositeName()) << "]\n"
2156  << " vCal-Cable : [" << qPrintable(sd.vCal_Cable_.compositeName()) << "]\n\n"
2157  << " vCal-CableCorrections : [" << qPrintable(sd.vCal_CableCorrections_.compositeName()) << "]\n\n"
2158  << " vCal-CblCorrections : [" << qPrintable(sd.vCal_CblCorrections_.compositeName()) << "]\n\n"
2159  ;
2160  };
2161  //
2162  std::cout << "Registered NC files:\n";
2163  for (int i=0; i<activeVars_.size(); i++)
2164  {
2165  std::cout
2166  << " [" << qPrintable(activeVars_.at(i)->getFileName()) << "]\n";
2167  };
2168 };
2169 
2170 
2171 
2172 //
2173 bool SgVgosDb::checkFormat(const QList<FmtChkVar*>& fmt, const SgNetCdf& ncdf, bool ok2fail)
2174 {
2175  bool isOk=true;
2176  for (int i=0; i<fmt.size(); i++)
2177  {
2178  const FmtChkVar *fmtVar=fmt.at(i);
2179  SgNcdfVariable *var=ncdf.lookupVar(fmtVar->name());
2180  if (!var)
2181  {
2182  if (!ok2fail)
2184  "::checkFormat(): cannot find the variable \"" + fmtVar->name() + "\" in the file " +
2185  ncdf.getFileName());
2186  if (fmtVar->isMandatory())
2187  isOk = false;
2188  };
2189  if (var) // can be NULL
2190  {
2191  if (var->getTypeOfData() != fmtVar->typeOfData())
2192  {
2193  if (var->getName() != "FRNGERR")
2194  {
2196  "::checkFormat(): enexpected data type of the variable \"" + fmtVar->name() + "\"");
2197  return false;
2198  }
2199  else
2200  continue; // skip checking
2201  };
2202  const QList<int> &dims=fmtVar->dims();
2203  if (dims.size() && dims.size() != var->dimensions().size()) // if dims.size()==0 the number of
2204  { // dimensions may vary
2205  for (int j=0; j<dims.size(); j++)
2206  {
2207  if (dims.at(j)==SD_Any && dims.size()>var->dimensions().size())
2208  {
2209  var->addDimension(dUnity, j);
2211  "::checkFormat(): the dimension of \"" + fmtVar->name() +
2212  "\" has been expanded by unity at position " + QString("").setNum(j) +
2213  " of " + QString("").setNum(var->dimensions().size()));
2214  };
2215  };
2216  if (dims.size() != var->dimensions().size()) // prev operation did not help, complain:
2217  {
2219  "::checkFormat(): number of dimensions, " + QString("").setNum(var->dimensions().size()) +
2220  ", missmatch for \"" + fmtVar->name() + "\", expected " + QString("").setNum(dims.size()));
2221  return false;
2222  }
2223  };
2224  for (int j=0; j<dims.size(); j++)
2225  {
2226  // special dimensions are not checked :-|
2227  if (dims.at(j) > 0) // regular dimension:
2228  {
2229  if (dims.at(j) != var->dimensions().at(j)->getN())
2230  {
2232  "::checkFormat(): dimension #" + QString("").setNum(j) + " missmatch for [" +
2233  fmtVar->name() + "], expected " + QString("").setNum(dims.at(j)) + " got " +
2234  QString("").setNum(var->dimensions().at(j)->getN()));
2235  return false;
2236  };
2237  }
2238  else // check selected special dimensions:
2239  {
2240  if (dims.at(j)==SD_NumObs &&
2241  numOfObs_>0 &&
2242  var->dimensions().at(j)->getN()!=numOfObs_)
2243  {
2245  "::checkFormat(): the special dimension numObs missmatch for [" +
2246  fmtVar->name() + "], expected " + QString("").setNum(numOfObs_) + " got " +
2247  QString("").setNum(var->dimensions().at(j)->getN()));
2248  return false;
2249  }
2250  else if (dims.at(j)==SD_NumScans &&
2251  numOfScans_>0 &&
2252  var->dimensions().at(j)->getN()!=numOfScans_)
2253  {
2255  "::checkFormat(): the special dimension numScans missmatch for [" +
2256  fmtVar->name() + "], expected " + QString("").setNum(numOfScans_) + " got " +
2257  QString("").setNum(var->dimensions().at(j)->getN()));
2258  return false;
2259  };
2260  };
2261  };
2262  };
2263  };
2264  return isOk;
2265 };
2266 
2267 
2268 
2269 //
2270 const QString SgVgosDb::guessDimName(const QString& varName, int len)
2271 {
2272  QString str("");
2273 
2274  if (len == 1)
2275  str = dUnity.getName();
2276  else if (len > 1)
2277  str.sprintf("DimX%06d", len);
2278  else
2279  {
2280  // NumBaselines -> PhaseBLWeights.nc
2281  //
2282  if (len == SD_NumObs)
2283  str = "NumObs";
2284  else if (len == SD_NumScans)
2285  str = "NumScans";
2286  else if (len == SD_NumChans)
2287  str = "NumChannels";
2288  else if (len == SD_2NumChans)
2289  str = "NumChannels_x_2";
2290  else if (len == SD_NumStnPts)
2291  str = "NumStatScan";
2292  else if (len == SD_NumSrc)
2293  str = "NumSource";
2294  else if (len == SD_NumStn)
2295  str = "NumStation";
2296  else
2297  {
2299  "::guessDimName(): uknown special dimension " + QString("").setNum(len) + " of the var " +
2300  varName);
2301  str = "Unknown";
2302  };
2303  };
2304  return str;
2305 };
2306 
2307 
2308 
2309 //
2310 int SgVgosDb::guessDimVal(const QString& varName, int d, const QString& auxKey)
2311 {
2312  if (d>0)
2313  return d;
2314  if (d == SD_NumObs)
2315  d = numOfObs_;
2316  else if (d == SD_NumScans)
2317  d = numOfScans_;
2318  else if (d == SD_NumChans)
2319  d = numOfChan_;
2320  else if (d == SD_2NumChans)
2321  d = 2*numOfChan_;
2322  else if (d == SD_NumStnPts)
2323  {
2324  if (stnDescriptorByName_.contains(auxKey))
2325  d = stnDescriptorByName_[auxKey]->numOfPts_;
2326  else
2327  {
2329  "::guessDimVal(): cannot find the station [" + auxKey.simplified() +
2330  "] in the container numOfObsByStn_");
2331  d = 0;
2332  };
2333  }
2334  else if (d == SD_NumSrc)
2335  d = numOfSrc_;
2336  else if (d == SD_NumStn)
2337  d = numOfStn_;
2338  else
2339  {
2341  "::guessDimVal(): uknown special dimension " + QString("").setNum(d) + " of the var " + varName);
2342  d = 0;
2343  };
2344  return d;
2345 };
2346 
2347 
2348 
2349 //
2351  const QString& stationKey, const QString& bandKey)
2352 {
2353  QString str("");
2354  for (int i=0; i<fmt.size(); i++)
2355  {
2356  const FmtChkVar *fmtVar=fmt.at(i);
2357  SgNcdfVariable *var=new SgNcdfVariable;
2358  int len;
2359 //--
2360  var->setName(fmtVar->name());
2361  var->setTypeOfData(fmtVar->typeOfData());
2362  var->setId(i);
2363  // dimensions:
2364  const QList<int> &dims=fmtVar->dims();
2365  for (int j=0; j<dims.size(); j++)
2366  {
2367  str = guessDimName(fmtVar->name(), dims.at(j));
2368  len = guessDimVal(str, dims.at(j), stationKey);
2369  var->addDimension(str, len, -1);
2370  };
2371  // data:
2372  var->allocateData();
2373  // attributes:
2374  SgNcdfAttribute *attr=NULL;
2375  if ((len=fmtVar->attLCode().size()) && !fmtVar->have2hideLCode()) // LCODE
2376  {
2377  attr = new SgNcdfAttribute;
2378  attr->setName("LCODE");
2379  attr->setTypeOfData(NC_CHAR);
2380  attr->setNumOfElements(len);
2381  attr->setData(qPrintable(fmtVar->attLCode()), len);
2382  var->addAttribute(attr);
2383  };
2384  if ((len=fmtVar->attDefinition().size())) // definition
2385  {
2386  attr = new SgNcdfAttribute;
2387  attr->setName("Definition");
2388  attr->setTypeOfData(NC_CHAR);
2389  attr->setNumOfElements(len);
2390  attr->setData(qPrintable(fmtVar->attDefinition()), len);
2391  var->addAttribute(attr);
2392  };
2393  if ((len=fmtVar->attUnits().size())) // units
2394  {
2395  attr = new SgNcdfAttribute;
2396  attr->setName("Units");
2397  attr->setTypeOfData(NC_CHAR);
2398  attr->setNumOfElements(len);
2399  attr->setData(qPrintable(fmtVar->attUnits()), len);
2400  var->addAttribute(attr);
2401  };
2402  if ((len=fmtVar->attBand().size()) && bandKey.size()) // band
2403  {
2404  attr = new SgNcdfAttribute;
2405  attr->setName("Band");
2406  attr->setTypeOfData(NC_CHAR);
2407  attr->setNumOfElements(bandKey.size());
2408  attr->setData(qPrintable(bandKey), len);
2409  var->addAttribute(attr);
2410  };
2411  str = SgMJD::currentMJD().toUtc().toString(SgMJD::F_Simple) + " UTC";
2412  len = str.size();
2413  attr = new SgNcdfAttribute;
2414  attr->setName("CreateTime");
2415  attr->setTypeOfData(NC_CHAR);
2416  attr->setNumOfElements(len);
2417  attr->setData(qPrintable(str), len);
2418  var->addAttribute(attr);
2419  //
2420  ncdf.registerVariable(var);
2421  };
2422  //
2423  return true;
2424 };
2425 
2426 
2427 
2428 //
2430 {
2431  // performs work around bugs that were found in earlier versions:
2432  //
2433  // 1. SgLib-0.6.2 and the olders ones did not put "UVFperAsec" in a wrapper file (the coresponding
2434  // netCDF files were created).
2435 
2436  // first, check for history:
2437  bool need2searchForUvf;
2438  need2searchForUvf = true;
2439  for (QMap<QString, BandData>::iterator it=bandDataByName_.begin(); it!=bandDataByName_.end(); ++it)
2440  if (!it.value().vUVFperAsec_.isEmpty())
2441  need2searchForUvf = false;
2442  if (need2searchForUvf)
2443  {
2444  bool calcProcessFound=false;
2445  SgVersion version2correct("temp", 0, 6, 2, QString(""), tZero);
2446  QRegExp reVersions("(\\d+).(\\d+).(\\d+)/(\\d+).(\\d+).(\\d+)");
2447  bool isOk;
2448  for (int i=historyDescriptors_.size()-1; 0<=i && !calcProcessFound; i--)
2449  {
2450  const HistoryDescriptor& hd=historyDescriptors_.at(i);
2451  if (hd.processName_ == "SgLib/vgosDbCalc")
2452  {
2453  calcProcessFound = true;
2454  if (reVersions.indexIn(hd.version_) != -1)
2455  {
2456  int nMaj, nMin, nTyn;
2457  nMaj = nMin = nTyn = 0;
2458  nMaj = reVersions.cap(1).toInt(&isOk);
2459  if (isOk)
2460  {
2461  nMin = reVersions.cap(2).toInt(&isOk);
2462  if (isOk)
2463  {
2464  nTyn = reVersions.cap(3).toInt(&isOk);
2465  if (isOk)
2466  {
2467  SgVersion foundVersion("temp", nMaj, nMin, nTyn, QString(""), tZero);
2468  if (foundVersion <= version2correct)
2469  {
2471  "::makeWorkAround4KnownBugs(): found data that could be corrected");
2472  // ok, check each band:
2473  for (QMap<QString, BandData>::iterator it=bandDataByName_.begin();
2474  it!=bandDataByName_.end(); ++it)
2475  {
2476  BandData& bd=it.value();
2477  const QString&
2478  bandKey=it.key();
2480  "::makeWorkAround4KnownBugs(): checking " + bandKey + "-band");
2481  if (QFile::exists(path2RootDir_ + "/ObsDerived/UVFperAsec_b" + bandKey + ".nc"))
2482  {
2483  procNcString("UVFperAsec_b" + bandKey + ".nc", "ObsDerived", bd.vUVFperAsec_);
2485  "::makeWorkAround4KnownBugs(): found a missed variable " +
2487  };
2488  };
2489  };
2490  }
2491  else
2493  "::makeWorkAround4KnownBugs(): cannot convert \"" + reVersions.cap(3) + "\" to int");
2494  }
2495  else
2497  "::makeWorkAround4KnownBugs(): cannot convert \"" + reVersions.cap(2) + "\" to int");
2498  }
2499  else
2501  "::makeWorkAround4KnownBugs(): cannot convert \"" + reVersions.cap(1) + "\" to int");
2502  }
2503  else
2505  "::makeWorkAround4KnownBugs(): the signature \"SgLib/vgosDbCalc\" has been found, but the "
2506  "version is not in the expected form: \"" + hd.version_ + "\"");
2507  };
2508  };
2509  };
2510  //
2511  //
2512  // other bugs go here:
2513  //
2514 };
2515 
2516 
2517 
2518 //
2520 {
2521  QString path2root("");
2522  QList<QString> list;
2523 
2524  if (path2RootDir_.size() && path2RootDir_ != "./")
2525  path2root = path2RootDir_ + "/";
2526 
2527  list << path2root + wrapperFileName_;
2528  for (int i=0; i<activeVars_.size(); i++)
2529  list << path2root + activeVars_.at(i)->getFileName() ;
2530 
2531  return list;
2532 };
2533 /*=====================================================================================================*/
2534 
2535 
2536 
2537 
2538 
2539 
2540 
2541 
2542 
2543 /*=====================================================================================================*/
2544 //
2545 // constants:
2546 //
2547 // Variables:
2549  fcSecond ("Second", NC_DOUBLE, true, QList<int>() << SD_Any,
2550  "SEC TAG ", "Seconds part of UTC TAG.........", "second"),
2551  fcYmdhm ("YMDHM", NC_SHORT, true, QList<int>() << SD_Any << 5,
2552  "UTC TAG ", "Epoch UTC YMDHM................."),
2553 // fcUtc4 ("UTC TAG4", NC_SHORT, false, QList<int>() << SD_Any << 6,
2554 // "UTC TAG4", "Epoch UTC YMDHMS (4 digit year)."),
2555 
2556  //
2557  fcCalIonoGroup ("Cal-SlantPathIonoGroup",
2558  NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
2559  "ION CORR", "Ion correction. Add to theo. sec", "second", "?"),
2560  fcCalIonoGroupSigma ("Cal-SlantPathIonoGroupSigma",
2561  NC_DOUBLE, true, QList<int>() << SD_NumObs << 2,
2562  "IONRMS ", "Ion correction to sigma. sec", "second", "?"),
2563  fcCalIonoGroupDataFlag("Cal-SlantPathIonoGroupDataFlag",
2564  NC_SHORT, false, QList<int>() << SD_NumObs,
2565  "", "0=OK, -1=Missing, -2=bad", "", "?"),
2566  fcIonoBits ("IonoBits", NC_SHORT, true, QList<int>() << SD_NumObs,
2567  "ION_BITS", "ICORR for full ion tracking."),
2568  fcDelayFlag ("DelayFlag", NC_SHORT, true, QList<int>() << SD_NumObs,
2569  "DELUFLAG", "Delay unweight flag"),
2570  fcRateFlag ("RateFlag", NC_SHORT, true, QList<int>() << SD_NumObs,
2571  "RATUFLAG", "Delay rate unweight flag........"),
2572  fcPhaseFlag ("PhaseFlag", NC_SHORT, false, QList<int>() << SD_NumObs,
2573  "PHSUFLAG", ""),
2574  fcUserSup ("UserSup", NC_SHORT, false, QList<int>() << SD_NumObs,
2575  "UACSUP ", "User action for suppression"),
2576  fcNumGroupAmbig ("NumGroupAmbig", NC_SHORT, true, QList<int>() << SD_NumObs,
2577  "# AMBIG ", "Number of group delay ambiguities", "", "?"),
2578  fcNumGroupSubAmbig ("NumGroupSubAmbig", NC_SHORT, false, QList<int>() << SD_NumObs,
2579  "N/A ", "Number of group delay subambiguities (test purposes)", "", "?"),
2580  fcNumPhaseAmbig ("NumPhaseAmbig", NC_INT, true, QList<int>() << SD_NumObs,
2581  "#PAMBIG ", "Number of phase delay ambiguities", "", "?"),
2582  fcAtmInterval ("AtmInterval", NC_DOUBLE, false, QList<int>() << SD_Any,
2583  "ATM_INTV", "Batchmode atmos interval - hours"),
2584  fcAtmRateConstraint ("AtmRateConstraint", NC_DOUBLE, true, QList<int>() << SD_Any,
2585  "ATM_CNST", "Atmosphere constraint. ps/hr"),
2586  fcAtmRateSite ("AtmRateStationList", NC_CHAR, false, QList<int>() << SD_Any << 8,
2587  "AC_SITES", "Site list for atmos constraints"),
2588  fcClockInterval ("ClockInterval", NC_DOUBLE, false, QList<int>() << SD_Any,
2589  "CLK_INTV", "Batchmode clock interval - hours"),
2590  fcClockRateConstraint ("ClockRateConstraint", NC_DOUBLE, true, QList<int>() << SD_Any,
2591  "CLK_CNST", "Clock constraint-Parts in 1.e14"),
2592  fcClockRateName ("ClockRateConstraintStationList",
2593  NC_CHAR, false, QList<int>() << SD_Any << 8,
2594  "CC_SITES", "Site list for clocks constraints"),
2595  fcPmOffsetConstraint ("WobOffsetConstraint", NC_DOUBLE, true, QList<int>() << 1,
2596  "", "Polar Motion Offset Constraint"),
2597  fcUtOffsetConstraint ("UT1OffsetConstraint", NC_DOUBLE, true, QList<int>() << 1,
2598  "", "UT1 Offset Constraint"),
2599  fcIonoSolveFlag ("IonoSolveFlag", NC_SHORT, true, QList<int>() << SD_NumStn,
2600  "", "Bit flag indicating station has iono correction"),
2601  fcIonoStationList ("IonoStationList", NC_CHAR, true, QList<int>() << SD_NumStn << 8,
2602  "", "Stations with ionocorrection"),
2603  fcGroupBLWeights ("GroupBLWeights", NC_DOUBLE, true, QList<int>() << 2 << SD_Any,
2604  "ERROR K ", "Group delay and rate re-weighting constants."),
2605  fcGroupBLWeightName ("GroupBLWeightStationList",
2606  NC_CHAR, true, QList<int>() << SD_Any << 2 << 8,
2607  "ERROR BL", "B.L.names for formal errors"),
2608  fcSrcSelectionFlag ("SourceSelectionFlag", NC_SHORT, true, QList<int>() << SD_NumSrc,
2609  "SOURSTAT", "Source selection status bit-mapped array."),
2610  fcBlnSelectionFlag ("BaselineSelectionFlag",
2611  NC_SHORT, true, QList<int>() << SD_NumStn
2612  << SD_NumStn,
2613  "BASLSTAT", "Baseline selection bit maped array. 1=some obs, etc."),
2614  fcSrcSelectionName ("SourceSelectionName", NC_CHAR, false, QList<int>() << SD_NumSrc << 8,
2615  "--NEW-- ", "Source names for Source selection array"),
2616  fcBlnSelectionName ("BaselineSelectionName",
2617  NC_CHAR, false, QList<int>() << SD_NumStn << 8,
2618  "--NEW-- ", "Station names for Baseline selection array"),
2619  fcBaselineClock ("BaselineClock", NC_CHAR, true, QList<int>() << SD_Any << 2 << 8,
2620  "BLDEPCKS", "Bl-dependent clock list"),
2621  fcEccentricityType ("EccentricityType", NC_CHAR, false, QList<int>() << SD_NumStn << 2,
2622  "ECCTYPES", "Eccentricity type: XY or NE"),
2623  fcEccentricityName ("EccentricityStationList",
2624  NC_CHAR, true, QList<int>() << SD_NumStn << 8,
2625  "--NEW-- ", "Station name of the corresponding eccentricity"),
2626  fcEccentricityMonument("EccentricityMonument",NC_CHAR, false, QList<int>() << SD_NumStn << 10,
2627  "ECCNAMES", "Eccentricity monument name"),
2628  fcEccentricityVector ("EccentricityVector", NC_DOUBLE, false, QList<int>() << SD_NumStn << 3,
2629  "ECCCOORD", "Eccentricity taken from eccentricity file.", "Meter"),
2630  fcObsCalFlag ("ObsCalFlag", NC_SHORT, false, QList<int>() << 1,
2631  "OBCLFLGS", "Bit set indicate that calibration is recommended."),
2632 // "Standard contribs configuration"
2633  fcStatCalFlag ("StatCalFlag", NC_SHORT, true, QList<int>() << SD_NumStn,
2634  "CAL FLGS", "Bit set indicate that calibration is recommended."),
2635 // "Standard cal configuration"
2636  fcFlybyFlag ("FlybyFlag", NC_SHORT, false, QList<int>() << SD_NumStn << 7,
2637  "FCL FLGS", "Standard flcal configuration"),
2638  fcStatCalName ("StatCalList", NC_CHAR, true, QList<int>() << SD_Any << 8,
2639  "CAL LIST", "Station depedendent calibrations (Cable, Phase, etc?)"),
2640  fcFlybyName ("FlybyList", NC_CHAR, false, QList<int>() << SD_Any << 8,
2641  "FCL LIST", "Key to the standard flcal config"),
2642  fcCalStationName ("StatCalStationList", NC_CHAR, true, QList<int>() << SD_NumStn << 8,
2643  "CALSITES", "List of sites for standard cal"),
2644  fcObsCalName ("ObsCalList", NC_CHAR, false, QList<int>() << SD_Any << 8,
2645  "OBCLLIST", "Available obs dependent calibrations (poletide, earthdide, ?)"),
2646  fcClockBreakFlag ("ClockBreakFlag", NC_SHORT, true, QList<int>() << SD_Any,
2647  "BRK_FLAG", "Batchmode clock break flags"),
2648  fcClockBreakStatus ("CLKBREAK", NC_CHAR, false, QList<int>() << 2,
2649  "CLKBREAK", "Status of clock break existence"),
2650  fcClockBreakNumber ("BRK_NUMB", NC_SHORT, false, QList<int>() << 1,
2651  "BRK_NUMB", "Number of batchmode clock breaks"),
2652  fcClockBreakSite ("ClockBreakStationList",
2653  NC_CHAR, true, QList<int>(),
2654  "BRK_SNAM", "Batchmode clock break stations"),
2655  fcClockBreakEpoch ("ClockBreakEpoch", NC_DOUBLE, true, QList<int>() << SD_Any,
2656  "BRK_EPOC", "Batchmode clock break epochs")
2657 
2658 
2659  ;
2660 
2661 
2662 
2663 
2664 
2665 
2666 // netCDF files:
2668 // fcfTimeUTC = QList<SgVgosDb::FmtChkVar*>() << &fcSecond << &fcYmdhm << &fcUtc4,
2674  //
2675 // fcfEdit = QList<SgVgosDb::FmtChkVar*>() << &fcDelayFlag << &fcRateFlag << &fcPhaseFlag
2676 // << &fcUserSup,
2677  *fcfEdit = NULL,
2679  << &fcUserSup,
2682  //
2687  << &fcAtmRateSite,
2689  << &fcClockRateName,
2694 // << &fcSrcSelectionName << &fcBlnSelectionName,
2701  << &fcStatCalName << &fcFlybyName
2705  << &fcClockBreakEpoch
2706 
2707  ;
2708 /*=====================================================================================================*/
2709 
@ SD_NumChans
Definition: SgIoDriver.h:55
@ SD_NumStn
Definition: SgIoDriver.h:58
@ SD_2NumChans
Definition: SgIoDriver.h:59
@ SD_NumObs
Definition: SgIoDriver.h:53
@ SD_NumScans
Definition: SgIoDriver.h:54
@ SD_NumStnPts
Definition: SgIoDriver.h:56
@ SD_Any
Definition: SgIoDriver.h:62
@ SD_NumSrc
Definition: SgIoDriver.h:57
SgLogger * logger
Definition: SgLogger.cpp:231
const SgMJD tZero(1957, 10, 4)
const SgNcdfDimension dUnity(dimensionUnityName, dimensionUnityValue, -1)
SgVgosDb::FmtChkVar fcSrcSelectionName("SourceSelectionName", NC_CHAR, false, QList< int >()<< SD_NumSrc<< 8, "--NEW-- ", "Source names for Source selection array")
SgVgosDb::FmtChkVar fcEccentricityVector("EccentricityVector", NC_DOUBLE, false, QList< int >()<< SD_NumStn<< 3, "ECCCOORD", "Eccentricity taken from eccentricity file.", "Meter")
SgVgosDb::FmtChkVar fcFlybyName("FlybyList", NC_CHAR, false, QList< int >()<< SD_Any<< 8, "FCL LIST", "Key to the standard flcal config")
SgVgosDb::FmtChkVar fcClockInterval("ClockInterval", NC_DOUBLE, false, QList< int >()<< SD_Any, "CLK_INTV", "Batchmode clock interval - hours")
SgVgosDb::FmtChkVar fcBlnSelectionName("BaselineSelectionName", NC_CHAR, false, QList< int >()<< SD_NumStn<< 8, "--NEW-- ", "Station names for Baseline selection array")
QList< SgVgosDb::FmtChkVar * > fcfBlnClockSetup
Definition: SgVgosDb.cpp:2695
QList< SgVgosDb::FmtChkVar * > fcfEdit_v1002
Definition: SgVgosDb.cpp:2680
QList< SgVgosDb::FmtChkVar * > fcfErpSetup
Definition: SgVgosDb.cpp:2690
SgVgosDb::FmtChkVar fcClockBreakFlag("ClockBreakFlag", NC_SHORT, true, QList< int >()<< SD_Any, "BRK_FLAG", "Batchmode clock break flags")
SgVgosDb::FmtChkVar fcPhaseFlag("PhaseFlag", NC_SHORT, false, QList< int >()<< SD_NumObs, "PHSUFLAG", "")
QList< SgVgosDb::FmtChkVar * > fcfEdit_v1001
Definition: SgVgosDb.cpp:2678
QList< SgVgosDb::FmtChkVar * > fcfNumGroupAmbig
Definition: SgVgosDb.cpp:2683
QList< SgVgosDb::FmtChkVar * > fcfCalSlantPathIonoGroup
Definition: SgVgosDb.cpp:2671
QList< SgVgosDb::FmtChkVar * > fcfSelectionStatus
Definition: SgVgosDb.cpp:2693
QList< SgVgosDb::FmtChkVar * > fcfIonoBits
Definition: SgVgosDb.cpp:2673
SgVgosDb::FmtChkVar fcClockRateName("ClockRateConstraintStationList", NC_CHAR, false, QList< int >()<< SD_Any<< 8, "CC_SITES", "Site list for clocks constraints")
SgVgosDb::FmtChkVar fcStatCalFlag("StatCalFlag", NC_SHORT, true, QList< int >()<< SD_NumStn, "CAL FLGS", "Bit set indicate that calibration is recommended.")
SgVgosDb::FmtChkVar fcSecond("Second", NC_DOUBLE, true, QList< int >()<< SD_Any, "SEC TAG ", "Seconds part of UTC TAG.........", "second")
SgVgosDb::FmtChkVar fcGroupBLWeights("GroupBLWeights", NC_DOUBLE, true, QList< int >()<< 2<< SD_Any, "ERROR K ", "Group delay and rate re-weighting constants.")
SgVgosDb::FmtChkVar fcEccentricityName("EccentricityStationList", NC_CHAR, true, QList< int >()<< SD_NumStn<< 8, "--NEW-- ", "Station name of the corresponding eccentricity")
QList< SgVgosDb::FmtChkVar * > * fcfEdit
Definition: SgVgosDb.cpp:2677
SgVgosDb::FmtChkVar fcObsCalFlag("ObsCalFlag", NC_SHORT, false, QList< int >()<< 1, "OBCLFLGS", "Bit set indicate that calibration is recommended.")
SgVgosDb::FmtChkVar fcEccentricityMonument("EccentricityMonument", NC_CHAR, false, QList< int >()<< SD_NumStn<< 10, "ECCNAMES", "Eccentricity monument name")
SgVgosDb::FmtChkVar fcIonoSolveFlag("IonoSolveFlag", NC_SHORT, true, QList< int >()<< SD_NumStn, "", "Bit flag indicating station has iono correction")
SgVgosDb::FmtChkVar fcYmdhm("YMDHM", NC_SHORT, true, QList< int >()<< SD_Any<< 5, "UTC TAG ", "Epoch UTC YMDHM.................")
SgVgosDb::FmtChkVar fcBaselineClock("BaselineClock", NC_CHAR, true, QList< int >()<< SD_Any<< 2<< 8, "BLDEPCKS", "Bl-dependent clock list")
QList< SgVgosDb::FmtChkVar * > fcfClockSetup
Definition: SgVgosDb.cpp:2688
SgVgosDb::FmtChkVar fcClockBreakNumber("BRK_NUMB", NC_SHORT, false, QList< int >()<< 1, "BRK_NUMB", "Number of batchmode clock breaks")
QList< SgVgosDb::FmtChkVar * > fcfNumPhaseAmbig
Definition: SgVgosDb.cpp:2685
SgVgosDb::FmtChkVar fcAtmRateConstraint("AtmRateConstraint", NC_DOUBLE, true, QList< int >()<< SD_Any, "ATM_CNST", "Atmosphere constraint. ps/hr")
SgVgosDb::FmtChkVar fcSrcSelectionFlag("SourceSelectionFlag", NC_SHORT, true, QList< int >()<< SD_NumSrc, "SOURSTAT", "Source selection status bit-mapped array.")
SgVgosDb::FmtChkVar fcCalStationName("StatCalStationList", NC_CHAR, true, QList< int >()<< SD_NumStn<< 8, "CALSITES", "List of sites for standard cal")
QList< SgVgosDb::FmtChkVar * > fcfNumGroupAmbigE
Definition: SgVgosDb.cpp:2684
QList< SgVgosDb::FmtChkVar * > fcfClockBreak
Definition: SgVgosDb.cpp:2703
SgVgosDb::FmtChkVar fcRateFlag("RateFlag", NC_SHORT, true, QList< int >()<< SD_NumObs, "RATUFLAG", "Delay rate unweight flag........")
QList< SgVgosDb::FmtChkVar * > fcfCalibrationSetup
Definition: SgVgosDb.cpp:2700
QList< SgVgosDb::FmtChkVar * > fcfIonoSetup
Definition: SgVgosDb.cpp:2691
QList< SgVgosDb::FmtChkVar * > fcfEccentricity
Definition: SgVgosDb.cpp:2696
SgVgosDb::FmtChkVar fcNumGroupAmbig("NumGroupAmbig", NC_SHORT, true, QList< int >()<< SD_NumObs, "# AMBIG ", "Number of group delay ambiguities", "", "?")
SgVgosDb::FmtChkVar fcCalIonoGroupSigma("Cal-SlantPathIonoGroupSigma", NC_DOUBLE, true, QList< int >()<< SD_NumObs<< 2, "IONRMS ", "Ion correction to sigma. sec", "second", "?")
QList< SgVgosDb::FmtChkVar * > fcfTimeUTC
Definition: SgVgosDb.cpp:2669
QList< SgVgosDb::FmtChkVar * > fcfUserSup
Definition: SgVgosDb.cpp:2681
SgVgosDb::FmtChkVar fcClockRateConstraint("ClockRateConstraint", NC_DOUBLE, true, QList< int >()<< SD_Any, "CLK_CNST", "Clock constraint-Parts in 1.e14")
SgVgosDb::FmtChkVar fcClockBreakSite("ClockBreakStationList", NC_CHAR, true, QList< int >(), "BRK_SNAM", "Batchmode clock break stations")
SgVgosDb::FmtChkVar fcGroupBLWeightName("GroupBLWeightStationList", NC_CHAR, true, QList< int >()<< SD_Any<< 2<< 8, "ERROR BL", "B.L.names for formal errors")
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 fcEccentricityType("EccentricityType", NC_CHAR, false, QList< int >()<< SD_NumStn<< 2, "ECCTYPES", "Eccentricity type: XY or NE")
SgVgosDb::FmtChkVar fcDelayFlag("DelayFlag", NC_SHORT, true, QList< int >()<< SD_NumObs, "DELUFLAG", "Delay unweight flag")
SgVgosDb::FmtChkVar fcAtmInterval("AtmInterval", NC_DOUBLE, false, QList< int >()<< SD_Any, "ATM_INTV", "Batchmode atmos interval - hours")
SgVgosDb::FmtChkVar fcUtOffsetConstraint("UT1OffsetConstraint", NC_DOUBLE, true, QList< int >()<< 1, "", "UT1 Offset Constraint")
SgVgosDb::FmtChkVar fcIonoStationList("IonoStationList", NC_CHAR, true, QList< int >()<< SD_NumStn<< 8, "", "Stations with ionocorrection")
SgVgosDb::FmtChkVar fcAtmRateSite("AtmRateStationList", NC_CHAR, false, QList< int >()<< SD_Any<< 8, "AC_SITES", "Site list for atmos constraints")
SgVgosDb::FmtChkVar fcCalIonoGroupDataFlag("Cal-SlantPathIonoGroupDataFlag", NC_SHORT, false, QList< int >()<< SD_NumObs, "", "0=OK, -1=Missing, -2=bad", "", "?")
QList< SgVgosDb::FmtChkVar * > fcfGroupBLWeights
Definition: SgVgosDb.cpp:2692
QList< SgVgosDb::FmtChkVar * > fcfAtmSetup
Definition: SgVgosDb.cpp:2686
SgVgosDb::FmtChkVar fcPmOffsetConstraint("WobOffsetConstraint", NC_DOUBLE, true, QList< int >()<< 1, "", "Polar Motion Offset Constraint")
SgVgosDb::FmtChkVar fcBlnSelectionFlag("BaselineSelectionFlag", NC_SHORT, true, QList< int >()<< SD_NumStn<< SD_NumStn, "BASLSTAT", "Baseline selection bit maped array. 1=some obs, etc.")
SgVgosDb::FmtChkVar fcClockBreakStatus("CLKBREAK", NC_CHAR, false, QList< int >()<< 2, "CLKBREAK", "Status of clock break existence")
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 fcObsCalName("ObsCalList", NC_CHAR, false, QList< int >()<< SD_Any<< 8, "OBCLLIST", "Available obs dependent calibrations (poletide, earthdide, ?)")
SgVgosDb::FmtChkVar fcClockBreakEpoch("ClockBreakEpoch", NC_DOUBLE, true, QList< int >()<< SD_Any, "BRK_EPOC", "Batchmode clock break epochs")
SgVgosDb::FmtChkVar fcFlybyFlag("FlybyFlag", NC_SHORT, false, QList< int >()<< SD_NumStn<< 7, "FCL FLGS", "Standard flcal configuration")
SgVgosDb::FmtChkVar fcStatCalName("StatCalList", NC_CHAR, true, QList< int >()<< SD_Any<< 8, "CAL LIST", "Station depedendent calibrations (Cable, Phase, etc?)")
SgVgosDb::FmtChkVar fcUserSup("UserSup", NC_SHORT, false, QList< int >()<< SD_NumObs, "UACSUP ", "User action for suppression")
QMap< QString, SgVlbiStationInfo * >::iterator StationsByName_it
const QString & getAcAbbName() const
Definition: SgIdentities.h:255
const SgIdentities * currentIdentities_
Definition: SgIoDriver.h:133
SgMJD dateOfCreation_
Definition: SgIoDriver.h:131
virtual void write(LogLevel, quint32, const QString &, bool=false)
Definition: SgLogger.cpp:88
@ IO_NCDF
Definition: SgLogger.h:66
@ IO_TXT
Definition: SgLogger.h:65
Definition: SgMJD.h:59
bool fromString(Format format, const QString &str, bool isReset=true)
Definition: SgMJD.cpp:268
@ F_YYYYMMDDHHMMSSSS
Long verbose: Fri, the 2nd of Apr, 2010; 17hr 02min 43.6400sec.
Definition: SgMJD.h:67
@ F_YYYYMonDD
Date in digits: 2010.04.02.
Definition: SgMJD.h:90
@ F_Simple
Digits: 2010/04/02 17:02:43.6.
Definition: SgMJD.h:68
@ F_Date
RFC2822 date format realized by Qt (Qt::RFC2822Date)
Definition: SgMJD.h:86
SgMJD toUtc() const
Definition: SgMJD.cpp:1230
QString toString(Format format=F_Verbose) const
Definition: SgMJD.cpp:1008
static SgMJD currentMJD()
Definition: SgMJD.cpp:119
void setNumOfElements(size_t num)
Definition: SgNetCdf.h:163
void setData(const void *, size_t)
Definition: SgNetCdf.cpp:322
void setTypeOfData(nc_type type)
Definition: SgNetCdf.h:162
void setName(const QString &str)
Definition: SgNetCdf.h:161
const QString & getName() const
Definition: SgNetCdf.h:90
nc_type getTypeOfData() const
Definition: SgNetCdf.h:222
void setId(int id)
Definition: SgNetCdf.h:241
void setName(const QString &name)
Definition: SgNetCdf.h:240
void addAttribute(const SgNcdfAttribute &)
Definition: SgNetCdf.cpp:612
void setTypeOfData(nc_type type)
Definition: SgNetCdf.h:242
void allocateData()
Definition: SgNetCdf.cpp:837
const QList< SgNcdfDimension * > & dimensions() const
Definition: SgNetCdf.h:247
void addDimension(const SgNcdfDimension &d, int idx=-1)
Definition: SgNetCdf.h:259
const QString & getName() const
Definition: SgNetCdf.h:220
SgNcdfVariable * lookupVar(const QString &name) const
Definition: SgNetCdf.h:395
void registerVariable(SgNcdfVariable *, bool is4Service=false)
Definition: SgNetCdf.cpp:1317
const QString & getFileName() const
Definition: SgNetCdf.h:497
OperationMode
Definition: SgNetCdf.h:323
@ OM_REGULAR
Definition: SgNetCdf.h:324
const QString & getKey() const
Definition: SgObjectInfo.h:319
QString subDir_
Definition: SgVgosDb.h:158
QString stdSubDir_
Definition: SgVgosDb.h:160
QString kind_
Definition: SgVgosDb.h:152
QString band_
Definition: SgVgosDb.h:151
bool isEmpty() const
Definition: SgVgosDb.cpp:159
void parseString(const QString &)
Definition: SgVgosDb.cpp:122
int getVersion() const
Definition: SgVgosDb.h:96
bool have2adjustPermissions_
Definition: SgVgosDb.h:162
QString type_
Definition: SgVgosDb.h:150
QString currentInstitution_
Definition: SgVgosDb.h:156
QString stdStub_
Definition: SgVgosDb.h:155
QString compositeName() const
Definition: SgVgosDb.cpp:103
QString name4export(const QString &rootDir, SgNetCdf::OperationMode om, const QString &aBand="")
Definition: SgVgosDb.cpp:167
static const QString className()
Definition: SgVgosDb.cpp:55
void setSubDir(const QString &str)
Definition: SgVgosDb.h:109
void setFileName4Output(const QString &str)
Definition: SgVgosDb.h:111
const QString & getStub() const
Definition: SgVgosDb.h:93
void setFileName(const QString &str)
Definition: SgVgosDb.h:110
QString fileName4Output_
Definition: SgVgosDb.h:161
QString institution_
Definition: SgVgosDb.h:153
QString stub_
Definition: SgVgosDb.h:149
SgVdbVariable(const QString &stdStub, const QString &stdSubDir)
Definition: SgVgosDb.cpp:63
const QString & attDefinition() const
Definition: SgVgosDb.h:219
bool have2hideLCode() const
Definition: SgVgosDb.h:216
const QList< int > & dims() const
Definition: SgVgosDb.h:217
const QString & name() const
Definition: SgVgosDb.h:213
nc_type typeOfData() const
Definition: SgVgosDb.h:214
const QString & attLCode() const
Definition: SgVgosDb.h:218
const QString & attUnits() const
Definition: SgVgosDb.h:220
const QString & attBand() const
Definition: SgVgosDb.h:221
bool isMandatory() const
Definition: SgVgosDb.h:215
double outputFormatVersion_
Definition: SgVgosDb.h:1412
SgVdbVariable vDiffTec_
Definition: SgVgosDb.h:1486
int parseSessionBlock(QTextStream &)
Definition: SgVgosDb.cpp:959
SgVdbVariable vCal_EarthTide_
Definition: SgVgosDb.h:1491
SgVdbVariable vErpApriori_
Definition: SgVgosDb.h:1466
SgVdbVariable vClockBreak_
Definition: SgVgosDb.h:1435
SgVdbVariable vSourceCrossRef_
Definition: SgVgosDb.h:1451
SgVdbVariable vNutationNro_
Definition: SgVgosDb.h:1470
void makeWorkAround4KnownBugs()
Definition: SgVgosDb.cpp:2429
int parseStationBlock(QTextStream &, const QString &)
Definition: SgVgosDb.cpp:1092
virtual ~SgVgosDb()
Definition: SgVgosDb.cpp:525
static const QString className()
Definition: SgVgosDb.cpp:251
SgVdbVariable vClockApriori_
Definition: SgVgosDb.h:1445
SgVdbVariable vCal_Wobble_
Definition: SgVgosDb.h:1501
SgVdbVariable vPart_Erp_
Definition: SgVgosDb.h:1522
bool setupFormat(const QList< FmtChkVar * > &, SgNetCdf &, const QString &stationKey=QString(""), const QString &bandKey=QString(""))
Definition: SgVgosDb.cpp:2350
SgVdbVariable vStationApriori_
Definition: SgVgosDb.h:1443
bool checkFormat(const QList< FmtChkVar * > &, const SgNetCdf &, bool ok2fail=false)
Definition: SgVgosDb.cpp:2173
SgVdbVariable vPart_NutationNro_
Definition: SgVgosDb.h:1524
SgVdbVariable vEccentricity_
Definition: SgVgosDb.h:1447
double inputFormatVersion_
Definition: SgVgosDb.h:1410
void dump2stdout()
Definition: SgVgosDb.cpp:1976
SgVdbVariable vSource_
Definition: SgVgosDb.h:1480
SgVdbVariable vBaseline_
Definition: SgVgosDb.h:1479
QList< SgVdbVariable * > activeVars_
Definition: SgVgosDb.h:1402
@ CT_VLBA
Definition: SgVgosDb.h:190
@ CT_Difx
Definition: SgVgosDb.h:196
@ CT_GSI
Definition: SgVgosDb.h:192
@ CT_Mk3
Definition: SgVgosDb.h:189
@ CT_Mk4
Definition: SgVgosDb.h:194
@ CT_Unknown
Definition: SgVgosDb.h:188
@ CT_Haystack
Definition: SgVgosDb.h:195
@ CT_CRL
Definition: SgVgosDb.h:191
SgVdbVariable vNutationEqx_
Definition: SgVgosDb.h:1469
QMap< QString, StationDescriptor > stnDescriptorByKey_
Definition: SgVgosDb.h:1457
SgVdbVariable vCal_PoleTideOldRestore_
Definition: SgVgosDb.h:1499
SgNetCdf::OperationMode operationMode_
Definition: SgVgosDb.h:1543
SgVdbVariable vCal_BendSun_
Definition: SgVgosDb.h:1489
SgVdbVariable vPart_Parallax_
Definition: SgVgosDb.h:1525
SgMJD lastModified_
Definition: SgVgosDb.h:1422
bool isNewFile_
Definition: SgVgosDb.h:1393
SgVdbVariable vHead_
Definition: SgVgosDb.h:1431
void collectStationNames()
Definition: SgVgosDb.cpp:1853
int currentVersion_
Definition: SgVgosDb.h:1421
SgVgosDb(SgIdentities *ids, SgVersion *driverVersion)
Definition: SgVgosDb.cpp:416
SgMJD outputFormatEpoch_
Definition: SgVgosDb.h:1413
int parseScanBlock(QTextStream &)
Definition: SgVgosDb.cpp:1212
CorrelatorType correlatorType_
Definition: SgVgosDb.h:1403
SgVdbVariable vPart_PoleTide_
Definition: SgVgosDb.h:1526
bool loadStationName(const QString &stnKey)
QString wrapperFileName_
Definition: SgVgosDb.h:1407
SgMJD inputFormatEpoch_
Definition: SgVgosDb.h:1411
bool have2adjustPermissions_
Definition: SgVgosDb.h:1394
void setSessionName(const QString &name)
Definition: SgVgosDb.h:314
SgVdbVariable vCal_BendSunHigher_
Definition: SgVgosDb.h:1490
SgVdbVariable vPart_Precession_
Definition: SgVgosDb.h:1527
QList< HistoryDescriptor > historyDescriptors_
Definition: SgVgosDb.h:1419
void setSessionCode(const QString &code)
Definition: SgVgosDb.h:310
HistoryDescriptor localHistory_
Definition: SgVgosDb.h:1420
SgVdbVariable vPart_Xyz_
Definition: SgVgosDb.h:1529
SgVdbVariable vGroupBLWeights_
Definition: SgVgosDb.h:1434
QList< SgVdbVariable * > vdbVariables_
Definition: SgVgosDb.h:1542
int numOfChan_
Definition: SgVgosDb.h:1399
int numOfStn_
Definition: SgVgosDb.h:1400
bool isValidNcFiles()
Definition: SgVgosDb.cpp:1965
SgVdbVariable vCal_HiFreqLibration_
Definition: SgVgosDb.h:1503
SgVdbVariable vObsCrossRef_
Definition: SgVgosDb.h:1510
SgVdbVariable vEdit_
Definition: SgVgosDb.h:1506
QString corrTypeId_
Definition: SgVgosDb.h:1408
SgVdbVariable vAntennaApriori_
Definition: SgVgosDb.h:1446
QString sessionName_
Definition: SgVgosDb.h:1430
SgVdbVariable vScanTimeUTC_
Definition: SgVgosDb.h:1464
SgVdbVariable vCal_OceanLoad_
Definition: SgVgosDb.h:1494
bool isValidNcFile(const QString &)
Definition: SgVgosDb.cpp:1935
SgVdbVariable vNutationEqx_kWahr_
Definition: SgVgosDb.h:1468
SgVdbVariable vPart_Bend_
Definition: SgVgosDb.h:1520
virtual const QList< QString > listOfInputFiles() const
Definition: SgVgosDb.cpp:2519
SgVdbVariable vStationCrossRef_
Definition: SgVgosDb.h:1450
SgVdbVariable vMiscFourFit_
Definition: SgVgosDb.h:1438
SgVdbVariable vCal_HfErp_
Definition: SgVgosDb.h:1493
SgVdbVariable vMiscCable_
Definition: SgVgosDb.h:1439
SgVdbVariable vCal_PoleTide_
Definition: SgVgosDb.h:1498
QMap< QString, StationDescriptor * > stnDescriptorByName_
Definition: SgVgosDb.h:1459
SgVdbVariable vCal_OceanPoleTideLoad_
Definition: SgVgosDb.h:1496
bool init(const QString path, const QString fileName)
Definition: SgVgosDb.cpp:538
QString sessionCode_
Definition: SgVgosDb.h:1429
QMap< QString, ProgramGenericDescriptor > progDescriptorByName_
Definition: SgVgosDb.h:1539
int parseVersionBlock(QTextStream &, const QString &)
Definition: SgVgosDb.cpp:794
QMap< QString, BandData > bandDataByName_
Definition: SgVgosDb.h:1483
SgVdbVariable vCal_Bend_
Definition: SgVgosDb.h:1488
void parseBandKey(const QString &str, QString &key)
Definition: SgVgosDb.cpp:1283
SgVdbVariable vCal_FeedCorrection_
Definition: SgVgosDb.h:1492
int parseHistoryProcessSubBlock(QTextStream &, const QString &)
Definition: SgVgosDb.cpp:868
SgVdbVariable vCal_HfLibration_
Definition: SgVgosDb.h:1502
int procNcStringSpec(const QString &str, const QString &subDir, SgVdbVariable &destination)
Definition: SgVgosDb.cpp:1909
SgVdbVariable vPart_NutationEqx_
Definition: SgVgosDb.h:1523
int parseHistoryBlock(QTextStream &)
Definition: SgVgosDb.cpp:831
SgVdbVariable vLeapSecond_
Definition: SgVgosDb.h:1436
int parseProgramBlock(QTextStream &, const QString &)
Definition: SgVgosDb.cpp:1671
QList< SgVdbVariable * > obsUserCorrections_
Definition: SgVgosDb.h:1533
QString outputFormatId_
Definition: SgVgosDb.h:1414
SgVdbVariable vPart_Gamma_
Definition: SgVgosDb.h:1521
SgVdbVariable vSourceApriori_
Definition: SgVgosDb.h:1444
ProgramSolveDescriptor progSolveDescriptor_
Definition: SgVgosDb.h:1537
SgVdbVariable vFeedRotNet_
Definition: SgVgosDb.h:1513
SgVdbVariable vRateTheoretical_
Definition: SgVgosDb.h:1517
int numOfObs_
Definition: SgVgosDb.h:1397
bool have2redoLeapSecond_
Definition: SgVgosDb.h:1437
SgVdbVariable vCal_OceanLoadOld_
Definition: SgVgosDb.h:1495
SgVdbVariable vScanName_
Definition: SgVgosDb.h:1465
int numOfSrc_
Definition: SgVgosDb.h:1401
SgVdbVariable vRot_CF2J2K_
Definition: SgVgosDb.h:1471
QString path2RootDir_
Definition: SgVgosDb.h:1406
SgVdbVariable vEphemeris_
Definition: SgVgosDb.h:1467
SgVdbVariable vObservationTimeUTC_
Definition: SgVgosDb.h:1478
int numOfScans_
Definition: SgVgosDb.h:1398
int parseObservationBlock(QTextStream &)
Definition: SgVgosDb.cpp:1295
int guessDimVal(const QString &, int d, const QString &auxKey)
Definition: SgVgosDb.cpp:2310
SgVdbVariable vPart_RaDec_
Definition: SgVgosDb.h:1528
int procNcString(const QString &str, const QString &subDir, SgVdbVariable &destination)
Definition: SgVgosDb.cpp:1883
const QString guessDimName(const QString &varName, int len)
Definition: SgVgosDb.cpp:2270
SgVdbVariable vCorrRootFile_
Definition: SgVgosDb.h:1472
SgVdbVariable vCal_TiltRemover_
Definition: SgVgosDb.h:1500
SgVdbVariable vNGSQualityFlag_
Definition: SgVgosDb.h:1507
SgVdbVariable vCal_Parallax_
Definition: SgVgosDb.h:1497
SgVdbVariable vDelayTheoretical_
Definition: SgVgosDb.h:1516
const QString & getScanId() const
const QString & getName() const
@ 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);
OriginType getOriginType() const
const QString & getSessionCode() const
QMap< QString, SgVlbiBand * > & bandByKey()
QMap< QString, SgVlbiStationInfo * > & stationsByName()
QList< SgVlbiObservation * > & observations()
QMap< QString, SgVlbiSourceInfo * > & sourcesByName()
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
SgVersion * driverVersion
Definition: l2aVersion.cpp:31
SgVdbVariable vEffFreq_
Definition: SgVgosDb.h:1372
SgVdbVariable vCal_SlantPathIonoGroup_
Definition: SgVgosDb.h:1373
SgVdbVariable vGroupDelayFull_
Definition: SgVgosDb.h:1380
SgVdbVariable vDelayDataFlag_
Definition: SgVgosDb.h:1366
SgVdbVariable vCorrelation_
Definition: SgVgosDb.h:1361
SgVdbVariable vEffFreq_EqWt_
Definition: SgVgosDb.h:1371
SgVdbVariable vPhaseDelayFull_
Definition: SgVgosDb.h:1369
SgVdbVariable vCal_FeedCorrection_
Definition: SgVgosDb.h:1375
SgVdbVariable vGroupDelay_
Definition: SgVgosDb.h:1364
SgVdbVariable vSBDelay_
Definition: SgVgosDb.h:1363
SgVdbVariable vChannelInfo_
Definition: SgVgosDb.h:1354
SgVdbVariable vGroupRate_
Definition: SgVgosDb.h:1365
SgVdbVariable vSNR_
Definition: SgVgosDb.h:1360
SgVdbVariable vPhase_
Definition: SgVgosDb.h:1362
SgVdbVariable vNumPhaseAmbig_
Definition: SgVgosDb.h:1379
SgVdbVariable vDataFlag_
Definition: SgVgosDb.h:1367
SgVdbVariable vRefFreq_
Definition: SgVgosDb.h:1358
SgVdbVariable vCal_Unphase_
Definition: SgVgosDb.h:1376
SgVdbVariable vNumGroupAmbig_
Definition: SgVgosDb.h:1378
SgVdbVariable vUVFperAsec_
Definition: SgVgosDb.h:1370
SgVdbVariable vCorrInfo_
Definition: SgVgosDb.h:1356
SgVdbVariable vMiscFourFit_
Definition: SgVgosDb.h:1382
SgVdbVariable vPhaseCalInfo_
Definition: SgVgosDb.h:1355
SgVdbVariable vAmbigSize_
Definition: SgVgosDb.h:1359
SgVdbVariable vQualityCode_
Definition: SgVgosDb.h:1357
QList< SgVdbVariable * > vdbVars_
Definition: SgVgosDb.h:1346
SgVdbVariable vBaselineClockSetup_
Definition: SgVgosDb.h:1337
SgVdbVariable vRefClockOffset_
Definition: SgVgosDb.h:1302
SgVdbVariable vCal_SlantPathTropWet_
Definition: SgVgosDb.h:1293
SgVdbVariable vCal_SlantPathTropDry_
Definition: SgVgosDb.h:1292
SgVdbVariable vPart_HorizonGrad_
Definition: SgVgosDb.h:1299
SgVdbVariable vPart_ZenithPathTropDry_
Definition: SgVgosDb.h:1297
SgVdbVariable vCal_Cable_
Definition: SgVgosDb.h:1289
SgVdbVariable vCal_CblCorrections_
Definition: SgVgosDb.h:1291
SgVdbVariable vFeedRotation_
Definition: SgVgosDb.h:1287
SgVdbVariable vCal_AxisOffset_
Definition: SgVgosDb.h:1288
SgVdbVariable vPart_AxisOffset_
Definition: SgVgosDb.h:1296
SgVdbVariable vDis_OceanLoad_
Definition: SgVgosDb.h:1300
SgVdbVariable vCal_OceanLoad_
Definition: SgVgosDb.h:1294
SgVdbVariable vPart_ZenithPathTropWet_
Definition: SgVgosDb.h:1298
SgVdbVariable vCal_CableCorrections_
Definition: SgVgosDb.h:1290