29 #include <QtCore/QDateTime>
30 #include <QtCore/QDir>
31 #include <QtCore/QFile>
32 #include <QtCore/QFileInfo>
33 #include <QtCore/QRegExp>
34 #include <QtCore/QTextStream>
57 return "SgVdbVariable";
70 currentInstitution_(
""),
73 stdSubDir_(stdSubDir),
88 institution_(v.getInstitution()),
90 currentInstitution_(v.getCurrentInstitution()),
91 subDir_(v.getSubDir()),
92 fileName_(v.getFileName()),
93 stdSubDir_(v.stdSubDir_),
94 fileName4Output_(v.fileName4Output_)
115 str +=
"_V" + QString(
"").sprintf(
"%03d",
version_);
124 QStringList fields=str.split(
"_");
128 "::parseString(): the list of fields is empty, the string: [" + str +
"]");
131 stub_ = fields.at(0);
132 for (
int i=1; i<fields.size(); i++)
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))
142 else if (fields.at(i).left(1).contains(
"v", Qt::CaseInsensitive))
145 version_ = fields.at(i).mid(1).toInt(&isOk);
148 "::parseString(): cannot convert version to int: [" + fields.at(i).mid(1) +
"]");
152 "::parseString(): unparsed part of the name: [" + fields.at(i) +
"]");
161 return stub_.isEmpty();
168 const QString& aBand)
184 else if (aBand.size())
190 QString path2file(rootDir), baseStr(str), actualSubDir(
subDir_);
191 if (!actualSubDir.size())
196 if (actualSubDir.size())
199 path2file +=
"/" + actualSubDir;
210 if (!dir.mkpath(path2file))
212 "::name4export(): cannot create a path to the directory \"" + path2file +
"\"");
216 "::name4export(): a directory \"" + path2file +
"\" has been created");
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 +
"\"");
229 while (QFile(path2file + str +
".nc").exists() && n<1000000)
230 str.sprintf(
"%s_V%03d", qPrintable(baseStr), ++n);
262 vTimeUTC_(
"TimeUTC",
""),
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",
""),
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_);
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_);
310 epochOfCreation_(
tZero),
312 defaultDir_(
"History"),
313 historyFileName_(
""),
314 inputWrapperFileName_(
""),
333 programName_(
"Solve"),
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"),
345 vScanTimeMJD_(
"ScanTimeMJD",
"Solve"),
347 vIonoBits_(
"IonoBits",
"Solve"),
348 vFractC_(
"FractC",
"Solve"),
349 vUnPhaseCalFlag_(
"UnPhaseCalFlag",
"Solve"),
350 vUserSup_(
"UserSup",
"Solve"),
364 for (
int i=0; i<vdbVars_.size(); i++)
365 if (!vdbVars_.at(i)->isEmpty())
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"),
392 vPhaseDelayFull_ (
"PhaseDelayFull",
"ObsEdit"),
393 vUVFperAsec_ (
"UVFperAsec",
"ObsDerived"),
394 vEffFreq_EqWt_ (
"EffFreq_kEqWt",
"ObsDerived"),
395 vEffFreq_ (
"EffFreq",
"ObsDerived"),
396 vCal_SlantPathIonoGroup_(
"Cal-SlantPathIonoGroup",
"ObsDerived"),
399 vCal_Unphase_ (
"Cal-Unphase",
"ObsCalTheo"),
401 vNumGroupAmbig_ (
"NumGroupAmbig",
"ObsEdit"),
402 vNumPhaseAmbig_ (
"NumPhaseAmbig",
"ObsEdit"),
403 vGroupDelayFull_ (
"GroupDelayFull",
"ObsEdit"),
543 "::init(): the wrapper file [" + f.fileName() +
"] does not exist");
547 int numOfParsedStrings;
548 bool isHistoryBlockParsed, isSessionBlockParsed,
549 isScanBlockParsed, isObservationBlockParsed;
550 isHistoryBlockParsed = isSessionBlockParsed = isScanBlockParsed = isObservationBlockParsed =
false;
551 numOfParsedStrings = 0;
555 if (f.open(QFile::ReadOnly))
561 if (str.size()>0 && str.at(0) !=
'!' && str.at(0) !=
'#')
563 if (numOfParsedStrings==0 && str.contains(
"VERSION", Qt::CaseInsensitive))
570 "::init(): the input wrapper file contains a version (" +
588 else if (!isHistoryBlockParsed && str.contains(
"Begin History", Qt::CaseInsensitive))
591 isHistoryBlockParsed =
true;
593 else if (!isSessionBlockParsed && str.contains(
"Begin Session", Qt::CaseInsensitive))
596 isSessionBlockParsed =
true;
598 else if (str.contains(
"Begin Station", Qt::CaseInsensitive))
602 else if (!isScanBlockParsed && str.contains(
"Begin Scan", Qt::CaseInsensitive))
605 isScanBlockParsed =
true;
607 else if (!isObservationBlockParsed && str.contains(
"Begin Observation", Qt::CaseInsensitive))
610 isObservationBlockParsed =
true;
612 else if (str.contains(
"Begin Program", Qt::CaseInsensitive))
619 "::init(): got an unexpected string in the wrapper file: [" + str +
621 numOfParsedStrings++;
629 QDateTime dateTime(fi.created());
631 dateTime.time().hour(), dateTime.time().minute(),
632 dateTime.time().second()+dateTime.time().msec()*0.001);
637 "::init(): cannot open the wrapper file [" + f.fileName() +
"] for read access");
642 "::init(): parsed " + QString(
"").setNum(numOfParsedStrings) +
643 " strings from the wrapper file [" + f.fileName() +
"]");
661 "::init(): no data provided for the Quality Code on the secondary band of " +
665 "::init(): no data provided for the Ambiguity Size on the secondary band of " +
669 "::init(): no data provided for the Group Delay Rate on the secondary band of " +
679 "::init(): no data provided for the Single Band Delay on the secondary band of " +
700 QMap<QString, SgVlbiObservation*>
713 if (!obsByScan.contains(obs->
getScanId()))
738 QString key=stn->
getKey();
739 key = key.simplified();
740 key.replace(
' ',
'_');
766 for (QMap<QString, SgVlbiBand*>::iterator it=session->
bandByKey().begin();
791 QRegExp reFmtVer(
"^VERSION\\s+([+-\\.\\d]+)\\s+(\\d{4}\\w{3}\\d{2})\\s*",
792 Qt::CaseInsensitive);
794 if (reFmtVer.indexIn(str) != -1)
796 double d=reFmtVer.cap(1).toDouble(&isOk);
810 "::parseVersionBlock(): cannot get an epoch from VERSION string: [" + str +
"]");
814 "::parseVersionBlock(): cannot convert value to double from VERSION string: [" + str +
"]");
818 "::parseVersionBlock(): got an unexpected VERSION string: [" + str +
"]");
830 const QString eob(
"End History");
831 QString bosb(
"Begin Program");
835 bosb =
"Begin Process";
837 while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
840 if (str.at(0) !=
'!' && str.at(0) !=
'#' && str.size()>0)
842 if (str.contains(bosb, Qt::CaseInsensitive))
846 else if (str.contains(eob, Qt::CaseInsensitive))
851 "::parseHistoryBlock(): got an unknown string in the history block of wrapper file: [" +
867 QString eosb(
"End Program");
868 QString str, subDir(
""), key(progName);
871 eosb =
"End Process";
876 while (!str.contains(eosb, Qt::CaseInsensitive) && !s.atEnd())
879 if (str.at(0) !=
'!' && str.at(0) !=
'#' && str.size()>0)
881 if (str.contains(
"Default_Dir", Qt::CaseInsensitive))
884 subDir = str.mid(12);
888 else if (str.contains(
"RunTimeTag", Qt::CaseInsensitive))
893 str = str.mid(11).simplified();
894 if (str.endsWith(
"UTC"))
901 "::parseHistoryProcessSubBlock(): cannot get proper creation epoch: [" +
907 else if (str.contains(
"Createdby ", Qt::CaseInsensitive))
913 else if (str.contains(
"History ", Qt::CaseInsensitive))
920 else if (str.contains(
"InputWrapper ", Qt::CaseInsensitive))
926 else if (str.contains(
"Version", Qt::CaseInsensitive))
930 hd.
version_ = str.mid(8).simplified();
932 if (hd.
version_.contains(
"Mixed", Qt::CaseInsensitive))
935 else if (str.contains(eosb, Qt::CaseInsensitive))
940 "::parseHistoryProcessSubBlock(): got an unknown string in "
941 "the history block of wrapper file: [" + str +
"]; skipped");
943 std::cout <<
" Fix me: HISTORY need to add a parser for the string [" << qPrintable(str) <<
"]\n";
958 const QString eob(
"End Session");
959 QString str, subDir(
"");
960 QString bandKey(
""), bKey(
"");
962 while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
966 bKey = bandKey==
""?
"X":bandKey;
968 if (str.at(0) !=
'!' && str.at(0) !=
'#' && str.size()>0)
970 if (str.contains(
"Default_Dir", Qt::CaseInsensitive))
973 subDir = str.mid(12);
976 else if (str.contains(
"Session ", Qt::CaseInsensitive))
982 else if (str.contains(
"AltSessionId ", Qt::CaseInsensitive))
988 else if ( str.contains(
"Head", Qt::CaseInsensitive) &&
989 str.contains(
".nc", Qt::CaseInsensitive))
991 else if ( str.contains(
"GroupBLWeights", Qt::CaseInsensitive) &&
992 str.contains(
".nc", Qt::CaseInsensitive))
994 else if ( str.contains(
"ClockBreak", Qt::CaseInsensitive) &&
995 str.contains(
".nc", Qt::CaseInsensitive))
997 else if ( str.contains(
"LeapSecond", Qt::CaseInsensitive) &&
998 str.contains(
".nc", Qt::CaseInsensitive))
1000 else if ( str.contains(
"MiscFourFit", Qt::CaseInsensitive) &&
1001 str.contains(
"_b", Qt::CaseInsensitive) &&
1002 str.contains(
".nc", Qt::CaseInsensitive))
1004 else if ( str.contains(
"MiscFourFit", Qt::CaseInsensitive) &&
1005 str.contains(
".nc", Qt::CaseInsensitive))
1007 else if ( str.contains(
"MiscCable", Qt::CaseInsensitive) &&
1008 str.contains(
".nc", Qt::CaseInsensitive))
1010 else if ( str.contains(
"StationCrossRef", Qt::CaseInsensitive) &&
1011 str.contains(
".nc", Qt::CaseInsensitive))
1013 else if ( str.contains(
"BaselineClockSetup", Qt::CaseInsensitive) &&
1014 str.contains(
".nc", Qt::CaseInsensitive))
1016 else if ( str.contains(
"ClockSetup", Qt::CaseInsensitive) &&
1017 str.contains(
".nc", Qt::CaseInsensitive))
1019 else if ( str.contains(
"Station", Qt::CaseInsensitive) &&
1020 str.contains(
".nc", Qt::CaseInsensitive))
1022 else if ( str.contains(
"SourceCrossRef", Qt::CaseInsensitive) &&
1023 str.contains(
".nc", Qt::CaseInsensitive))
1025 else if ( str.contains(
"Source", Qt::CaseInsensitive) &&
1026 str.contains(
".nc", Qt::CaseInsensitive))
1028 else if ( str.contains(
"Clock", Qt::CaseInsensitive) &&
1029 str.contains(
".nc", Qt::CaseInsensitive))
1031 else if ( str.contains(
"Eccentricity", Qt::CaseInsensitive) &&
1032 str.contains(
".nc", Qt::CaseInsensitive))
1034 else if ( str.contains(
"Antenna", Qt::CaseInsensitive) &&
1035 str.contains(
".nc", Qt::CaseInsensitive))
1037 else if ( str.contains(
"CalcInfo", Qt::CaseInsensitive) &&
1038 str.contains(
".nc", Qt::CaseInsensitive))
1040 else if ( str.contains(
"CalcErp", Qt::CaseInsensitive) &&
1041 str.contains(
".nc", Qt::CaseInsensitive))
1043 else if ( str.contains(
"AtmSetup", Qt::CaseInsensitive) &&
1044 str.contains(
".nc", Qt::CaseInsensitive))
1046 else if ( str.contains(
"ErpSetup", Qt::CaseInsensitive) &&
1047 str.contains(
".nc", Qt::CaseInsensitive))
1049 else if ( str.contains(
"CalibrationSetup", Qt::CaseInsensitive) &&
1050 str.contains(
".nc", Qt::CaseInsensitive))
1052 else if ( str.contains(
"IonoSetup", Qt::CaseInsensitive) &&
1053 str.contains(
".nc", Qt::CaseInsensitive))
1055 else if ( str.contains(
"SelectionStatus", Qt::CaseInsensitive) &&
1056 str.contains(
".nc", Qt::CaseInsensitive))
1059 else if ( str.contains(
"PhaseBLWeights", Qt::CaseInsensitive))
1062 else if (str.contains(eob, Qt::CaseInsensitive))
1067 "::parseSessionBlock(): got an unexpected string in the session block of wrapper file: [" +
1068 str +
"]; skipped");
1070 std::cout <<
" Fix me: SESSION need to add a parser for the string [" << qPrintable(str) <<
"]\n";
1091 const QString eob(
"End Station");
1092 QString str, subDir(
""), key;
1103 "::parseStationBlock(): got a duplicate of the station [" + stnName +
"]; skipped");
1104 while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1113 while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1116 if (str.at(0) !=
'!' && str.at(0) !=
'#' && str.size()>0)
1118 if (str.contains(
"Default_Dir", Qt::CaseInsensitive))
1121 subDir = str.mid(12);
1124 else if ( str.contains(
"TimeUTC", Qt::CaseInsensitive) &&
1125 str.contains(
".nc", Qt::CaseInsensitive))
1127 else if ( str.contains(
"Met", Qt::CaseInsensitive) &&
1128 str.contains(
".nc", Qt::CaseInsensitive))
1130 else if ( str.contains(
"AzEl", Qt::CaseInsensitive) &&
1131 str.contains(
".nc", Qt::CaseInsensitive))
1133 else if ( str.contains(
"FeedRotation", Qt::CaseInsensitive) &&
1134 str.contains(
".nc", Qt::CaseInsensitive))
1136 else if ( str.contains(
"Cal-AxisOffset", Qt::CaseInsensitive) &&
1137 str.contains(
".nc", Qt::CaseInsensitive))
1139 else if ( str.contains(
"Cal-Cable", Qt::CaseInsensitive) &&
1140 str.contains(
".nc", Qt::CaseInsensitive))
1142 else if ( str.contains(
"Cal-SlantPathTropDry", Qt::CaseInsensitive) &&
1143 str.contains(
".nc", Qt::CaseInsensitive))
1145 else if ( str.contains(
"Cal-SlantPathTropWet", Qt::CaseInsensitive) &&
1146 str.contains(
".nc", Qt::CaseInsensitive))
1148 else if ( str.contains(
"Cal-StationOceanLoad", Qt::CaseInsensitive) &&
1149 str.contains(
".nc", Qt::CaseInsensitive))
1151 else if ( str.contains(
"Part-AxisOffset", Qt::CaseInsensitive) &&
1152 str.contains(
".nc", Qt::CaseInsensitive))
1154 else if ( str.contains(
"Part-ZenithPathTropDry", Qt::CaseInsensitive) &&
1155 str.contains(
".nc", Qt::CaseInsensitive))
1157 else if ( str.contains(
"Part-ZenithPathTropWet", Qt::CaseInsensitive) &&
1158 str.contains(
".nc", Qt::CaseInsensitive))
1160 else if ( str.contains(
"Part-HorizonGrad", Qt::CaseInsensitive) &&
1161 str.contains(
".nc", Qt::CaseInsensitive))
1163 else if ( str.contains(
"Dis-OceanLoad", Qt::CaseInsensitive) &&
1164 str.contains(
".nc", Qt::CaseInsensitive))
1167 else if ( str.contains(
"RefClockOffset", Qt::CaseInsensitive) &&
1168 str.contains(
".nc", Qt::CaseInsensitive))
1171 else if ( str.contains(
"Tsys", Qt::CaseInsensitive) &&
1172 str.contains(
".nc", Qt::CaseInsensitive))
1175 else if (str.contains(eob, Qt::CaseInsensitive))
1180 "::parseStationBlock(): got an unknown string in the station block of wrapper file: [" +
1181 str +
"]; skipped");
1183 std::cout <<
" Fix me: STATION need to add a parser for the string [" << qPrintable(str) <<
"]\n";
1204 const QString eob(
"End Scan");
1205 QString str, subDir(
"");
1207 while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1210 if (str.at(0) !=
'!' && str.at(0) !=
'#' && str.size()>0)
1212 if (str.contains(
"Default_Dir", Qt::CaseInsensitive))
1215 subDir = str.mid(12);
1219 else if ( str.contains(
"TimeUTC", Qt::CaseInsensitive) &&
1220 str.contains(
".nc", Qt::CaseInsensitive))
1222 else if ( str.contains(
"ScanName", Qt::CaseInsensitive) &&
1223 str.contains(
".nc", Qt::CaseInsensitive))
1225 else if ( str.contains(
"ERPApriori", Qt::CaseInsensitive) &&
1226 str.contains(
".nc", Qt::CaseInsensitive))
1228 else if ( str.contains(
"Ephemeris", Qt::CaseInsensitive) &&
1229 str.contains(
".nc", Qt::CaseInsensitive))
1231 else if ( str.contains(
"NutationEQX_kWahr", Qt::CaseInsensitive) &&
1232 str.contains(
".nc", Qt::CaseInsensitive))
1234 else if ( str.contains(
"NutationEQX", Qt::CaseInsensitive) &&
1235 str.contains(
".nc", Qt::CaseInsensitive))
1237 else if ( str.contains(
"NutationNRO", Qt::CaseInsensitive) &&
1238 str.contains(
".nc", Qt::CaseInsensitive))
1240 else if ( str.contains(
"Rot-CF2J2K", Qt::CaseInsensitive) &&
1241 str.contains(
".nc", Qt::CaseInsensitive))
1243 else if ( str.contains(
"CorrRootFile", Qt::CaseInsensitive) &&
1244 str.contains(
".nc", Qt::CaseInsensitive))
1247 else if ( str.contains(
"ScanTimeMJD", Qt::CaseInsensitive) &&
1248 str.contains(
".nc", Qt::CaseInsensitive))
1252 else if (str.contains(eob, Qt::CaseInsensitive))
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";
1273 QRegExp reBand(
"_b(\\w).*", Qt::CaseInsensitive);
1274 if (reBand.indexIn(str) != -1)
1275 key = reBand.cap(1);
1287 const QString eob(
"End Observation");
1288 QString str(
""), subDir(
"");
1289 QString bandKey(
""), bKey(
"");
1291 while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1295 bKey = bandKey==
""?
"X":bandKey;
1297 if (str.at(0) !=
'!' && str.at(0) !=
'#' && str.size()>0)
1299 if (str.contains(
"Default_Dir", Qt::CaseInsensitive))
1302 subDir = str.mid(12);
1305 else if ( str.contains(
"TimeUTC", Qt::CaseInsensitive) &&
1306 str.contains(
".nc", Qt::CaseInsensitive))
1308 else if ( str.contains(
"Baseline", Qt::CaseInsensitive) &&
1309 str.contains(
".nc", Qt::CaseInsensitive))
1311 else if ( str.contains(
"Source", Qt::CaseInsensitive) &&
1312 str.contains(
".nc", Qt::CaseInsensitive))
1317 else if ( str.contains(
"GroupDelayFull", Qt::CaseInsensitive) &&
1318 str.contains(
".nc", Qt::CaseInsensitive))
1320 else if ( str.contains(
"ChannelInfo", Qt::CaseInsensitive) &&
1321 str.contains(
".nc", Qt::CaseInsensitive))
1323 else if ( str.contains(
"PhaseCalInfo", Qt::CaseInsensitive) &&
1324 str.contains(
".nc", Qt::CaseInsensitive))
1326 else if ( str.contains(
"CorrInfo", Qt::CaseInsensitive) &&
1327 str.contains(
".nc", Qt::CaseInsensitive))
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))
1351 "::parseObservationBlock(): the correlator type is set to " +
1354 else if ( str.contains(
"QualityCode", Qt::CaseInsensitive) &&
1355 str.contains(
".nc", Qt::CaseInsensitive))
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))
1362 else if ( str.contains(
"EffFreq", Qt::CaseInsensitive) &&
1363 str.contains(
".nc", Qt::CaseInsensitive) &&
1364 !str.contains(
"_kDB", Qt::CaseInsensitive))
1366 if (
bandDataByName_[bandKey].vEffFreq_.isEmpty() || !str.contains(
"_kDB", Qt::CaseInsensitive))
1372 else if ( str.contains(
"RefFreq", Qt::CaseInsensitive) &&
1373 str.contains(
".nc", Qt::CaseInsensitive))
1375 else if ( str.contains(
"AmbigSize", Qt::CaseInsensitive) &&
1376 str.contains(
".nc", Qt::CaseInsensitive))
1378 else if ( str.contains(
"SNR", Qt::CaseInsensitive) &&
1379 str.contains(
".nc", Qt::CaseInsensitive))
1381 else if ( str.contains(
"Correlation", Qt::CaseInsensitive) &&
1382 str.contains(
".nc", Qt::CaseInsensitive))
1384 else if ( str.contains(
"UVFperAsec", Qt::CaseInsensitive) &&
1385 str.contains(
".nc", Qt::CaseInsensitive))
1387 else if ( str.contains(
"PhaseDelayFull", Qt::CaseInsensitive) &&
1388 str.contains(
".nc", Qt::CaseInsensitive))
1390 else if ( str.contains(
"SBDelay", Qt::CaseInsensitive) &&
1391 str.contains(
".nc", Qt::CaseInsensitive))
1393 else if ( str.contains(
"GroupDelay", Qt::CaseInsensitive) &&
1394 str.contains(
".nc", Qt::CaseInsensitive))
1396 else if ( str.contains(
"GroupRate", Qt::CaseInsensitive) &&
1397 str.contains(
".nc", Qt::CaseInsensitive))
1399 else if ( str.contains(
"DelayDataFlag", Qt::CaseInsensitive) &&
1400 str.contains(
".nc", Qt::CaseInsensitive))
1402 else if ( str.contains(
"DataFlag", Qt::CaseInsensitive) &&
1403 str.contains(
".nc", Qt::CaseInsensitive))
1406 else if ( str.contains(
"DiffTec", Qt::CaseInsensitive) &&
1407 str.contains(
".nc", Qt::CaseInsensitive))
1410 else if ( str.contains(
"Cal-BendSunHigher", Qt::CaseInsensitive) &&
1411 str.contains(
".nc", Qt::CaseInsensitive))
1413 else if ( str.contains(
"Cal-BendSun", Qt::CaseInsensitive) &&
1414 str.contains(
".nc", Qt::CaseInsensitive))
1416 else if ( str.contains(
"Cal-Bend", Qt::CaseInsensitive) &&
1417 str.contains(
".nc", Qt::CaseInsensitive))
1419 else if ( str.contains(
"Cal-EarthTide", Qt::CaseInsensitive) &&
1420 str.contains(
".nc", Qt::CaseInsensitive))
1422 else if ( str.contains(
"Cal-HiFreqERP", Qt::CaseInsensitive) &&
1423 str.contains(
".nc", Qt::CaseInsensitive))
1425 else if ( str.contains(
"Cal-OceanLoadOld", Qt::CaseInsensitive) &&
1426 str.contains(
".nc", Qt::CaseInsensitive))
1428 else if ( str.contains(
"Cal-OceanLoad", Qt::CaseInsensitive) &&
1429 str.contains(
".nc", Qt::CaseInsensitive))
1431 else if ( str.contains(
"Cal-OceanPoleTideLoad", Qt::CaseInsensitive) &&
1432 str.contains(
".nc", Qt::CaseInsensitive))
1434 else if ( str.contains(
"Cal-Parallax", Qt::CaseInsensitive) &&
1435 str.contains(
".nc", Qt::CaseInsensitive))
1437 else if ( str.contains(
"Cal-PoleTideOldRestore", Qt::CaseInsensitive) &&
1438 str.contains(
".nc", Qt::CaseInsensitive))
1440 else if ( str.contains(
"Cal-PoleTide", Qt::CaseInsensitive) &&
1441 str.contains(
".nc", Qt::CaseInsensitive))
1443 else if ( str.contains(
"Cal-TiltRemover", Qt::CaseInsensitive) &&
1444 str.contains(
".nc", Qt::CaseInsensitive))
1446 else if ( str.contains(
"Cal-FeedCorrection", Qt::CaseInsensitive) &&
1447 str.contains(
".nc", Qt::CaseInsensitive))
1454 "::parseObservationBlock(): got unbanded Feed Correction, the band key \"X\" is assumed");
1457 else if ( str.contains(
"Cal-Unphase", Qt::CaseInsensitive) &&
1458 str.contains(
".nc", Qt::CaseInsensitive))
1465 "::parseObservationBlock(): got unbanded Unphase Calibration, the band key \"X\" is assumed");
1468 else if ( str.contains(
"Cal-Wobble", Qt::CaseInsensitive) &&
1469 str.contains(
".nc", Qt::CaseInsensitive))
1471 else if ( str.contains(
"Cal-HiFreqLibration", Qt::CaseInsensitive) &&
1472 str.contains(
".nc", Qt::CaseInsensitive) &&
1473 str.contains(
"IERS2006", Qt::CaseInsensitive))
1475 else if ( str.contains(
"Cal-HiFreqLibration", Qt::CaseInsensitive) &&
1476 str.contains(
".nc", Qt::CaseInsensitive) &&
1477 str.contains(
"IERS2010", Qt::CaseInsensitive))
1480 else if ( str.contains(
"Edit", Qt::CaseInsensitive) &&
1481 str.contains(
".nc", Qt::CaseInsensitive))
1483 else if ( str.contains(
"NGSQualityFlag", Qt::CaseInsensitive) &&
1484 str.contains(
".nc", Qt::CaseInsensitive))
1486 else if ( str.contains(
"NumGroupAmbig", Qt::CaseInsensitive) &&
1487 str.contains(
".nc", Qt::CaseInsensitive))
1489 else if ( str.contains(
"NumPhaseAmbig", Qt::CaseInsensitive) &&
1490 str.contains(
".nc", Qt::CaseInsensitive))
1493 else if ( str.contains(
"ObsCrossRef", Qt::CaseInsensitive) &&
1494 str.contains(
".nc", Qt::CaseInsensitive))
1497 else if ( str.contains(
"FeedRotNet", Qt::CaseInsensitive) &&
1498 str.contains(
".nc", Qt::CaseInsensitive))
1500 else if ( str.contains(
"Cal-SlantPathIonoGroup", Qt::CaseInsensitive) &&
1501 str.contains(
".nc", Qt::CaseInsensitive))
1504 else if ( str.contains(
"DelayTheoretical", Qt::CaseInsensitive) &&
1505 str.contains(
".nc", Qt::CaseInsensitive))
1507 else if ( str.contains(
"RateTheoretical", Qt::CaseInsensitive) &&
1508 str.contains(
".nc", Qt::CaseInsensitive))
1511 else if ( str.contains(
"Part-Bend", Qt::CaseInsensitive) &&
1512 str.contains(
".nc", Qt::CaseInsensitive))
1514 else if ( str.contains(
"Part-Gamma", Qt::CaseInsensitive) &&
1515 str.contains(
".nc", Qt::CaseInsensitive))
1517 else if ( str.contains(
"Part-ERP", Qt::CaseInsensitive) &&
1518 str.contains(
".nc", Qt::CaseInsensitive))
1520 else if ( str.contains(
"Part-NutationEQX", Qt::CaseInsensitive) &&
1521 str.contains(
".nc", Qt::CaseInsensitive))
1523 else if ( str.contains(
"Part-NutationNRO", Qt::CaseInsensitive) &&
1524 str.contains(
".nc", Qt::CaseInsensitive))
1526 else if ( str.contains(
"Part-Parallax", Qt::CaseInsensitive) &&
1527 str.contains(
".nc", Qt::CaseInsensitive))
1529 else if ( str.contains(
"Part-Poletide", Qt::CaseInsensitive) &&
1530 str.contains(
".nc", Qt::CaseInsensitive))
1532 else if ( str.contains(
"Part-Precession", Qt::CaseInsensitive) &&
1533 str.contains(
".nc", Qt::CaseInsensitive))
1535 else if ( str.contains(
"Part-RaDec", Qt::CaseInsensitive) &&
1536 str.contains(
".nc", Qt::CaseInsensitive))
1538 else if ( str.contains(
"Part-XYZ", Qt::CaseInsensitive) &&
1539 str.contains(
".nc", Qt::CaseInsensitive))
1542 else if ( str.contains(
"IonoBits", Qt::CaseInsensitive) &&
1543 str.contains(
".nc", Qt::CaseInsensitive))
1545 else if ( str.contains(
"UnPhaseCalFlag", Qt::CaseInsensitive) &&
1546 str.contains(
".nc", Qt::CaseInsensitive))
1548 else if ( str.contains(
"FractC", Qt::CaseInsensitive) &&
1549 str.contains(
".nc", Qt::CaseInsensitive))
1552 else if ( str.contains(
"StructureCorrections", Qt::CaseInsensitive) &&
1553 str.contains(
".nc", Qt::CaseInsensitive))
1563 else if ( str.contains(
"Cal-SlantPathIonoPhase", Qt::CaseInsensitive))
1565 else if ( str.contains(
"NumPhaseAmbig", Qt::CaseInsensitive))
1568 else if ( str.startsWith(
"Phase", Qt::CaseInsensitive) &&
1569 str.contains(
".nc", Qt::CaseInsensitive) &&
1570 !str.contains(
"Ambig", Qt::CaseInsensitive) )
1573 else if ( str.contains(
"Unavailable", Qt::CaseInsensitive) &&
1574 str.contains(
"band", Qt::CaseInsensitive))
1576 else if ( str.contains(
"Cal-EccentricityMap", Qt::CaseInsensitive))
1579 else if (str.contains(eob, Qt::CaseInsensitive))
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";
1594 QMap<QString, BandData>::iterator
1663 const QString eob(
"End Program");
1664 QString str(
""), subDir(
""), key;
1665 key = sProgName.simplified();
1667 if (key.compare(
"Solve", Qt::CaseInsensitive) == 0)
1669 while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1673 if (str.size()>0 && str.at(0) !=
'!' && str.at(0) !=
'#')
1675 if (str.contains(
"Default_Dir", Qt::CaseInsensitive))
1676 subDir = str.mid(12);
1677 else if (str.contains(
"Begin Session", Qt::CaseInsensitive))
1679 while (!str.contains(
"End Session", Qt::CaseInsensitive) && !s.atEnd())
1682 if (str.size()>0 && str.at(0) !=
'!' && str.at(0) !=
'#')
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))
1689 else if ( str.contains(
"BaselineClockSetup", Qt::CaseInsensitive) &&
1690 str.contains(
".nc", Qt::CaseInsensitive))
1692 else if ( str.contains(
"ClockSetup", Qt::CaseInsensitive) &&
1693 str.contains(
".nc", Qt::CaseInsensitive))
1695 else if ( str.contains(
"ErpSetup", Qt::CaseInsensitive) &&
1696 str.contains(
".nc", Qt::CaseInsensitive))
1698 else if ( str.contains(
"CalibrationSetup", Qt::CaseInsensitive) &&
1699 str.contains(
".nc", Qt::CaseInsensitive))
1701 else if ( str.contains(
"IonoSetup", Qt::CaseInsensitive) &&
1702 str.contains(
".nc", Qt::CaseInsensitive))
1704 else if ( str.contains(
"CalcErp", Qt::CaseInsensitive) &&
1705 str.contains(
".nc", Qt::CaseInsensitive))
1707 else if ( str.contains(
"SelectionStatus", Qt::CaseInsensitive) &&
1708 str.contains(
".nc", Qt::CaseInsensitive))
1710 else if ( str.contains(
"CalcInfo", Qt::CaseInsensitive) &&
1711 str.contains(
".nc", Qt::CaseInsensitive))
1713 else if ( str.contains(
"End Session", Qt::CaseInsensitive) )
1718 "::parseProgramBlock(): got an unexpected string in the program block of"
1719 "wrapper file: [" + str +
"]; skipped");
1721 std::cout <<
" Fix me: PROGRAM need to add a parser for the string [" << qPrintable(str) <<
"]\n";
1726 else if (str.contains(
"Begin Station", Qt::CaseInsensitive))
1728 while (!str.contains(
"End Station", Qt::CaseInsensitive) && !s.atEnd())
1731 if (str.size()>0 && str.at(0) !=
'!' && str.at(0) !=
'#')
1738 else if (str.contains(
"Begin Scan", Qt::CaseInsensitive))
1740 while (!str.contains(
"End Scan", Qt::CaseInsensitive) && !s.atEnd())
1743 if (str.size()>0 && str.at(0) !=
'!' && str.at(0) !=
'#')
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))
1750 else if (str.contains(
"End Scan", Qt::CaseInsensitive))
1755 "::parseProgramBlock(): got an unexpected string in the program block of"
1756 "wrapper file: [" + str +
"]; skipped");
1758 std::cout <<
" Fix me: PROGRAM need to add a parser for the string [" << qPrintable(str) <<
"]\n";
1763 else if (str.contains(
"Begin Observation", Qt::CaseInsensitive))
1765 while (!str.contains(
"End Observation", Qt::CaseInsensitive) && !s.atEnd())
1768 if (str.size()>0 && str.at(0) !=
'!' && str.at(0) !=
'#')
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))
1775 else if ( str.contains(
"UnPhaseCalFlag", Qt::CaseInsensitive) &&
1776 str.contains(
".nc", Qt::CaseInsensitive))
1778 else if ( str.contains(
"FractC", Qt::CaseInsensitive) &&
1779 str.contains(
".nc", Qt::CaseInsensitive))
1781 else if ( str.contains(
"UserSup", Qt::CaseInsensitive) &&
1782 str.contains(
".nc", Qt::CaseInsensitive))
1784 else if (str.contains(
"End Observation", Qt::CaseInsensitive))
1789 "::parseProgramBlock(): got an unexpected string in the program block of"
1790 "wrapper file: [" + str +
"]; skipped");
1792 std::cout <<
" Fix me: PROGRAM need to add a parser for the string [" << qPrintable(str) <<
"]\n";
1797 else if (str.contains(eob, Qt::CaseInsensitive))
1802 "::parseProgramBlock(): got an unexpected string in the wrapper file: [" + str +
1812 "::parseProgramBlock(): got a duplicate of the Program section of [" +
1813 key +
"]; skipped");
1814 while (!str.contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1817 if (str.size()>0 && str.at(0) !=
'!' && str.at(0) !=
'#')
1829 while (!(str=s.readLine()).contains(eob, Qt::CaseInsensitive) && !s.atEnd())
1854 "::collectStationNames(): mapped the station name [" + d.
stationName_ +
1859 "::collectStationNames(): the station name [" + d.
stationName_ +
"] is already in the map");
1863 "::collectStationNames(): cannot find station name for the key [" + d.
stationKey_ +
"]");
1876 "::procNcString(): duplicate: [" + destination.
getStub() +
"] vs [" + str +
"]");
1877 std::cout <<
" Fix me: got a duplicate: was [" << qPrintable(destination.
getStub())
1878 <<
"] became [" << qPrintable(str) <<
"]\n";
1882 QString name(str.simplified());
1883 if (name.right(3).contains(
".nc", Qt::CaseInsensitive))
1884 name = name.left(name.size() - 3);
1887 destination.
setFileName(subDir.size()==0 ? str.simplified() : subDir +
"/" + str.simplified());
1902 "::procNcStringSpec(): duplicate: [" + destination.
getStub() +
"] vs [" + str +
"]");
1903 std::cout <<
" Fix me: got a duplicate: was [" << qPrintable(destination.
getStub())
1904 <<
"] became [" << qPrintable(str) <<
"]\n";
1908 QString name(str.simplified());
1909 if (name.right(3).contains(
".nc", Qt::CaseInsensitive))
1910 name = name.left(name.size() - 3);
1913 destination.
setFileName(subDir.size()==0 ? str.simplified() : subDir +
"/" + str.simplified());
1928 if ((rc=nc_open(qPrintable(fileName), 0, &ncid)) != NC_NOERR)
1930 printf(
"%s\n", nc_strerror(rc));
1934 if (isOk && (rc=nc_close(ncid)) != NC_NOERR)
1936 printf(
"%s\n", nc_strerror(rc));
1942 "::isValidNcFile(): the netCDF file " + fileName +
" looks ok");
1945 "::isValidNcFile(): got an error while staring at " + fileName);
1968 <<
"Individual variables:\n"
1969 <<
" path2RootDir_ : [" << qPrintable(
path2RootDir_) <<
"]\n"
1973 std::cout <<
"History part:\n";
1981 std::cout <<
" Process " << qPrintable(hd.
processName_) <<
"\n";
1983 <<
" processName_ : [" << qPrintable(hd.
processName_) <<
"]\n"
1985 <<
" creator_ : [" << qPrintable(hd.
creator_) <<
"]\n"
1986 <<
" defaultDir_ : [" << qPrintable(hd.
defaultDir_) <<
"]\n"
1989 <<
" version_ : [" << qPrintable(hd.
version_) <<
"]\n"
1990 <<
" isMk3Compatible_ : [" << (hd.
isMk3Compatible_?
"true":
"false") <<
"]\n"
1994 <<
" sessionCode_ : [" << qPrintable(
sessionCode_) <<
"]\n"
1995 <<
" sessionName_ : [" << qPrintable(
sessionName_) <<
"]\n"
2055 std::cout <<
" Program Solve: \n"
2057 vAtmSetup_.compositeName()) <<
"]\n"
2059 vClockSetup_.compositeName()) <<
"]\n"
2061 vErpSetup_.compositeName()) <<
"]\n"
2063 vIonoSetup_.compositeName()) <<
"]\n"
2065 vCalibrationSetup_.compositeName()) <<
"]\n"
2067 vBaselineClockSetup_.compositeName()) <<
"]\n"
2069 vCalcErp_.compositeName()) <<
"]\n"
2071 vSelectionStatus_.compositeName()) <<
"]\n"
2073 vCalcInfo_.compositeName()) <<
"]\n"
2075 vScanTimeMJD_.compositeName()) <<
"]\n"
2077 vIonoBits_.compositeName()) <<
"]\n"
2079 vUnPhaseCalFlag_.compositeName()) <<
"]\n"
2081 vFractC_.compositeName()) <<
"]\n"
2083 vUserSup_.compositeName()) <<
"]\n"
2086 std::cout <<
"\nOn per band basis:\n";
2087 QMap<QString, BandData>::iterator itt;
2091 std::cout <<
"Band \"" << qPrintable(itt.key()) <<
"\":\n";
2121 std::cout <<
"On per station basis:\n";
2122 QMap<QString, StationDescriptor>::iterator it;
2126 std::cout <<
"Station " << qPrintable(it.key()) <<
"\n";
2128 <<
" stationName : [" << qPrintable(sd.
stationName_) <<
"]\n"
2148 std::cout <<
"Registered NC files:\n";
2152 <<
" [" << qPrintable(
activeVars_.at(i)->getFileName()) <<
"]\n";
2162 for (
int i=0; i<fmt.size(); i++)
2170 "::checkFormat(): cannot find the variable \"" + fmtVar->
name() +
"\" in the file " +
2179 if (var->
getName() !=
"FRNGERR")
2182 "::checkFormat(): enexpected data type of the variable \"" + fmtVar->
name() +
"\"");
2189 if (dims.size() && dims.size() != var->
dimensions().size())
2191 for (
int j=0; j<dims.size(); 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()));
2205 "::checkFormat(): number of dimensions, " + QString(
"").setNum(var->
dimensions().size()) +
2206 ", missmatch for \"" + fmtVar->
name() +
"\", expected " + QString(
"").setNum(dims.size()));
2210 for (
int j=0; j<dims.size(); j++)
2215 if (dims.at(j) != var->
dimensions().at(j)->getN())
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()));
2231 "::checkFormat(): the special dimension numObs missmatch for [" +
2232 fmtVar->
name() +
"], expected " + QString(
"").setNum(
numOfObs_) +
" got " +
2233 QString(
"").setNum(var->
dimensions().at(j)->getN()));
2241 "::checkFormat(): the special dimension numScans missmatch for [" +
2242 fmtVar->
name() +
"], expected " + QString(
"").setNum(
numOfScans_) +
" got " +
2243 QString(
"").setNum(var->
dimensions().at(j)->getN()));
2263 str.sprintf(
"DimX%06d", len);
2273 str =
"NumChannels";
2275 str =
"NumChannels_x_2";
2277 str =
"NumStatScan";
2285 "::guessDimName(): uknown special dimension " + QString(
"").setNum(len) +
" of the var " +
2315 "::guessDimVal(): cannot find the station [" + auxKey.simplified() +
2316 "] in the container numOfObsByStn_");
2327 "::guessDimVal(): uknown special dimension " + QString(
"").setNum(d) +
" of the var " + varName);
2337 const QString& stationKey,
const QString& bandKey)
2340 for (
int i=0; i<fmt.size(); i++)
2351 for (
int j=0; j<dims.size(); j++)
2379 if ((len=fmtVar->
attUnits().size()))
2388 if ((len=fmtVar->
attBand().size()) && bandKey.size())
2394 attr->
setData(qPrintable(bandKey), len);
2403 attr->
setData(qPrintable(str), len);
2423 bool need2searchForUvf;
2424 need2searchForUvf =
true;
2426 if (!it.value().vUVFperAsec_.isEmpty())
2427 need2searchForUvf =
false;
2428 if (need2searchForUvf)
2430 bool calcProcessFound=
false;
2432 QRegExp reVersions(
"(\\d+).(\\d+).(\\d+)/(\\d+).(\\d+).(\\d+)");
2439 calcProcessFound =
true;
2440 if (reVersions.indexIn(hd.
version_) != -1)
2442 int nMaj, nMin, nTyn;
2443 nMaj = nMin = nTyn = 0;
2444 nMaj = reVersions.cap(1).toInt(&isOk);
2447 nMin = reVersions.cap(2).toInt(&isOk);
2450 nTyn = reVersions.cap(3).toInt(&isOk);
2453 SgVersion foundVersion(
"temp", nMaj, nMin, nTyn, QString(
""),
tZero);
2454 if (foundVersion <= version2correct)
2457 "::makeWorkAround4KnownBugs(): found data that could be corrected");
2466 "::makeWorkAround4KnownBugs(): checking " + bandKey +
"-band");
2467 if (QFile::exists(
path2RootDir_ +
"/ObsDerived/UVFperAsec_b" + bandKey +
".nc"))
2471 "::makeWorkAround4KnownBugs(): found a missed variable " +
2479 "::makeWorkAround4KnownBugs(): cannot convert \"" + reVersions.cap(3) +
"\" to int");
2483 "::makeWorkAround4KnownBugs(): cannot convert \"" + reVersions.cap(2) +
"\" to int");
2487 "::makeWorkAround4KnownBugs(): cannot convert \"" + reVersions.cap(1) +
"\" to int");
2491 "::makeWorkAround4KnownBugs(): the signature \"SgLib/vgosDbCalc\" has been found, but the "
2492 "version is not in the expected form: \"" + hd.
version_ +
"\"");
2507 QString path2root(
"");
2515 list << path2root +
activeVars_.at(i)->getFileName() ;
2536 "SEC TAG ",
"Seconds part of UTC TAG.........",
"second"),
2538 "UTC TAG ",
"Epoch UTC YMDHM................."),
2545 "ION CORR",
"Ion correction. Add to theo. sec",
"second",
"?"),
2548 "IONRMS ",
"Ion correction to sigma. sec",
"second",
"?"),
2551 "",
"0=OK, -1=Missing, -2=bad",
"",
"?"),
2553 "ION_BITS",
"ICORR for full ion tracking."),
2555 "DELUFLAG",
"Delay unweight flag"),
2557 "RATUFLAG",
"Delay rate unweight flag........"),
2561 "UACSUP ",
"User action for suppression"),
2563 "# AMBIG ",
"Number of group delay ambiguities",
"",
"?"),
2565 "N/A ",
"Number of group delay subambiguities (test purposes)",
"",
"?"),
2567 "#PAMBIG ",
"Number of phase delay ambiguities",
"",
"?"),
2569 "ATM_INTV",
"Batchmode atmos interval - hours"),
2571 "ATM_CNST",
"Atmosphere constraint. ps/hr"),
2573 "AC_SITES",
"Site list for atmos constraints"),
2575 "CLK_INTV",
"Batchmode clock interval - hours"),
2577 "CLK_CNST",
"Clock constraint-Parts in 1.e14"),
2580 "CC_SITES",
"Site list for clocks constraints"),
2582 "",
"Polar Motion Offset Constraint"),
2584 "",
"UT1 Offset Constraint"),
2586 "",
"Bit flag indicating station has iono correction"),
2588 "",
"Stations with ionocorrection"),
2590 "ERROR K ",
"Group delay and rate re-weighting constants."),
2593 "ERROR BL",
"B.L.names for formal errors"),
2595 "SOURSTAT",
"Source selection status bit-mapped array."),
2599 "BASLSTAT",
"Baseline selection bit maped array. 1=some obs, etc."),
2601 "--NEW-- ",
"Source names for Source selection array"),
2604 "--NEW-- ",
"Station names for Baseline selection array"),
2606 "BLDEPCKS",
"Bl-dependent clock list"),
2608 "ECCTYPES",
"Eccentricity type: XY or NE"),
2611 "--NEW-- ",
"Station name of the corresponding eccentricity"),
2613 "ECCNAMES",
"Eccentricity monument name"),
2615 "ECCCOORD",
"Eccentricity taken from eccentricity file.",
"Meter"),
2617 "OBCLFLGS",
"Bit set indicate that calibration is recommended."),
2620 "CAL FLGS",
"Bit set indicate that calibration is recommended."),
2623 "FCL FLGS",
"Standard flcal configuration"),
2625 "CAL LIST",
"Station depedendent calibrations (Cable, Phase, etc?)"),
2627 "FCL LIST",
"Key to the standard flcal config"),
2629 "CALSITES",
"List of sites for standard cal"),
2631 "OBCLLIST",
"Available obs dependent calibrations (poletide, earthdide, ?)"),
2633 "BRK_FLAG",
"Batchmode clock break flags"),
2635 "CLKBREAK",
"Status of clock break existence"),
2637 "BRK_NUMB",
"Number of batchmode clock breaks"),
2640 "BRK_SNAM",
"Batchmode clock break stations"),
2642 "BRK_EPOC",
"Batchmode clock break epochs")
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
QList< SgVgosDb::FmtChkVar * > fcfEdit_v1002
QList< SgVgosDb::FmtChkVar * > fcfErpSetup
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
QList< SgVgosDb::FmtChkVar * > fcfNumGroupAmbig
QList< SgVgosDb::FmtChkVar * > fcfCalSlantPathIonoGroup
QList< SgVgosDb::FmtChkVar * > fcfSelectionStatus
QList< SgVgosDb::FmtChkVar * > fcfIonoBits
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
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
SgVgosDb::FmtChkVar fcClockBreakNumber("BRK_NUMB", NC_SHORT, false, QList< int >()<< 1, "BRK_NUMB", "Number of batchmode clock breaks")
QList< SgVgosDb::FmtChkVar * > fcfNumPhaseAmbig
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
QList< SgVgosDb::FmtChkVar * > fcfClockBreak
SgVgosDb::FmtChkVar fcRateFlag("RateFlag", NC_SHORT, true, QList< int >()<< SD_NumObs, "RATUFLAG", "Delay rate unweight flag........")
QList< SgVgosDb::FmtChkVar * > fcfCalibrationSetup
QList< SgVgosDb::FmtChkVar * > fcfIonoSetup
QList< SgVgosDb::FmtChkVar * > fcfEccentricity
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
QList< SgVgosDb::FmtChkVar * > fcfUserSup
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
QList< SgVgosDb::FmtChkVar * > fcfAtmSetup
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
const SgIdentities * currentIdentities_
virtual void write(LogLevel, quint32, const QString &, bool=false)
bool fromString(Format format, const QString &str, bool isReset=true)
@ F_YYYYMMDDHHMMSSSS
Long verbose: Fri, the 2nd of Apr, 2010; 17hr 02min 43.6400sec.
@ F_YYYYMonDD
Date in digits: 2010.04.02.
@ F_Simple
Digits: 2010/04/02 17:02:43.6.
@ F_Date
RFC2822 date format realized by Qt (Qt::RFC2822Date)
QString toString(Format format=F_Verbose) const
static SgMJD currentMJD()
void setNumOfElements(size_t num)
void setData(const void *, size_t)
void setTypeOfData(nc_type type)
void setName(const QString &str)
const QString & getName() const
nc_type getTypeOfData() const
void setName(const QString &name)
void addAttribute(const SgNcdfAttribute &)
void setTypeOfData(nc_type type)
const QList< SgNcdfDimension * > & dimensions() const
void addDimension(const SgNcdfDimension &d, int idx=-1)
const QString & getName() const
SgNcdfVariable * lookupVar(const QString &name) const
void registerVariable(SgNcdfVariable *, bool is4Service=false)
const QString & getFileName() const
const QString & getKey() const
void parseString(const QString &)
bool have2adjustPermissions_
QString currentInstitution_
QString compositeName() const
QString name4export(const QString &rootDir, SgNetCdf::OperationMode om, const QString &aBand="")
static const QString className()
void setSubDir(const QString &str)
void setFileName4Output(const QString &str)
const QString & getStub() const
void setFileName(const QString &str)
SgVdbVariable(const QString &stdStub, const QString &stdSubDir)
const QString & attDefinition() const
bool have2hideLCode() const
const QList< int > & dims() const
const QString & name() const
nc_type typeOfData() const
const QString & attLCode() const
const QString & attUnits() const
const QString & attBand() const
double outputFormatVersion_
int parseSessionBlock(QTextStream &)
SgVdbVariable vCal_EarthTide_
SgVdbVariable vErpApriori_
SgVdbVariable vClockBreak_
SgVdbVariable vSourceCrossRef_
SgVdbVariable vNutationNro_
void makeWorkAround4KnownBugs()
int parseStationBlock(QTextStream &, const QString &)
static const QString className()
SgVdbVariable vClockApriori_
SgVdbVariable vCal_Wobble_
bool setupFormat(const QList< FmtChkVar * > &, SgNetCdf &, const QString &stationKey=QString(""), const QString &bandKey=QString(""))
SgVdbVariable vStationApriori_
bool checkFormat(const QList< FmtChkVar * > &, const SgNetCdf &, bool ok2fail=false)
SgVdbVariable vPart_NutationNro_
SgVdbVariable vEccentricity_
double inputFormatVersion_
QList< SgVdbVariable * > activeVars_
SgVdbVariable vNutationEqx_
QMap< QString, StationDescriptor > stnDescriptorByKey_
SgVdbVariable vCal_PoleTideOldRestore_
SgNetCdf::OperationMode operationMode_
SgVdbVariable vCal_BendSun_
SgVdbVariable vPart_Parallax_
void collectStationNames()
SgVgosDb(SgIdentities *ids, SgVersion *driverVersion)
int parseScanBlock(QTextStream &)
CorrelatorType correlatorType_
SgVdbVariable vPart_PoleTide_
bool loadStationName(const QString &stnKey)
bool have2adjustPermissions_
void setSessionName(const QString &name)
SgVdbVariable vCal_BendSunHigher_
SgVdbVariable vPart_Precession_
QList< HistoryDescriptor > historyDescriptors_
void setSessionCode(const QString &code)
HistoryDescriptor localHistory_
SgVdbVariable vGroupBLWeights_
QList< SgVdbVariable * > vdbVariables_
SgVdbVariable vCal_HiFreqLibration_
SgVdbVariable vObsCrossRef_
SgVdbVariable vAntennaApriori_
SgVdbVariable vScanTimeUTC_
SgVdbVariable vCal_OceanLoad_
bool isValidNcFile(const QString &)
SgVdbVariable vNutationEqx_kWahr_
SgVdbVariable vPart_Bend_
virtual const QList< QString > listOfInputFiles() const
SgVdbVariable vStationCrossRef_
SgVdbVariable vMiscFourFit_
SgVdbVariable vCal_HfErp_
SgVdbVariable vMiscCable_
SgVdbVariable vCal_PoleTide_
QMap< QString, StationDescriptor * > stnDescriptorByName_
SgVdbVariable vCal_OceanPoleTideLoad_
bool init(const QString path, const QString fileName)
QMap< QString, ProgramGenericDescriptor > progDescriptorByName_
int parseVersionBlock(QTextStream &, const QString &)
QMap< QString, BandData > bandDataByName_
void parseBandKey(const QString &str, QString &key)
SgVdbVariable vCal_FeedCorrection_
int parseHistoryProcessSubBlock(QTextStream &, const QString &)
SgVdbVariable vCal_HfLibration_
int procNcStringSpec(const QString &str, const QString &subDir, SgVdbVariable &destination)
SgVdbVariable vPart_NutationEqx_
int parseHistoryBlock(QTextStream &)
SgVdbVariable vLeapSecond_
int parseProgramBlock(QTextStream &, const QString &)
QList< SgVdbVariable * > obsUserCorrections_
SgVdbVariable vPart_Gamma_
SgVdbVariable vSourceApriori_
ProgramSolveDescriptor progSolveDescriptor_
SgVdbVariable vFeedRotNet_
SgVdbVariable vRateTheoretical_
bool have2redoLeapSecond_
SgVdbVariable vCal_OceanLoadOld_
SgVdbVariable vRot_CF2J2K_
SgVdbVariable vEphemeris_
SgVdbVariable vObservationTimeUTC_
int parseObservationBlock(QTextStream &)
int guessDimVal(const QString &, int d, const QString &auxKey)
SgVdbVariable vPart_RaDec_
int procNcString(const QString &str, const QString &subDir, SgVdbVariable &destination)
const QString guessDimName(const QString &varName, int len)
SgVdbVariable vCorrRootFile_
SgVdbVariable vCal_TiltRemover_
SgVdbVariable vNGSQualityFlag_
SgVdbVariable vCal_Parallax_
SgVdbVariable vDelayTheoretical_
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
SgVdbVariable vCal_SlantPathIonoGroup_
SgVdbVariable vGroupDelayFull_
SgVdbVariable vDelayDataFlag_
SgVdbVariable vCorrelation_
SgVdbVariable vEffFreq_EqWt_
SgVdbVariable vPhaseDelayFull_
SgVdbVariable vCal_FeedCorrection_
SgVdbVariable vGroupDelay_
SgVdbVariable vChannelInfo_
SgVdbVariable vGroupRate_
SgVdbVariable vNumPhaseAmbig_
SgVdbVariable vCal_Unphase_
SgVdbVariable vNumGroupAmbig_
SgVdbVariable vUVFperAsec_
SgVdbVariable vMiscFourFit_
SgVdbVariable vPhaseCalInfo_
SgVdbVariable vAmbigSize_
SgVdbVariable vQualityCode_
QString inputWrapperFileName_
ProgramGenericDescriptor()
QList< QString > content_
QList< SgVdbVariable * > vdbVars_
SgVdbVariable vIonoSetup_
SgVdbVariable vCalibrationSetup_
SgVdbVariable vScanTimeMJD_
SgVdbVariable vClockSetup_
SgVdbVariable vSelectionStatus_
SgVdbVariable vUnPhaseCalFlag_
bool hasSomething4output()
SgVdbVariable vBaselineClockSetup_
SgVdbVariable vRefClockOffset_
SgVdbVariable vCal_SlantPathTropWet_
SgVdbVariable vCal_SlantPathTropDry_
SgVdbVariable vPart_HorizonGrad_
SgVdbVariable vPart_ZenithPathTropDry_
SgVdbVariable vCal_Cable_
SgVdbVariable vFeedRotation_
SgVdbVariable vCal_AxisOffset_
SgVdbVariable vPart_AxisOffset_
SgVdbVariable vDis_OceanLoad_
SgVdbVariable vCal_OceanLoad_
SgVdbVariable vPart_ZenithPathTropWet_