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