28 #include <QtCore/QDataStream>
29 #include <QtCore/QDir>
30 #include <QtCore/QFile>
31 #include <QtCore/QRegExp>
32 #include <QtCore/QRegularExpression>
33 #include <QtCore/QStringList>
34 #include <QtCore/QTextStream>
62 return "SgCableCalReading";
80 return "SgMeteoReading";
98 return "SgTraklReading";
117 return "SgTsysReading";
125 for (QMap<QString, float>::const_iterator it=
tsys.begin(); it!=
tsys.end(); ++it)
126 tsys_.insert(it.key(), it.value());
134 for (QMap<QString, QVector<int> >::const_iterator it=
tpcont.begin(); it!=
tpcont.end(); ++it)
135 tpcont_.insert(it.key(), it.value());
153 return "SgPcalReading";
171 return "SgSefdReading";
178 const QString& chanKey,
const QVector<double>& val)
192 "::addValByChanKey(): source name has changed: old: \"" +
srcName_ +
"\", new: \"" +
195 if (-1000<
az_ && az !=
az_)
199 "::addValByChanKey(): azimuth has changed: old: \"" + QString(
"").setNum(
az_) +
", new: " +
202 if (-1000<
el_ && el !=
el_)
206 "::addValByChanKey(): elevation has changed: old: \"" + QString(
"").setNum(
el_) +
", new: " +
209 QVector<double> *v =
new QVector<double>(val);
215 "::addValByChanKey(): the channel key \"" + chanKey +
"\" is already in the map");
242 return "SgOnSourceRecord";
261 return "SgChannelSetup";
287 skyFrq = loFreq + bbcFreq - width;
289 skyFrq = loFreq - bbcFreq - width;
291 skyFrq = loFreq + bbcFreq;
293 skyFrq = loFreq - bbcFreq;
297 return skyFrq + width/2.0;
367 QString sensorKey=it.key();
368 QString sensorId(
"");
374 "::selfCheck(): VGOS setup: cannot find sensor ID for key \"" +
375 sensorKey +
"\" for station \"" + stnKey +
"\"");
385 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
386 "the map bbcFreqByIdx is empty");
392 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
393 "the map bbcBandwidthByIdx is empty");
399 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
400 "the maps loIdByIdx/loIdByCid are empty");
406 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
407 "the map loFreqById is empty");
413 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
414 "the map loSideBandById is empty");
420 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
421 "the map loPolarizationById is empty");
427 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
428 "the map ifIdxById is empty");
434 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
435 "the map ifSideBandById is empty");
440 QString ifId(it.key());
455 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
456 "cannot find side band for LO \"" + loId +
"\"");
463 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
464 "cannot find side band for channel #" + QString(
"").setNum(cIdx) +
", ID: \"" + ifId +
"\"");
472 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
473 "cannot find polarization for LO \"" + loId +
"\"");
481 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
482 "cannot find bandwidth for channel #" + QString(
"").setNum(cIdx) +
", ID=" + ifId);
489 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
490 "cannot find BBC_FRQ for channel #" + QString(
"").setNum(cIdx));
496 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
497 "cannot find LO frq for channel #" + QString(
"").setNum(cIdx) +
", loID=" + loId);
504 "::selfCheck(): the channel setup for station \"" + stnKey +
"\" is not usable: "
505 "cannot find LO ID for channel #" + QString(
"").setNum(cIdx) +
" with id \"" + ifId +
"\"");
531 return "SgChannelSkeded";
542 "::parseSkdFile(): going to parse \"" + f.fileName() +
"\" sked file");
547 "::parseSkdFile(): the file " + f.fileName() +
" does not exists");
548 return (
isOk_=
false);
551 if (f.open(QFile::ReadOnly))
556 QRegExp reCodes(
"^\\$CODES", Qt::CaseInsensitive);
557 QRegExp reFrec(
"^F\\s+(\\S+)\\s+(\\S+)\\s+(.+)$", Qt::CaseInsensitive);
559 QRegExp reCrec(
"^C\\s+(\\w+)\\s+(\\w+)\\s+(.+)$", Qt::CaseInsensitive);
560 QRegExp reSb(
"\\w*\\s*\\(([-+0-9,]+)\\).*", Qt::CaseInsensitive);
561 bool getCodesRec=
false;
567 bool hasUsb, hasLsb, hasBothBands;
570 while (!s.atEnd() && !haveDone)
575 if (str.size() && str.at(0)==
"*")
578 else if (reCodes.indexIn(str) != -1)
580 else if (getCodesRec)
582 if (reFrec.indexIn(str) != -1)
585 lst = reFrec.cap(3).split(
" ", QString::SkipEmptyParts);
586 for (
int i=0; i<lst.size(); i++)
587 stations << lst.at(i).leftJustified(8,
' ');
588 if (!stations.size())
590 "::parseSkdFile(): got \"F\" record without stations: \"" + str +
"\"");
593 for (
int i=0; i<stations.size(); i++)
595 const QString& key=stations.at(i);
599 "::parseSkdFile(): got " + QString(
"").setNum(stations.size()) +
" stations from F record");
602 else if (reCrec.indexIn(str) != -1)
605 lst = reCrec.cap(0).split(
" ", QString::SkipEmptyParts);
611 frq = lst.at(3).toDouble(&
isOk);
616 "::parseSkdFile(): cannot get sky frequency from C record \"" + str +
"\"");
619 cIdx = lst.at(5).toDouble(&
isOk);
624 "::parseSkdFile(): cannot get channel index from C record \"" + str +
"\"");
627 width = lst.at(7).toDouble(&
isOk);
632 "::parseSkdFile(): cannot get channel width from C record \"" + str +
"\"");
635 hasUsb = hasLsb = hasBothBands =
false;
637 if (reSb.indexIn(lst.at(8)) != -1)
639 lst = reSb.cap(1).split(
",", QString::KeepEmptyParts);
642 "::parseSkdFile(): nothing to parse side band set up: \"" + str +
"\"");
645 if (lst.at(0).size())
650 if (1 < lst.size() && lst.at(1).size())
655 if (2 < lst.size() && lst.at(2).size())
660 if (3 < lst.size() && lst.at(3).size())
665 hasBothBands = hasUsb && hasLsb;
670 "::parseSkdFile(): cannot get parse side band set up: \"" + str +
"\"");
675 ChanCfg cc(bandKey, cIdx, frq - width, width, sideBands);
676 for (
int i=0; i<stations.size(); i++)
679 ChanCfg cc(bandKey, cIdx, frq, width, sideBands);
680 for (
int i=0; i<stations.size(); i++)
695 "::parseSkdFile(): nothing has found in the sked file \"" + f.fileName() +
"\"");
703 const StnCfg& cfg=it.value();
708 "::parseSkdFile(): the sked file \"" + f.fileName() +
709 "\" is not usable: station name is missing");
715 "::parseSkdFile(): the sked file \"" + f.fileName() +
"\" is not usable for " + it.key() +
716 ": no channels setup");
727 "::parseSkdFile(): the sked file \"" + f.fileName() +
"\" is not usable for " + it.key() +
728 ": bad channel index for chan#" + QString(
"").setNum(i));
734 "::parseSkdFile(): the sked file \"" + f.fileName() +
"\" is not usable for " + it.key() +
735 ": bad band key for chan#" + QString(
"").setNum(i));
741 "::parseSkdFile(): the sked file \"" + f.fileName() +
"\" is not usable for " + it.key() +
742 ": bad sky frequency for chan#" + QString(
"").setNum(i));
748 "::parseSkdFile(): the sked file \"" + f.fileName() +
"\" is not usable for " + it.key() +
749 ": bad bandwidth for chan#" + QString(
"").setNum(i));
755 "::parseSkdFile(): the sked file \"" + f.fileName() +
"\" is not usable for " + it.key() +
756 ": no sideband setup for chan#" + QString(
"").setNum(i));
783 return "SgStnLogReadings";
818 stationName_(stationName),
854 for (
int i=0; i<
tSyses_.size(); i++)
858 for (
int i=0; i<
trakls_.size(); i++)
860 for (
int i=0; i<
pcals_.size(); i++)
914 for (
int i=0; i<
tSyses_.size(); i++)
924 const QMap<QString, int> *defaultCableSignByStn)
928 SgMJD tLeftMarging, tRightMarging;
937 "::verifyReadings(): the station " +
stationName_ +
" has no any observations; skipped");
944 tLeftMarging = tFirst - 1.0/24.0;
945 tRightMarging = tLast + 1.0/24.0;
990 "::verifyReadings(): station " +
stationName_ +
": got the duplicate scan \"" +
1000 " scan " + osRec->
getScanName() +
", it's already in the map, nr(c/m)=" +
1001 QString(
"").setNum(osRec->
cableCals().size()) +
"/" +
1002 QString(
"").setNum(osRec->
meteoPars().size()));
1009 QString(
"").setNum(osRec->
cableCals().size()) +
"/" +
1010 QString(
"").setNum(osRec->
meteoPars().size()));
1028 "::verifyReadings(): station " +
stationName_ +
": insufficient number (" +
1029 QString(
"").setNum(inRangePts) +
") of meteo parameters; skipped");
1046 "::verifyReadings(): station " +
stationName_ +
": insufficient number (" +
1047 QString(
"").setNum(inRangePts) +
") of cable calibrations; skipped");
1054 for (
int i=0; i<
tSyses_.size(); i++)
1055 if (tFirst<=
tSyses_.at(i)->getT() &&
tSyses_.at(i)->getT()<=tLast)
1064 "::verifyReadings(): station " +
stationName_ +
": insufficient number (" +
1065 QString(
"").setNum(inRangePts) +
") of tsys readings; skipped");
1078 ": cannot determine the cable sign from cablelong measurements");
1079 else if (!hasCableSign)
1083 "::verifyReadings(): station " +
stationName_ +
": the cable sign has been set to \"" +
1084 (
cableSign_>0?
"+":
"-") +
"\" according to cablelong measurements");
1085 hasCableSign =
true;
1091 ": the found cable sign is different from the cablelong measurements: \"" +
1092 (
cableSign_>0?
"+":
"-") +
"\" vs \"" + (signCableLong>0?
"+":
"-") +
1093 "\"; the sign has been reverted");
1099 ": the cable sign has been confirmed by cablelong measurements");
1104 ": cannot find any usable cablelong measurements");
1110 "::verifyReadings(): station " +
stationName_ +
": cannot find any usable meteo readings");
1113 "::verifyReadings(): station " +
stationName_ +
": cannot find any usable cable calibrations");
1118 "::verifyReadings(): station " +
stationName_ +
": cannot determine the cable calibration sign");
1122 if (defaultCableSignByStn)
1129 ": the cable sign was set to \"" + QString(
cableSign_==1?
"+":
"-") +
1130 "\" according to the list of default cable signs");
1136 "::verifyReadings(): no default cable cal list were provided");
1150 const QMap<QString, SgVlbiAuxObservation*> &auxObservationByScan)
1156 ": unable to lookup the scan name: no source name provided,");
1158 "::lookupScanName(): station " +
stationName_ +
": the on_data record is: " +
1164 double tLimit=15.0/60.0/24.0;
1168 SgMJD tClosest=*auxClosest;
1170 dT = fabs(tClosest - t);
1171 for (QMap<QString, SgVlbiAuxObservation*>::const_iterator it=auxObservationByScan.begin();
1172 it!=auxObservationByScan.end(); ++it)
1174 SgMJD &ti=*it.value();
1175 if ( (fabs(ti-t)<dT) && it.value()->getOwner()->src()->getKey().contains(osRec->
getSourceName()))
1179 auxClosest = it.value();
1183 if (auxClosest && dT<=tLimit)
1197 ": no scan name was assigned to the on_data record: [" +
1209 double window=10.0/60.0/24.0;
1217 if (fabs(
cableCals_.at(j)->getT() - tL) < window)
1220 if (selectedReadings.size())
1222 double vAverage, ratio;
1224 "::determineCableSignFromLong(): collected " + QString(
"").setNum(selectedReadings.size()) +
1225 " close cable readings for cablelong measurement on " + tL.
toString());
1228 for (
int j=0; j<selectedReadings.size(); j++)
1229 vAverage += selectedReadings.at(j)->getV();
1230 vAverage /= selectedReadings.size();
1232 ratio = (clV - vAverage)/vAverage;
1235 else if (ratio < -1.0e-3 )
1239 signByCablelong << cableSign;
1241 "::determineCableSignFromLong(): average cable cal: " + QString(
"").setNum(vAverage*1.0e9) +
1242 "ns, cablelong: " + QString(
"").setNum(clV*1.0e9) +
1243 "ns; the sign is \"" + QString(cableSign==0?
"?":(cableSign<0?
"-":
"+")) +
"\"");
1244 selectedReadings.clear();
1248 "::determineCableSignFromLong(): no close cable readings found for cablelong measurement on " +
1252 if (signByCablelong.size() == 0)
1254 else if (signByCablelong.size() == 1)
1255 cableSign = signByCablelong.at(0);
1258 QMap<int, int> signByNum;
1259 for (
int i=0; i<signByCablelong.size(); i++)
1261 if (signByNum.contains(signByCablelong.at(i)))
1262 signByNum[signByCablelong.at(i)]++;
1264 signByNum[signByCablelong.at(i)] = 1;
1266 if (signByNum.size() == 1)
1268 cableSign = signByNum.begin().key();
1270 "::determineCableSignFromLong(): according to all " +
1271 QString(
"").setNum(signByCablelong.size()) +
" cablelong measurements, the sign is \"" +
1272 QString(cableSign==0?
"?":(cableSign<0?
"-":
"+")) +
"\"");
1278 "::determineCableSignFromLong(): cannot determine the proper sign, the "
1279 "numbers of measuremnts are:");
1280 for (QMap<int, int>::iterator it=signByNum.begin(); it!=signByNum.end(); ++it)
1282 "::determineCableSignFromLong(): " +
1283 QString(
"").sprintf(
"sign \"%s\": %2d count(s)", it.key()==0?
"?":(it.key()<0?
"-":
"+"),
1287 signByCablelong.clear();
1300 int numOfResolvedAmbigs=0;
1301 int numOfOutliers=0;
1302 bool allReadingsRsame;
1312 numOfResolvedAmbigs++;
1314 vAverage = vAverage*i/(i + 1) + rec->
getV()/(i+1);
1316 if (numOfResolvedAmbigs)
1318 "::cleanCableCalibrations() station " +
stationName_ +
": " +
1319 QString(
"").setNum(numOfResolvedAmbigs) +
" ambiguit" + (numOfResolvedAmbigs==1?
"y":
"ies") +
1320 " resolved in the cable cal readings");
1329 allReadingsRsame =
true;
1334 if (allReadingsRsame &&
cableCals_.at(i)->getV()!=vTmp)
1335 allReadingsRsame =
false;
1337 if (!allReadingsRsame)
1341 vDispersion -= vAverage*vAverage;
1342 if (vDispersion < 0.0)
1345 "::cleanCableCalibrations(): station " +
stationName_ +
": dispersion^2<0.0 (" +
1346 QString(
"").sprintf(
"%.16g", vDispersion) +
")");
1347 vDispersion = -vDispersion;
1349 if (vDispersion > 0.0)
1351 vDispersion = sqrt(vDispersion);
1353 if (fabs(
cableCals_.at(i)->getV()-vAverage) > 5.0*vDispersion)
1368 while (j < cl.size())
1369 if (!cl.at(j)->getIsOk())
1385 "::cleanCableCalibrations(): station " +
stationName_ +
": " +
1386 QString(
"").setNum(numOfOutliers) +
" outlier" +
1387 QString(numOfOutliers==1?
" has ":
"s have ") +
"been removed",
true);
1399 "::cleanCableCalibrations(): station " +
stationName_ +
": subtracted the average value of " +
1400 QString(
"").setNum(vAverage*1.0e9) +
"ns from the cable cal readings");
1409 QMap<QString, SgMeteoReading*>
1412 double d, dt, extrRmin=0.0, extrRmax=1.0;
1413 int nExtr4Rmin=0, nExtr4Rmax=0, numOfDuples=0, numOfSameEpochs=0;
1423 if (mpByEpoch.contains(str))
1428 "::cleanMeteoParameters(): station " +
stationName_ +
": got duplicate weather record at " +
1435 stationName_ +
": got two different records at the same epoch " +
1447 "::cleanMeteoParameters(): station " +
stationName_ +
": " + QString(
"").setNum(numOfDuples) +
1448 " duplicate meteo records found");
1449 if (numOfSameEpochs)
1451 "::cleanMeteoParameters(): station " +
stationName_ +
": " + QString(
"").setNum(numOfSameEpochs) +
1452 " records with the same epoch and different values found");
1464 "::cleanMeteoParameters(): station " +
stationName_ +
": too small number of meteo records (" +
1465 QString(
"").setNum(
meteoPars_.size()) +
"), nothing to do");
1471 SgVector dP(nPars), dT(nPars), dR(nPars);
1473 for (
int i=1; i<nPars; i++)
1481 dP.setElement(i, d/dt);
1485 dT.setElement(i, d/dt);
1487 d =
meteoPars_.at(i)->getM().getRelativeHumidity() -
meteoPars_.at(i-1)->getM().getRelativeHumidity();
1492 if (fabs(
meteoPars_.at(i)->getM().getRelativeHumidity() - extrRmin) < 1.0e-6)
1494 if (fabs(
meteoPars_.at(i)->getM().getRelativeHumidity() - extrRmax) < 1.0e-6)
1500 double mrP, mrT, mrR;
1501 int n4P=0, n4T=0, n4R=0;
1502 bool isOkP=
true, isOkT=
true, isOkR=
true, hasSuspiciousExtrems4R=
false;
1507 for (
int i=1; i<nPars; i++)
1509 if (mrP < fabs(dP.getElement(i)))
1513 " has too big pressure rate, " + QString(
"").setNum(dP.getElement(i)/24.0) +
1514 "(mbar/hr) at the idx " + QString(
"").setNum(i));
1517 if (mrT < fabs(dT.getElement(i)))
1521 " has too big atm.temperature rate, " + QString(
"").setNum(dT.getElement(i)/24.0) +
1522 "(C/hr) at the idx " + QString(
"").setNum(i));
1529 " has too big rel.humidity rate, " + QString(
"").setNum(100.0*dR.
getElement(i)/24.0) +
1530 "(%/hr) at the idx " + QString(
"").setNum(i));
1532 "::cleanMeteoParameters(): station " +
stationName_ +
": i-1: " +
1534 QString(
"").sprintf(
"%.4f",
meteoPars_.at(i-1)->getM().getRelativeHumidity()) +
1536 QString(
"").sprintf(
"%.4f",
meteoPars_.at(i)->getM().getRelativeHumidity()));
1545 "::cleanMeteoParameters(): station " +
stationName_ +
" has more than 10 (" +
1546 QString(
"").setNum(n4P) +
") suspicious big pressure rates, use standard pressure instead");
1552 "::cleanMeteoParameters(): station " +
stationName_ +
" has more than 10 (" +
1553 QString(
"").setNum(n4T) +
1554 ") suspicious big atm.temperature rates, use default temperature instead");
1560 "::cleanMeteoParameters(): station " +
stationName_ +
" has more than 10 (" +
1561 QString(
"").setNum(n4R) +
1562 ") suspicious big rel.humidity rates, use default humidity instead");
1564 if (8 < nExtr4Rmin && 8 < nExtr4Rmax)
1567 "::cleanMeteoParameters(): station " +
stationName_ +
" has too much extremal values (" +
1568 QString(
"").setNum(nExtr4Rmin) +
"/" + QString(
"").setNum(nExtr4Rmax) +
1569 ") for rel.humidity, use default humidity instead");
1570 hasSuspiciousExtrems4R =
true;
1575 if (!isOkP || !isOkT || !isOkR || hasSuspiciousExtrems4R)
1585 if (!isOkR || hasSuspiciousExtrems4R)
1592 "::cleanMeteoParameters(): station " +
stationName_ +
": the meteoparameters have been ordered");
1610 " is too far from the first available meteo reading (" +
meteoPars_.at(idx_r)->getT().toString() +
1611 "), no extrapolation");
1619 " is too far from the last available meteo reading (" +
meteoPars_.at(idx_l)->getT().toString() +
1620 "), no extrapolation");
1633 while (t<
meteoPars_.at(idx_l)->getT() && 0<idx_l)
1642 double dt, dPr, dTp, dRh, x;
1645 dPr =
meteoPars_.at(idx_r)->getM().getPressure() -
1647 dTp =
meteoPars_.at(idx_r)->getM().getTemperature() -
1648 meteoPars_.at(idx_l)->getM().getTemperature();
1649 dRh =
meteoPars_.at(idx_r)->getM().getRelativeHumidity() -
1650 meteoPars_.at(idx_l)->getM().getRelativeHumidity();
1662 QRegExp reBrokenScanName(
"([a-zA-Z0-9+-]+)_.+", Qt::CaseInsensitive);
1663 bool isScanNameSuspicious;
1665 int numOfExactMatches, numOfMultExactMatches, numOfClosestMatches, cSign;
1666 int numOfChannels, chanIdx;
1667 bool hasMeteoOk, hasCableOk, hasTsysOk;
1670 numOfExactMatches = numOfMultExactMatches = numOfClosestMatches = 0;
1671 hasMeteoOk = hasCableOk = hasTsysOk =
false;
1672 static const QString sideBand2str[] = {
"UNDEF",
"LSB",
"USB",
"DUAL"};
1673 static const QString polarization2str[] = {
"UNDEF",
"RCP",
"LCP",
"HLP",
"VLP"};
1688 QString scanNameAux(
"");
1690 QString surrogateScanName(
"");
1707 for (
int i=0; i<numOfChannels; i++)
1711 isScanNameSuspicious = reBrokenScanName.indexIn(scanName) != -1;
1712 if (isScanNameSuspicious)
1713 scanNameAux = reBrokenScanName.cap(1).toLower();
1714 if (scanName.size()==9 && scanName.at(8).isLetter())
1715 surrogateScanName = scanName.left(8);
1718 if (!
recordByScan_.contains(scanName) && !isScanNameSuspicious)
1722 "::propagateData(): station " +
stationName_ +
": cannot find the scan \"" + scanName +
1723 "\" in the log file");
1725 else if (isScanNameSuspicious && !
recordByScan_.contains(scanNameAux))
1729 "::propagateData(): station " +
stationName_ +
": cannot find the suspicious scan \"" +
1730 scanNameAux +
"\"' in the log file");
1732 else if (surrogateScanName.size() &&
1738 "::propagateData(): station " +
stationName_ +
": cannot find the surrogate scan \"" +
1739 scanNameAux +
"\"' in the CDMS file");
1744 if (!osRec && isScanNameSuspicious)
1746 else if (!osRec && surrogateScanName.size())
1758 numOfExactMatches++;
1764 ": no cable cal record found for the scan \"" + scanName +
"\" in the log file");
1765 numOfClosestMatches++;
1778 numOfMultExactMatches++;
1781 if (osRec->
getSourceName().leftJustified(8,
' ') != sourceName)
1783 "::propagateData(): source name mismatch: from the log: \"" + osRec->
getSourceName() +
1784 "\", from the obs: \"" + sourceName +
"\"");
1790 if (osRec->
tSyses().size() == 1)
1791 tsr = osRec->
tSyses().last();
1795 dt = fabs(osRec->
tSyses().at(0)->getT() - t);
1796 for (
int i=1; i<osRec->
tSyses().size(); i++)
1797 if ((f=fabs(osRec->
tSyses().at(i)->getT() - t)) < dt)
1802 tsr = osRec->
tSyses().at(idx);
1809 if (tsr->
getTsys().contains(jt.value()))
1813 1 < osRec->
tSyses().size())
1816 ": the OnSource record has more than one (" +
1817 QString(
"").setNum(osRec->
tSyses().size()) +
") TSYS record for the scan \"" +
1823 "::propagateData(): the OnSource record is NULL: the station= " +
stationName_ +
1824 ", the scan= \"" + scanName +
"\"");
1836 if (idx4Cable == -1)
1838 dt = fabs(cables->at((idx4Cable=0))->getT() - t);
1839 for (
int i=1; i<cables->size(); i++)
1840 if ((f=fabs(cables->at(i)->getT() - t)) < dt)
1864 "::propagateData(): station " +
stationName_ +
": " + QString(
"").setNum(numOfExactMatches) +
1865 " exact " + (numOfMultExactMatches?(
"(" + QString(
"").setNum(numOfMultExactMatches) +
1866 (numOfMultExactMatches==1?
" is ":
" are ") +
"multiple) "):
"") +
1867 (numOfClosestMatches?
"and " + QString(
"").setNum(numOfClosestMatches) +
" closest ":
"") +
1868 "matches of cable calibrations were found");
1875 "::propagateData(): station " +
stationName_ +
": meteo parameters were found");
1890 const QString &
id=jt.value();
1891 const QString &sensorKey=jt.key();
1904 "::propagateData(): station " +
stationName_ +
": tsys data were found");
1910 return hasMeteoOk || hasCableOk || hasTsysOk;
1933 "::allocateCableReadings(): station " +
stationName_ +
": " + QString(
"").setNum(allocatedNum) +
1934 " cable cal readings were linked to on data records");
1947 s <<
"# Sensor# IF_Freq LO_Freq Sky_freq Pol SensorId Channel# SideBand\n#\n";
1955 QString ifKey(it.key());
1956 QString ifId(it.value());
1962 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
1963 ": cannot find IF index for if with the id \"" + ifId +
"\"");
1975 double ifFrq, loFrq, skyFrq, bw;
1976 ifFrq = loFrq = skyFrq = bw = 0.0;
1989 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
": cannot find side band for LO \"" +
1997 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
": cannot find side band for channel #" +
1998 QString(
"").setNum(cIdx) +
", ID: \"" + ifId +
"\"");
2005 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
": cannot find polarization for LO \"" +
2013 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
": cannot find bandwidth for channel #" +
2014 QString(
"").setNum(cIdx) +
", ID=" + ifId);
2033 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
": cannot find BBC_FRQ for channel #" +
2034 QString(
"").setNum(cIdx));
2040 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
": cannot find LO frq for channel #" +
2041 QString(
"").setNum(cIdx) +
", loID=" + loId);
2043 skyFrq = loFrq + ifFrq;
2047 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
": cannot find LO ID for channel #" +
2048 QString(
"").setNum(cIdx));
2053 str.sprintf(
"FRQ: %7d %11.2f %11.2f %11.2f",
2054 idx, ifFrq, loFrq, skyFrq);
2063 str.sprintf(
" %6s ", qPrintable(ifId));
2065 str.sprintf(
"%6d", cIdx);
2091 s <<
"# Sensor# IF_Freq LO_Freq Sky_freq Pol SensorId Channel# SideBand\n#\n";
2097 QString ifKey(it.key());
2098 QString ifId(it.value());
2105 "::export2antabFrqs_vgosSetup(): station " +
stationName_ +
2106 ": cannot find IF index for if with the id \"" + ifId +
"\"");
2114 double skyFrq, loFrq=-1.0;
2122 "::export2antabFrqs_vgosSetup(): station " +
stationName_ +
2123 ": cannot find side band for channel #" + QString(
"").setNum(cIdx) +
", ID: \"" + ifId +
"\"");
2138 "::export2antabFrqs_vgosSetup(): station " +
stationName_ +
2139 ": cannot find LO frq for channel #" + QString(
"").setNum(cIdx) +
", loID=\"" + loId +
"\"");
2147 "::export2antabFrqs_vgosSetup(): station " +
stationName_ +
2148 ": cannot find polarization for LO \"" + ifId +
"\"");
2152 str.sprintf(
"FRQ: %7d %11.2f %11.2f %11.2f ",
2153 idx, -1.0, loFrq, skyFrq);
2167 str.sprintf(
" %6s %6d ", qPrintable(ifId), cIdx);
2193 "::export2antabFrqs_skededSetup(): station " +
stationName_ +
2194 ": number of channels are different");
2199 s <<
"# Sensor# IF_Freq LO_Freq Sky_freq Pol SensorId Channel# SideBand\n#\n";
2206 QString ifKey(it.key());
2207 QString ifId(it.value());
2213 "::export2antabFrqs_nativeSetup(): station " +
stationName_ +
2214 ": cannot find IF index for if with the id \"" + ifId +
"\"");
2228 "::export2antabFrqs_skededSetup(): station " +
stationName_ +
": cannot find side band for channel #" +
2229 QString(
"").setNum(cIdx) +
", ID: \"" + ifId +
"\"");
2236 str.sprintf(
"FRQ: %7d %11.2f %11.2f %11.2f",
2237 idx, -1.0, -1.0, skyFrq);
2241 str.sprintf(
" %6s ", qPrintable(ifId));
2243 str.sprintf(
"%6d", cIdx);
2268 s <<
"# Sensor# IF_Freq LO_Freq Sky_freq Pol SensorId Channel# SideBand\n#\n";
2275 QString ifKey(it.key());
2276 QString ifId(it.value());
2282 "::export2antabFrqs_missedSetup(): station " +
stationName_ +
2283 ": cannot find IF index for if with the id \"" + ifId +
"\"");
2296 "::export2antabFrqs_missedSetup(): station " +
stationName_ +
2297 ": cannot find side band for channel #" + QString(
"").setNum(cIdx) +
2298 ", ID: \"" + ifId +
"\"");
2304 str.sprintf(
"FRQ: %7d %11.2f %11.2f %11.2f",
2305 idx, -1.0, -1.0, -1.0);
2308 str.sprintf(
" %6s ", qPrintable(ifId));
2310 str.sprintf(
"%6d", cIdx);
2333 QMap<int, double> frqByIdx_Fsl, frqByIdx_Skd;
2334 QMap<int, double> bwByIdx_Fsl, bwByIdx_Skd;
2335 int numOfChansAtSked, numOfChansAtLog;
2337 numOfChansAtSked = numOfChansAtLog = 0;
2345 frqByIdx_Skd[i] = skyFrq;
2346 bwByIdx_Skd[i] = bw;
2355 int cIdx=it.value();
2356 QString ifId(it.key());
2360 double ifFrq, loFrq, skyFrq, bw;
2361 ifFrq = loFrq = skyFrq = bw = 0.0;
2377 "::compareChannelSetups(): station " +
stationName_ +
": cannot find side band for LO \"" +
2385 "::compareChannelSetups(): station " +
stationName_ +
": cannot find side band for channel #" +
2386 QString(
"").setNum(cIdx) +
", ID: \"" + ifId +
"\"");
2393 "::compareChannelSetups(): station " +
stationName_ +
": cannot find bandwidth for channel #" +
2394 QString(
"").setNum(cIdx) +
", ID=" + ifId);
2415 "::compareChannelSetups(): station " +
stationName_ +
": cannot find BBC_FRQ for channel #" +
2416 QString(
"").setNum(cIdx));
2422 "::compareChannelSetups(): station " +
stationName_ +
": cannot find LO frq for channel #" +
2423 QString(
"").setNum(cIdx) +
", loID=" + loId);
2425 skyFrq = loFrq + ifFrq;
2429 "::compareChannelSetups(): station " +
stationName_ +
": cannot find LO ID for channel #" +
2430 QString(
"").setNum(cIdx));
2435 frqByIdx_Fsl[idx] = skyFrq - bw;
2436 bwByIdx_Fsl[idx] = bw;
2440 frqByIdx_Fsl[idx] = skyFrq;
2441 bwByIdx_Fsl[idx] = bw;
2446 if (frqByIdx_Fsl.size() != frqByIdx_Skd.size())
2450 "::compareChannelSetups(): station " +
stationName_ +
": the number of channels are different, " +
2451 QString(
"").sprintf(
"%d (log) vs %d (sked)", frqByIdx_Fsl.size(), frqByIdx_Skd.size()));
2457 QMap<double, int> idxByFrq_Fsl, idxByFrq_Skd;
2458 for (QMap<int, double>::iterator it=frqByIdx_Fsl.begin(); it!=frqByIdx_Fsl.end(); ++it, idx++)
2459 idxByFrq_Fsl[it.value()] = it.key();
2460 for (QMap<int, double>::iterator it=frqByIdx_Skd.begin(); it!=frqByIdx_Skd.end(); ++it, idx++)
2461 idxByFrq_Skd[it.value()] = it.key();
2466 for (
int i=0; i<d_Fsl.size(); i++)
2468 double frqFsl=d_Fsl.at(i), frqSkd=d_Skd.at(i);
2469 if (1.0e-4 < fabs(frqSkd - frqFsl))
2474 ": the sky frequency for the channel #" +
2475 QString(
"").setNum(i) +
" is different: " +
2476 QString(
"").sprintf(
"%.4f (log) vs %.4f (sked)", frqFsl, frqSkd));
2480 d_Fsl = bwByIdx_Fsl.values();
2481 d_Skd = bwByIdx_Skd.values();
2482 for (
int i=0; i<d_Fsl.size(); i++)
2484 double bwFsl=d_Fsl.at(i), bwSkd=d_Skd.at(i);
2485 if (1.0e-2 < fabs(bwSkd - bwFsl))
2490 ": the width for the channel #" +
2491 QString(
"").setNum(i) +
" is different: " +
2492 QString(
"").sprintf(
"%.2f (log) vs %.2f (sked)", bwFsl, bwSkd));
2554 int numOfChansAtSked, numOfChansAtLog;
2556 numOfChansAtSked = numOfChansAtLog = 0;
2566 QString ifId(it.key());
2573 "::compareChannelNumbers(): station " +
stationName_ +
": cannot find side band for channel #" +
2574 QString(
"").setNum(it.value()) +
", ID: \"" + ifId +
"\"");
2583 if (numOfChansAtLog != numOfChansAtSked)
2587 "::compareChannelNumbers(): station " +
stationName_ +
": the number of channels are different, " +
2588 QString(
"").sprintf(
"%d (log) vs %d (sked)", numOfChansAtLog, numOfChansAtSked));
2597 const QString& stnKey,
const SgChannelSkeded *channelSkeded,
bool useSkededChannelSetup,
2598 bool have2overwrite,
bool reportAllTsysData)
2600 enum ChannelSetup2Use {CSU_NONE, CSU_NATIVE, CSU_SKED, CSU_VEX, CSU_VGOS};
2603 ChannelSetup2Use setup2use;
2604 setup2use = CSU_NONE;
2606 haveTsys = 0 <
tSyses_.size();
2610 if (!outputFileName.size())
2613 if (5 < inputLogFileName.size() && inputLogFileName.right(4) == QString(
".log"))
2615 str = inputLogFileName.left(inputLogFileName.size() - 4) +
".ant";
2618 str = inputLogFileName +
".ant";
2621 str = outputFileName;
2624 "::createAntabFile(): station " + stnKey +
": " +
2625 " going to create " + f.fileName() +
" LOG-ANTAB file");
2632 "::createAntabFile(): station " + stnKey +
2633 ": the sked's channel setup is missing");
2634 else if (!channelSkeded->
isOk())
2636 "::createAntabFile(): station " + stnKey +
2637 ": the sked's channel setup is not good, skipping it");
2638 else if (!channelSkeded->
stnCfgByKey_.contains(stnKey))
2640 "::createAntabFile(): station " + stnKey +
2641 ": the sked's channel setup does not contain this station, skipping it");
2645 "::createAntabFile(): station " + stnKey +
2646 ": the number of collected channels and number of channels in the sked are different, skipping it");
2651 "::createAntabFile(): station " + stnKey +
2652 ": looks like we have channel setup from sked");
2658 setup2use = CSU_NATIVE;
2660 setup2use = CSU_VGOS;
2662 "::createAntabFile(): station " + stnKey +
2663 ": channel setup from the log file looks ok");
2667 "::createAntabFile(): station " + stnKey +
2668 ": comparing sked's and FS log channel setups");
2672 else if (haveSkeded)
2674 setup2use = CSU_SKED;
2676 "::createAntabFile(): station " + stnKey +
": cannot figure out channel setup from the log "
2677 "file, falling back to the set up from sked file");
2681 setup2use = CSU_NONE;
2683 "::createAntabFile(): station " + stnKey +
": cannot figure out the channel setup");
2686 if (setup2use == CSU_NATIVE && useSkededChannelSetup)
2688 setup2use = CSU_SKED;
2690 "::createAntabFile(): station " + stnKey +
": forced to use the set up from sked file");
2695 "::createAntabFile(): station " + stnKey +
": no TSYS data have found in the log file");
2703 "::createAntabFile(): the file " + f.fileName() +
" already exists; it will be overwritten");
2707 "::createAntabFile(): the file " + f.fileName() +
" already exists, skipping");
2716 if (f.open(QFile::WriteOnly))
2720 s <<
"# LOG-ANTAB Format Version of 2009.08.07\n";
2724 s <<
"# Generated from log file " << qPrintable(inputLogFileName) <<
" on "
2727 s <<
"STATION: " << qPrintable(stnKey) <<
"\n";
2733 s <<
"# Data_on start Data_on end Source Scan\n";
2741 << qPrintable(rec->
getSourceName().leftJustified(8,
' ')) <<
" "
2742 << qPrintable(rec->
getScanName().leftJustified(8,
' ')) <<
"\n";
2747 s <<
"NUMB_CAB: " <<
cableCals_.size() <<
"\n";
2754 s <<
"# Date Cable delay (sec)\n";
2761 << qPrintable(QString(
"").sprintf(
"%12.5E", cc->
getV())) <<
"\n";
2767 s <<
"NUMB_METEO: " <<
meteoPars_.size() <<
"\n";
2772 s <<
"# Date Temp Pres Humid\n";
2779 << qPrintable(QString(
"").sprintf(
"%6.2f %7.1f %4.1f",
2790 if (setup2use == CSU_NATIVE)
2792 else if (setup2use == CSU_VGOS)
2794 else if (setup2use == CSU_SKED && channelSkeded->
stnCfgByKey_.contains(stnKey))
2796 else if (setup2use == CSU_NONE)
2801 s <<
"#No FRQ data available\n";
2807 if (!reportAllTsysData)
2809 s <<
"# Scan Scan_name Src_name UTC_Time_tag ";
2814 s <<
" Ts#" << QString(
"").sprintf(
"%03d", idx);
2820 s <<
"NUMB_TSYS: " << numOfTsyses <<
"\n";
2827 for (
int j=0; j<sOn->
tSyses().size(); j++)
2829 tsr = sOn->
tSyses().at(j);
2830 s << str.sprintf(
"TSYS: %6d ", counter);
2831 str = sOn->
getScanName().leftJustified(9,
' ') +
" " +
2835 if (tsr && tsr->
osRec())
2845 if (tsr && tsr->
getTsys().contains(it.value()))
2846 v = tsr->
getTsys().value(it.value());
2847 s << str.sprintf(
" %7.1f", v);
2856 s <<
"# Idx Azimuth Elevation UTC_Time_tag ";
2861 s <<
" Ts#" << QString(
"").sprintf(
"%03d", idx);
2862 s <<
"\n# (deg) (deg)\n";
2864 for (
int i=0; i<
tSyses_.size(); i++)
2867 s << str.sprintf(
"TSYS: %6d ", i+1);
2868 str =
"SLWEING SLEWING ";
2871 double dt=1.0e3, d=0.0;
2872 for (
int j=0; j<tsr->
trakls().size(); j++)
2876 if ((d=fabs(tsr->
getT() - tsr->
trakls().at(j)->getT())) < dt)
2879 trakl = tsr->
trakls().at(j);
2884 str.sprintf(
"%10.5f %10.5f", trakl->
getAz(), trakl->
getEl());
2894 if (tsr && tsr->
getTsys().contains(it.value()))
2895 v = tsr->
getTsys().value(it.value());
2896 s << str.sprintf(
" %7.1f", v);
2904 s <<
"#\nNUMB_FRQ: 0\n#\n";
2905 s <<
"NUMB_TSYS: 0\n";
2906 s <<
"#\n#\n# No TSYS records found in the log file\n#\n";
2936 s <<
"# Sensor IF_Freq LO_Freq Sky_frq_Cen Bdw Pol SensorId IF# SideBand\n";
2937 s <<
"# tag MHz MHz MHz MHz\n";
2944 QString sensorKey(it.key());
2945 QString ifId(it.value());
2951 "::export2antCalFrqs_nativeSetup(): station " +
stationName_ +
2952 ": cannot find IF index for if with the id \"" + ifId +
"\"");
2962 double ifFrq, loFrq, skyFrq, bw;
2963 ifFrq = loFrq = skyFrq = bw =
dFiller_;
2976 "::export2antCalFrqs_nativeSetup(): station " +
stationName_ +
": cannot find side band for LO \"" +
2984 "::export2antCalFrqs_nativeSetup(): station " +
stationName_ +
": cannot find side band for channel #" +
2985 QString(
"").setNum(cIdx) +
", ID: \"" + ifId +
"\"");
2992 "::export2antCalFrqs_nativeSetup(): station " +
stationName_ +
": cannot find polarization for LO \"" +
3000 "::export2antCalFrqs_nativeSetup(): station " +
stationName_ +
": cannot find bandwidth for channel #" +
3001 QString(
"").setNum(cIdx) +
", ID=" + ifId);
3020 "::export2antCalFrqs_nativeSetup(): station " +
stationName_ +
": cannot find BBC_FRQ for channel #" +
3021 QString(
"").setNum(cIdx));
3027 "::export2antCalFrqs_nativeSetup(): station " +
stationName_ +
": cannot find LO frq for channel #" +
3028 QString(
"").setNum(cIdx) +
", loID=" + loId);
3030 skyFrq = loFrq + ifFrq;
3034 "::export2antCalFrqs_nativeSetup(): station " +
stationName_ +
": cannot find LO ID for channel #" +
3035 QString(
"").setNum(cIdx));
3058 str.sprintf(
"TP_SENSOR: TS_%03d %8.2f %10.2f %10.2f %6.2f %3s %8s %3d %7s",
3059 idx, ifFrq, loFrq, skyFrq, bw,
3079 QString sSensorSbd(
"");
3080 QString sNetSbd(
"");
3082 QString sortingKey(
"");
3083 QMap<QString, QString> sensorSetupByKey;
3097 s <<
"# Note, the following sensor ID(s) were splitted by two sidebands: \n";
3101 const QString& key=it.key();
3103 str =
"# sensor " + key +
" => (";
3104 for (
int i=0; i<lst.size(); i++)
3105 str += lst.at(i) +
", ";
3111 s <<
"# Sensor IF_Freq LO_Freq Sky_frq_Cen BndWd Pol SensorId IF# Sensor Net Comments\n";
3112 s <<
"# tag MHz MHz MHz MHz SideBand SideBand\n";
3119 QString sensorKey(it.key());
3120 QString ifId(it.value());
3127 "::export2antCalFrqs_vgosSetup(): station " +
stationName_ +
3128 ": cannot find IF index for IF with ID \"" + ifId +
"\"");
3137 double ifFrq, loFrq, skyFrq, bw;
3138 ifFrq = loFrq = skyFrq = bw =
dFiller_;
3150 "::export2antCalFrqs_vgosSetup(): station " +
stationName_ +
3151 ": cannot find LO ID for sensorKey \"" + sensorKey +
"\"");
3158 "::export2antCalFrqs_vgosSetup(): station " +
stationName_ +
3159 ": cannot find LO sideband for sensorKey \"" + sensorKey +
"\"");
3166 "::export2antCalFrqs_vgosSetup(): station " +
stationName_ +
3167 ": cannot find side band for channel #" + QString(
"").setNum(cIdx) +
", ID: \"" + ifId +
"\"");
3174 "::export2antCalFrqs_vgosSetup(): station " +
stationName_ +
3175 ": cannot find LO frq for sensorKey \"" + sensorKey +
"\"");
3182 "::export2antCalFrqs_vgosSetup(): station " +
stationName_ +
3183 ": cannot find BBC_FRQ for channel #" + QString(
"").setNum(cIdx));
3190 "::export2antCalFrqs_vgosSetup(): station " +
stationName_ +
3191 ": cannot find bandwidth for sensor key \"" + sensorKey +
"\", ID=" + ifId);
3200 "::export2antCalFrqs_vgosSetup(): station " +
stationName_ +
3201 ": cannot find LO polarization for sensorKey \"" + sensorKey +
"\"");
3221 sSensorSbd =
"USB/LSB";
3228 sNetSbd =
"USB/LSB";
3231 str.sprintf(
"TP_SENSOR: TS_%03d %8.2f %10.2f %10.2f %6.2f %3s %8s %3d %7s %7s %s",
3232 idx, ifFrq, loFrq, skyFrq, bw,
3236 qPrintable(sSensorSbd),
3238 , qPrintable(sensorKey)
3281 s <<
"# Sensor IF_Freq LO_Freq Sky_frq_Cen Bdw Pol SensorId IF# SideBand\n";
3282 s <<
"# tag MHz MHz MHz MHz\n";
3289 "::export2antCalFrqs_skededSetup(): station " +
stationName_ +
3290 ": number of channels are different");
3297 QString sensorKey(it.key());
3298 QString ifId(it.value());
3304 "::export2antCalFrqs_skededSetup(): station " +
stationName_ +
3305 ": cannot find IF index for if with the id \"" + ifId +
"\"");
3312 double ifFrq, loFrq, skyFrq, bw;
3313 ifFrq = loFrq = skyFrq = bw =
dFiller_;
3320 "::export2antCalFrqs_skededSetup(): station " +
stationName_ +
": cannot find side band for channel #" +
3321 QString(
"").setNum(cIdx) +
", ID: \"" + ifId +
"\"");
3340 str.sprintf(
"TP_SENSOR: TS_%03d %8.2f %10.2f %10.2f %6.2f %1s %8s %3d %7s",
3341 idx, ifFrq, loFrq, skyFrq, bw,
3364 s <<
"# Sensor Sky_frq_Cen Pol SensorId IF# SideBand\n";
3373 QString key(it.key());
3374 QString id(it.value());
3396 "::export2antCalPcal_vgosSetup(): station " +
stationName_ +
3397 ": cannot find polarization for PCAL \"" +
id +
"\"");
3417 str.sprintf(
"PC_SENSOR: PC_%03d %14.2f %3s %8s %d %7s",
3434 const QString& outputFileName,
const QString& stnKey,
const SgChannelSkeded *channelSkeded,
3435 bool useSkededChannelSetup,
bool have2overwrite,
bool reportAllReadings,
bool supressNonUsedSensors,
3436 int wishedOutputData,
const QString& ext4compress,
const QString& userCommand)
3438 enum ChannelSetup2Use {CSU_NONE, CSU_NATIVE, CSU_SKED, CSU_VEX, CSU_VGOS};
3439 const QString dataFlag[] = {
"DATA:OFF",
"DATA:ON_SOURCE",
"DATA:VALID_ON"};
3441 ChannelSetup2Use setup2use;
3445 QString outputContent(
"");
3448 int outputData=wishedOutputData;
3454 setup2use = CSU_NONE;
3481 outputContent +=
"DATA_ON ";
3483 outputContent +=
"CABLE_SIGN ";
3485 outputContent +=
"CABLE ";
3487 outputContent +=
"METEO ";
3489 outputContent +=
"TP_SENSOR TSYS ";
3493 outputContent +=
"TPI ";
3495 outputContent +=
"TP_SENSOR TPI ";
3500 outputContent +=
"TPC ";
3502 outputContent +=
"TP_SENSOR TPC ";
3507 outputContent +=
"SEFD ";
3509 outputContent +=
"TP_SENSOR SEFD ";
3512 outputContent +=
"PC_SENSOR PCAL ";
3514 outputContent +=
"FMT2GPS_TIMER FMTGPS ";
3516 if (!outputContent.size())
3519 "::createAntCalFile(): station " + stnKey +
": nothing to output");
3524 outputContent.chop(1);
3526 "::createAntCalFile(): station " + stnKey +
": collected content for output: \"" +
3527 outputContent +
"\"");
3530 if (!outputFileName.size())
3532 str = inputLogFileName;
3538 if (5 < str.size() && str.right(4) == QString(
".log"))
3541 if (ext4compress.size())
3542 str +=
"." + ext4compress;
3545 str = outputFileName;
3547 if (ext4compress.size() && str.right(ext4compress.size()) != ext4compress)
3548 str +=
"." + ext4compress;
3555 "::createAntCalFile(): station " + stnKey +
": " +
3556 " going to create ANTCAL file \"" + f.fileName() +
"\"");
3562 "::createAntCalFile(): the file " + f.fileName() +
" already exists; it will be overwritten");
3566 "::createAntCalFile(): the file " + f.fileName() +
" already exists, skipping");
3580 "::createAntCalFile(): station " + stnKey +
3581 ": the sked's channel setup is missing");
3582 else if (!channelSkeded->
isOk())
3584 "::createAntCalFile(): station " + stnKey +
3585 ": the sked's channel setup is not good, skipping it");
3586 else if (!channelSkeded->
stnCfgByKey_.contains(stnKey))
3588 "::createAntCalFile(): station " + stnKey +
3589 ": the sked's channel setup does not contain this station, skipping it");
3593 "::createAntCalFile(): station " + stnKey +
3594 ": the number of collected channels and number of channels in the sked are different, skipping it");
3599 "::createAntCalFile(): station " + stnKey +
3600 ": looks like we have channel setup from sked");
3606 setup2use = CSU_NATIVE;
3609 setup2use = CSU_VGOS;
3611 "::createAntCalFile(): station " + stnKey +
3612 ": channel setup from the log file looks ok");
3616 "::createAntCalFile(): station " + stnKey +
3617 ": comparing sked's and FS log channel setups");
3621 else if (haveSkeded)
3623 setup2use = CSU_SKED;
3625 "::createAntCalFile(): station " + stnKey +
": cannot figure out channel setup from the log "
3626 "file, falling back to the set up from sked file");
3630 setup2use = CSU_NONE;
3632 "::createAntCalFile(): station " + stnKey +
": cannot figure out the channel setup");
3635 if (setup2use == CSU_NATIVE && useSkededChannelSetup)
3637 setup2use = CSU_SKED;
3639 "::createAntCalFile(): station " + stnKey +
": forced to use the set up from sked file");
3649 QFile fInpt(inputLogFileName);
3650 QFileInfo fi(fInpt);
3652 s <<
"# ANTCAL Format Version 0.96 of 2021.05.17\n#\n";
3653 s <<
"STATION: " << qPrintable(stnKey) <<
"\n#\n";
3655 s <<
"#\n# Created with command:\n";
3656 s <<
"#\n# " << qPrintable(userCommand) <<
"\n#\n";
3659 s <<
"# BACKEND INFO: " << qPrintable(
backEndInfo_) <<
"\n";
3661 s <<
"# RECORDER INFO: " << qPrintable(
recorderInfo_) <<
"\n#\n";
3665 s <<
"#\n# sec\n#\nUTC_MTAI: " <<
dFiller_ <<
"\n#\n#\n";
3666 s <<
"# Filler values\n# Real Integer Character\n#\n";
3670 s <<
"NUM_PROVENANCE: 1\n";
3675 s <<
"PROVENANCE: 1 CREATED_VARS: " << qPrintable(outputContent) <<
"\n";
3676 s <<
"PROVENANCE: 1 CREATION_DATE: "
3678 s <<
"PROVENANCE: 1 NUM_FILES: 1\n";
3680 s <<
"PROVENANCE: 1 DATA_TYPE: 1 FS_LOG Version " <<
fsVersionLabel_ <<
"\n";
3681 s <<
"PROVENANCE: 1 DATA_FILE: " << qPrintable(fi.canonicalFilePath()) <<
"\n";
3684 s <<
"PROVENANCE: 1 DATA_CREATED: 1 "
3686 s <<
"PROVENANCE: 1 NUM_COMMENTS: 1\n";
3687 s <<
"PROVENANCE: 1 COMMENT: Original field system log\n#\n";
3695 s <<
"# ScanIdx Data_on UTC start Data_on UTC end Source ScanName\n";
3696 s <<
"# YYYY.DD.MM-hh:mm:ss.ff YYYY.DD.MM-hh:mm:ss.ff\n";
3702 << qPrintable(str.sprintf(
"%6d ", i+1) +
3716 s <<
"#\nCABLE_SIGN: " << (
cableSign_<0?
"-1":
"+1") <<
"\n";
3722 if (reportAllReadings)
3729 s <<
"#\nNUM_CABLE: " << numOfRecs <<
"\n";
3731 s <<
"# CblIdx UTC Date Cable delay Source ScanName\n";
3732 s <<
"# YYYY.DD.MM-hh:mm:ss.ff s\n";
3740 scanIdx = sOn->
getIdx() + 1;
3741 if (reportAllReadings || sOn)
3743 s <<
"CABLE: " << qPrintable(str.sprintf(
"%6d ", scanIdx));
3746 str.sprintf(
" %12.5E ", cc->
getV()) +
3759 if (reportAllReadings)
3766 s <<
"#\nNUM_METEO: " << numOfRecs <<
"\n";
3768 s <<
"# MeteoIdx UTC Date Temp Pres Humid ScanIdx Source Scan\n";
3769 s <<
"# YYYY.DD.MM-hh:mm:ss.ff K Pa %\n";
3779 scanIdx = sOn->
getIdx() + 1;
3780 if (reportAllReadings || sOn)
3783 << qPrintable(str.sprintf(
"%7d ", meteoIdx+1))
3785 << qPrintable(QString(
"").sprintf(
"%6.2f %7.1f %5.1f ",
3789 << qPrintable(str.sprintf(
"%6d ", scanIdx))
3806 if (setup2use == CSU_NATIVE)
3814 else if (setup2use == CSU_VGOS)
3822 else if (setup2use == CSU_SKED && channelSkeded->
stnCfgByKey_.contains(stnKey))
3824 else if (setup2use == CSU_NONE)
3829 s <<
"# No TP_SENSOR data available\n";
3839 if (reportAllReadings)
3841 for (
int i=0; i<
tSyses_.size(); i++)
3842 if (
tSyses_.at(i)->getTsys().size())
3846 for (
int i=0; i<
tSyses_.size(); i++)
3847 if (
tSyses_.at(i)->getOsRec() &&
tSyses_.at(i)->getTsys().size())
3850 s <<
"#\nNUM_TSYS: " << numOfRecs <<
"\n";
3852 s <<
"# ScanIdx UTC_Time_tag Sensor Tsys Azimuth Elevat Source Scan DataScopeFlag\n";
3853 s <<
"# YYYY.DD.MM-hh:mm:ss.ff tag K deg deg\n";
3857 for (
int i=0; i<
tSyses_.size(); i++)
3866 double dt=1.0e3, d=0.0;
3868 for (
int j=0; j<tsr->
trakls().size(); j++)
3869 if (tsr->
trakls().at(j) &&
3870 (d=fabs(tsr->
getT() - tsr->
trakls().at(j)->getT())) < dt)
3873 trakl = tsr->
trakls().at(j);
3875 if (trakl && dt < 4.0/
DAY2SEC)
3877 az = trakl->
getAz();
3878 el = trakl->
getEl();
3889 scanIdx = osRec->
getIdx() + 1;
3892 if (reportAllReadings || osRec)
3898 QString sensorKey(it.key());
3902 if (tsr->
getTsys().contains(sensorKey))
3904 v = tsr->
getTsys().value(sensorKey);
3907 if (!supressNonUsedSensors || hasSensor)
3910 str.sprintf(
"TSYS: %6d %s TS_%03d %7.1f %9.4f %8.4f %s %s %s",
3913 qPrintable(srcName.leftJustified(8,
' ')),
3914 qPrintable(scnName.leftJustified(9,
' ')),
3915 qPrintable(dataFlag[dataFlagIdx])
3932 if (reportAllReadings)
3934 for (
int i=0; i<
tSyses_.size(); i++)
3935 if (
tSyses_.at(i)->getTpcont().size())
3939 for (
int i=0; i<
tSyses_.size(); i++)
3940 if (
tSyses_.at(i)->getOsRec() &&
tSyses_.at(i)->getTpcont().size())
3943 s <<
"#\nNUM_TPI: " << numOfRecs <<
"\n";
3945 s <<
"# ScanIdx UTC_Time_tag Sensor TpiOn TpiOff Azimuth Elevat Source Scan DataScopeFlag\n";
3946 s <<
"# YYYY.DD.MM-hh:mm:ss.ff tag K K deg deg\n";
3949 for (
int i=0; i<
tSyses_.size(); i++)
3958 double dt=1.0e3, d=0.0;
3959 for (
int j=0; j<tsr->
trakls().size(); j++)
3960 if (tsr->
trakls().at(j) &&
3961 (d=fabs(tsr->
getT() - tsr->
trakls().at(j)->getT())) < dt)
3964 trakl = tsr->
trakls().at(j);
3966 if (trakl && dt < 4.0/
DAY2SEC)
3968 az = trakl->
getAz();
3969 el = trakl->
getEl();
3980 scanIdx = osRec->
getIdx() + 1;
3983 if (reportAllReadings || osRec)
3989 QString sensorKey(it.key());
3993 if (tsr->
getTpcont().contains(sensorKey))
3995 vOn = tsr->
getTpcont().value(sensorKey)[0];
3996 vOf = tsr->
getTpcont().value(sensorKey)[1];
3999 if (!supressNonUsedSensors || hasSensor)
4002 str.sprintf(
"TPI: %6d %s TS_%03d %8d %8d %9.4f %8.4f %s %s %s",
4004 idx, vOn, vOf, az, el,
4005 qPrintable(srcName.leftJustified(8,
' ')),
4006 qPrintable(scnName.leftJustified(9,
' ')),
4007 qPrintable(dataFlag[dataFlagIdx]));
4025 if (reportAllReadings)
4026 numOfRecs =
pcals_.size();
4028 for (
int i=0; i<
pcals_.size(); i++)
4029 if (
pcals_.at(i)->getOsRec())
4032 s <<
"#\nNUM_PCAL: " << numOfRecs <<
"\n";
4037 s <<
"# ScanIdx UTC_Time_tag SensInd Ampl Phase Source Scan DataScopeFlag\n";
4038 s <<
"# YYYY.DD.MM-hh:mm:ss.ff rad [0,2pi)\n";
4041 for (
int i=0; i<
pcals_.size(); i++)
4053 scanIdx = osRec->
getIdx() + 1;
4056 if (reportAllReadings || osRec)
4065 if (pcr->
getPcal().contains(it.value()))
4067 vAmp = *pcr->
getPcal().value(it.value());
4068 vPhs = *(pcr->
getPcal().value(it.value()) + 1);
4069 vPhs = fmodf(vPhs + 360.0, 360.0)/
RAD2DEG;
4072 if (!supressNonUsedSensors || hasSensor)
4075 str.sprintf(
"PCAL: %6d %s PC_%03d %8.3f %10.5f %s %s %s",
4078 qPrintable(srcName.leftJustified(8,
' ')),
4079 qPrintable(scnName.leftJustified(9,
' ')),
4080 qPrintable(dataFlag[dataFlagIdx]));
4094 s <<
"# Timer Board\n";
4101 QString id(it.value());
4102 str.sprintf(
"FMT2GPS_TIMER: TMR_%03d %s",
4103 idx, qPrintable(
id) );
4109 if (reportAllReadings)
4116 s <<
"#\nNUM_FMTGPS: " << numOfRecs <<
"\n";
4118 s <<
"# Scan UTC_Time_tag Timer Formatter minus Source Scan\n";
4119 s <<
"# Idx tag GPS time\n";
4120 s <<
"# YYYY.DD.MM-hh:mm:ss.ff s\n";
4134 scanIdx = osRec->
getIdx() + 1;
4137 if (reportAllReadings || osRec)
4151 if (!supressNonUsedSensors || hasSensor)
4153 str.sprintf(
"FMTGPS: %6d %s TMR_%03d %16.9e %s %s",
4156 qPrintable(srcName.leftJustified(8,
' ')),
4157 qPrintable(scnName.leftJustified(9,
' ')) );
4175 if (reportAllReadings)
4182 s <<
"#\nNUM_TPC: " << numOfRecs <<
"\n";
4184 s <<
"# ScanIdx UTC_Time_tag Sensor Gain TpCalOn TpCalOff SEFD Azimuth Elevat Source Scan DataScopeFlag\n";
4185 s <<
"# YYYY.DD.MM-hh:mm:ss.ff tag Jy deg deg\n";
4204 scanIdx = osRec->
getIdx() + 1;
4207 if (reportAllReadings || osRec)
4213 double vGain, vOn, vOf, vSefd;
4214 vGain = vOn = vOf = vSefd =
dFiller_;
4215 QString bbcId(it.value());
4216 #if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
4217 QString sbId(it.value().at(it.value().size() - 1));
4219 QString sbId(it.value().back());
4232 else if (sbId ==
"u")
4241 "::createAntCalFile(): station " + stnKey +
4242 ": got an unknown sideband id: \"" + sbId +
"\", IF id is \"" +
4246 if (!supressNonUsedSensors || hasSensor)
4249 str.sprintf(
"TPC: %6d %s TS_%03d %8.1f %10.1f %10.1f %10.1f %9.4f %8.4f %s %s %s",
4251 idx, vGain, vOn, vOf, vSefd, az, el,
4252 qPrintable(srcName.leftJustified(8,
' ')),
4253 qPrintable(scnName.leftJustified(9,
' ')),
4254 qPrintable(dataFlag[dataFlagIdx])
4271 s <<
"#\nNUM_SEFD: " <<
sefds_.size() <<
"\n#\n";
4272 s <<
"# some docs on OnOff measurements can be found in FS sources, fs-master/onoff/onoff.txt\n";
4273 s <<
"# and fs-master/onoff/gain.txt\n";
4275 s <<
"# Sensor UTC_Time_tag SEFD Tsys Tcal Trat Gain Az El Source\n";
4276 s <<
"# tag YYYY.DD.MM-hh:mm:ss.ff Jy K Jy Compress deg deg\n";
4279 for (
int i=0; i<
sefds_.size(); i++)
4290 QString sensorKey(it.key());
4291 double v2, v3, v4, v5, v6;
4296 const QVector<double>
4307 "::createAntCalFile(): station " + stnKey +
4308 ": the sensor key \"" + sensorKey +
"\" is not found in the SEFD map");
4309 if (!supressNonUsedSensors || hasSensor)
4311 str.sprintf(
"SEFD: TS_%03d %s %10.3f %10.3f %10.3f %10.3f %10.3f %9.4f %9.4f %s",
4315 qPrintable(srcName));
4327 s <<
"# End of file\n";
4352 "(\\d{2}\\.?\\d{0,3})\\D+");
4354 "\\d{1,2}\\s+\\d{1,2}\\s+[\\d\\.eEdD+-]{1,}\\s+[\\dA-Z+-]{2,}\\s+\\d{3}-\\d{4}[a-z]?\\s*$");
4356 "d{1,2}\\s+\\d{1,2}\\s+\\d{1,2}\\s+[+-]?[\\d\\.]{1,}\\s+[+-]?[\\d\\.]{1,}\\s+[+-]?[\\d\\.]{1,}\\s*$");
4364 return "SgStnLogCollector";
4373 inputLogFileName_(
""),
4403 const SgMJD& tFirst,
const SgMJD& tLast,
const QString& orderOfMeteo)
4414 QString sScanName(
"");
4415 QString sSourceName(
"");
4416 QString versionStr(
"");
4421 SgMJD tRightMargin(tLast + 5.0/24.0/60.0);
4422 SgMJD tAtTheEnd(tLast - 75.0/24.0/60.0);
4423 SgMJD tAtTheBegin(tFirst - 7.0/24.0/60.0);
4425 bool isDataOn, isOnSource, reachedEndOfSession, hasStnName;
4427 hasStnName = (0 < stnName.size());
4436 if (orderOfMeteo.size())
4439 for (
int i=0; i<orderOfMeteo.size(); i++)
4441 if (orderOfMeteo.at(i) ==
'T')
4446 else if (orderOfMeteo.at(i) ==
'P')
4451 else if (orderOfMeteo.at(i) ==
'H')
4458 "::readLogFile(): the order of meteoparamters is set to \"" + str +
"\"");
4467 QRegularExpression reOnSource(
":preob|#trakl#\\s*Source acquired|"
4468 "#flagr#flagr/antenna,acquired|&preob/onsource|&preob/track",
4469 QRegularExpression::CaseInsensitiveOption);
4470 QRegularExpression reDataOn(
":data_valid=on|data start\\W+|:midob",
4471 QRegularExpression::CaseInsensitiveOption);
4472 QRegularExpression reDataOff(
":data_valid=off|data stop\\W+|;terminate|;halt|:postob",
4473 QRegularExpression::CaseInsensitiveOption);
4475 QRegularExpression reTapeOn(
"/tape\\d?/.*moving,.*(?:nostop|locked)",
4476 QRegularExpression::CaseInsensitiveOption);
4477 QRegularExpression reTapeOff(
"/tape\\d?/.*(?:stopped,.*unlocked|moving,.*stop|"
4478 "stopped,.*stop)", QRegularExpression::CaseInsensitiveOption);
4480 QRegularExpression reScanName(
":scan_name=([_a-zA-Z0-9+-]{1,}),([a-zA-Z0-9_+-]+),?.*",
4481 QRegularExpression::CaseInsensitiveOption);
4482 QRegularExpression reSourceName(
":source=([\\.a-zA-Z0-9_+-]{1,10}),.*",
4483 QRegularExpression::CaseInsensitiveOption);
4485 QRegularExpression reMeteo(
"(#wx#/WX/|/?wx/|DSNWX/|wx/weather:)([^,]+),([^,]+),([^,]+).*",
4486 QRegularExpression::CaseInsensitiveOption);
4488 QRegularExpression reCableCal(
"(/cable/|cableget/)(.+)",
4489 QRegularExpression::CaseInsensitiveOption);
4491 QRegularExpression reCableLong(
"(/cablelong/)(.+)",
4492 QRegularExpression::CaseInsensitiveOption);
4493 QRegularExpression reVersion(
"(mark\\s+.+\\s+field system\\s+v\\w*\\s*)(.+)",
4494 QRegularExpression::CaseInsensitiveOption);
4497 QRegularExpression reCableDiff(
"((?:/|;\"*\\s*)cable\\s*diff(?:/|;*\\s*))([^,]+),([+-])",
4498 QRegularExpression::CaseInsensitiveOption);
4500 QRegularExpression reCableSign(
"(c\\w?a\\w?b\\w?l\\w?e\\w?|ca\\w{2,2}e)\\s+sign\\s+is\\s+"
4501 "(positive|negative)", QRegularExpression::CaseInsensitiveOption);
4502 QRegularExpression reCableDiffIs(
"cable\\s+dif{1,2}e\\w{2,3}ce\\s+(?:is|was)",
4503 QRegularExpression::CaseInsensitiveOption);
4504 QRegularExpression reOpComments(
"\\d+;\"(.+)", QRegularExpression::CaseInsensitiveOption);
4507 QRegularExpression rePcmt(
"(\\d{4})\\s+(\\d{1,2})\\s+(\\d{1,2})\\s+"
4508 "(\\d{1,2})\\s+(\\d{1,2})\\s+(\\d{1,2})\\s+"
4509 "(.+)\\s+([\\dA-Z+-]{2,8})\\s+([0-9a-z-]{0,}).*",
4510 QRegularExpression::CaseInsensitiveOption);
4513 QRegularExpression reMet(
"(\\d{2,4})\\s+(\\d{1,2})\\s+(\\d{1,2})\\s+"
4514 "(\\d{1,2})\\s+(\\d{1,2})\\s+(\\d{1,2})\\s+"
4515 "([\\d\\.+-]+)\\s+([\\d\\.+-]+)\\s+([\\d\\.+-]+).*",
4516 QRegularExpression::CaseInsensitiveOption);
4518 QRegularExpression reCdms(
"([/#]CDMS/)(.+)", QRegularExpression::CaseInsensitiveOption);
4525 QRegularExpression reTsys(
"([/#]tsys/)([^,]+),([^,]+).*",
4526 QRegularExpression::CaseInsensitiveOption);
4536 QRegularExpression reTsysVgos(
"(#rdtc\\w#tsys/ )([^,]+),([^,]+).*");
4543 QRegularExpression reTpcontVgos(
"(#rdtc\\w#tpcont/ )([^,]+),([^,]+).*");
4553 QRegularExpression rePcalVgos(
"(#rdtc\\w#pcal/ )([^,]+),([^,]+).*");
4560 QRegularExpression reSefd(
"#onoff#VAL\\s+([\\.\\d\\w+-]+)\\s+([\\.\\d+-]+)\\s+"
4561 "([\\.\\d+-]+)\\s+([\\w\\d]+)\\s+([\\w\\d]+)\\s+([\\w\\d]+)\\s+([\\.\\d+-]+)\\s+([\\.\\d+-]+)\\s+"
4562 "([\\.\\d+-]+)\\s+([\\.\\d+-]+)\\s+([\\.\\d+-]+)\\s+([\\.\\d+-]+).*");
4569 QRegularExpression reDot2gpsVgos(
"#rdtc(\\w)#dot2gps/\\s*([0-9eEdD\\.+-]+).*");
4574 QRegularExpression reVc(
"(/vc)([0-9]{2})=([0-9\\.]+),([^,]+).*");
4581 QRegularExpression rePatch(
"([&].+/\"?patch=lo)([^,]+),([^,]+).*");
4583 QRegularExpression reLo(
"([&].+/\"?lo=lo)([^,]+),([0-9\\.]+),(\\w)+,(\\w)+.*");
4588 QRegularExpression reLoRxg(
"[\\d](/lo/rxg,\\s*lo)([^,]+),\\s*([a-zA-Z0-9\\.+-]+),\\s*(\\w)+,\\s*(\\w)+.*");
4606 QRegularExpression reChanSkyFreq(
"&setup.*/\"channel\\s+sky\\s+freq.*");
4607 QRegularExpression reChanSkyFreqValues(
"&setup.*/\"\\s+([0-9]+)\\s+([0-9\\.]+)\\s+"
4608 "([0-9\\.]+)\\s+([0-9\\.]+).*");
4615 QRegularExpression reVci(
"(/\"?vci)([0-9]{2})=([0-9\\.]+),([^,]+).*");
4624 QRegularExpression reBbc(
"([&].+(?:/|=d)bbc)([0-9]+)=([0-9\\.]+),([^,]+).*");
4627 QRegularExpression reDbbc3Tp(
"/dbbc3/dbbc(\\d{3})/\\s*([0-9\\.+-]+),([^,]+),(\\d+),(\\d+),"
4628 "(\\w+),(\\d+),(\\d+),(\\d+),(\\d+),(\\d+),(\\d+);.*");
4634 QRegularExpression reTrakl(
"#trakl#\\[az\\s+([\\.0-9+-]+)\\s+el\\s+([\\.0-9+-]+)\\s+azv"
4635 "\\s+([\\.0-9+-]+)\\s+elv\\s+([\\.0-9+-]+)\\s+mjd\\s+"
4636 "([\\.0-9+-]+)\\s+s\\s+([\\.0-9+-]+)\\s+ms\\s+"
4637 "([\\.0-9+-]+)\\s*\\]");
4639 QRegularExpression reProcedureDecl(
"[\\.0-9+-]{2}:\"%\\s+define\\s+(\\S+).*");
4641 QRegularExpression reEndOfSchd(
":(sched_end|\\*end of schedule).*");
4644 QRegularExpression reProc(
";proc=(\\S+)");
4650 QRegularExpression reEquip(
"\\d{2}.equip1{0,1},([^,]+),([^,]+),(.+)");
4654 QString procName(
"");
4656 QString backEndName(
"");
4657 QString recorderName(
"");
4660 bool isProcedureContentMode;
4661 QMap<QString, QString> procedureNameByName;
4663 QRegularExpression reProcedures(
"");
4664 QRegularExpression reProcedureContent(
"");
4665 QString currentProcedureName(
"");
4666 QString currentProcedureTimeStamp(
"");
4674 str =
"#trakl#(?!\\[az)|#rdtc.#(?!";
4684 str +=
")|#antcn#(?!/wx)|\\d[:/]mk6a[=/]/";
4687 str =
"#trakl#(?!\\[az)|#rdtc.#|#antcn#(?!/wx)|\\d[:/]mk6a[=/]/";
4690 QRegularExpression re2skip(str);
4694 QRegularExpression reLocation(
";location,(\\S{1,8})\\s*,\\s*([-+\\.\\d]+)\\s*,"
4695 "\\s*([-+\\.\\d]+)\\s*,\\s*([-+\\.\\d]+).*", QRegularExpression::CaseInsensitiveOption);
4696 bool hasLocation=
false;
4700 QRegularExpression reStnId(
"\\d:\"\\s+([A-Z0-9]{1,6})\\s+([0-9]{4})\\s+"
4701 "([_A-Z0-9-]{2,8})\\s+([A-Z0-9])\\s+([A-Z0-9][a-z0-9+-])");
4707 bool hasVersionStr, hasCableSign, needCableSign;
4708 int val, numOfSkippedStrs, numOfReadStrs, numOfProcedureExpanded;
4716 QRegularExpressionMatch match;
4720 if ((tLast - tFirst) < 3.0/24.0)
4721 tAtTheEnd = tLast - 5.0/24.0/60.0;
4724 numOfSkippedStrs = numOfReadStrs = numOfProcedureExpanded = 0;
4726 have2checkT =
false;
4727 hasVersionStr = hasCableSign = needCableSign =
false;
4728 hasProc = hasEquip =
false;
4731 needCableSign =
true;
4740 "::readLogFile(): the log file " + fileName +
" does not exist");
4747 "::readLogFile(): station \"" +
stationName_ +
"\": reading log file " + fileName);
4752 if (fileName.right(9).toLower() ==
".cdms.dat")
4754 else if (fileName.right(4).toLower() ==
".dat" && fileName.toLower().contains(
".pcmt."))
4756 else if (fileName.right(8).toLower() ==
".met.dat")
4764 reachedEndOfSession =
false;
4769 hasProcedures =
false;
4770 isProcedureContentMode =
false;
4772 flogSize = QFileInfo(fileName).size();
4777 bool have2reportNumOfStrings;
4779 while (!s.atEnd() && !reachedEndOfSession)
4781 if (procedureContent.size())
4783 str = currentProcedureTimeStamp +
"&" + currentProcedureName +
"/" + procedureContent.takeFirst();
4784 if (procedureContent.size() == 0)
4786 currentProcedureName =
"";
4787 currentProcedureTimeStamp =
"";
4797 if (have2reportNumOfStrings && numOfReadStrs%100000 == 0)
4798 std::cout <<
" -- read " << numOfReadStrs/1000 <<
"K strings file size: " << flogSize <<
"\n";
4801 if (str.right(4) ==
"\\par")
4807 numOfTries++>10 && str.size())
4811 ": cannot determine the time mark format after " + QString(
"").setNum(numOfTries) +
4812 " tries, the log file: " + fileName);
4822 if (!hasVersionStr && (match=reVersion.match(str)).hasMatch())
4824 versionStr = match.captured(0);
4826 hasVersionStr =
true;
4831 if(str.size()==0 || re2skip.match(str).hasMatch())
4837 if ((match=rePcmt.match(str)).hasMatch() &&
4855 if (tRightMargin <= t && (!needCableSign || hasCableSign) )
4857 reachedEndOfSession =
true;
4860 ": got to the end of the session: " +
4867 versionStr =
"PCMT or CDMS file";
4868 hasVersionStr =
true;
4875 if ((match=reMet.match(str)).hasMatch() &&
4880 if (tRightMargin <= t && (!needCableSign || hasCableSign))
4882 reachedEndOfSession =
true;
4885 ": got to the end of the session: " +
4892 versionStr =
"External file with meteo data";
4893 hasVersionStr =
true;
4901 if ((match=reProcedureDecl.match(str)).hasMatch())
4903 hasProcedures =
true;
4904 procedureNameByName.insert(match.captured(1), match.captured(1));
4905 str =
"[\\.0-9]{2}:(";
4906 for (QMap<QString, QString>::iterator it=procedureNameByName.begin();
4907 it!=procedureNameByName.end(); ++it)
4908 str += it.key() +
"|";
4910 reProcedures.setPattern(str +
")");
4913 ": found declaration of procedure \"" + match.captured(1) +
"\"");
4916 else if (hasProcedures && (match=reProcedures.match(str)).hasMatch())
4919 if (isProcedureContentMode && currentProcedureName.size() &&
4921 procedureNameByName.contains(currentProcedureName) )
4924 procedureNameByName.remove(currentProcedureName);
4926 strTmp =
"[\\.0-9]{2}:(";
4927 for (QMap<QString, QString>::iterator it=procedureNameByName.begin();
4928 it!=procedureNameByName.end(); ++it)
4929 strTmp += it.key() +
"|";
4931 reProcedures.setPattern(strTmp +
")");
4934 ": procedure \"" + currentProcedureName +
4935 "\" is empty, removed from the substitution pool");
4937 currentProcedureName = match.captured(1);
4942 for (
int i=0; i<prc->
content().size(); i++)
4943 procedureContent.append(prc->
content().at(i));
4945 numOfProcedureExpanded++;
4951 isProcedureContentMode =
true;
4952 reProcedureContent.setPattern(
"[\\.0-9]{2}&" + currentProcedureName +
"/(.*)");
4955 ": found content of procedure \"" + currentProcedureName +
"\"");
4958 else if (isProcedureContentMode)
4964 if ((match=reProcedureContent.match(str)).hasMatch())
4965 prc->
content().append(match.captured(1));
4970 ": collected content of procedure \"" + currentProcedureName +
"\", " +
4971 QString(
"").setNum(prc->
content().size()) +
" record(s) total");
4975 procedureNameByName.remove(currentProcedureName);
4977 strTmp =
"[\\.0-9]{2}:(";
4978 for (QMap<QString, QString>::iterator it=procedureNameByName.begin();
4979 it!=procedureNameByName.end(); ++it)
4980 strTmp += it.key() +
"|";
4982 reProcedures.setPattern(strTmp +
")");
4985 ": procedure \"" + currentProcedureName +
4986 "\" is empty, removed from the substitution pool");
4988 isProcedureContentMode =
false;
4989 currentProcedureName =
"";
4990 currentProcedureTimeStamp =
"";
4996 ": cannot find procedure \"" + currentProcedureName +
"\" in the map; input: \"" +
5001 else if ((match=reProc.match(str)).hasMatch() &&
extractEpoch(str, t))
5006 procName = match.captured(1);
5008 else if (procName != match.captured(1))
5010 if (procName.size())
5013 ": proc has changed: \"" + procName +
"\" => \"" + match.captured(1) +
5015 procName = match.captured(1);
5016 if (tRightMargin <= t && (!needCableSign || hasCableSign))
5018 reachedEndOfSession =
true;
5021 ": got to the end of the session: " +
5027 if ((match=reEquip.match(str)).hasMatch() &&
extractEpoch(str, t))
5029 if (backEndName.size() && backEndName != match.captured(1))
5033 ": equip (backEnd) has changed: \"" + backEndName +
"\" => \"" + match.captured(1) +
5036 backEndName = match.captured(1);
5038 if (recorderName.size() && recorderName != match.captured(2))
5042 ": equip (recorder) has changed: \"" + recorderName +
"\" => \"" + match.captured(2) +
5045 recorderName = match.captured(2);
5048 if (backEndName ==
"dbbc3")
5050 if (backEndName.contains(
"dbbc3_"))
5052 else if (backEndName ==
"dbbc")
5054 else if (backEndName ==
"rdbe")
5059 else if (backEndName ==
"none")
5075 if ((match=reStnId.match(str)).hasMatch())
5077 stationName_ = match.captured(3).leftJustified(8,
' ');
5082 ": found a name of the station (from \"stnId\"): \"" +
stationName_ +
"\"");
5087 if ((match=reLocation.match(str)).hasMatch())
5091 stationName_ = match.captured(1).leftJustified(8,
' ');
5095 ": found a name of the station (from \"location\"): \"" +
stationName_ +
"\"");
5101 ": the station name from \"location\" (\"" + match.captured(1) +
5102 "\") is different");
5107 if (have2checkT &&
extractEpoch(str, t) && tRightMargin <= t && (!needCableSign || hasCableSign))
5109 reachedEndOfSession =
true;
5112 ": got to the end of the session: " +
5117 if (reEndOfSchd.match(str).hasMatch() &&
extractEpoch(str, t) && tFirst < t &&
5118 (!needCableSign || hasCableSign))
5120 reachedEndOfSession =
true;
5123 ": got to the end of the session: end of schedule at " +
5127 if (reachedEndOfSession)
5133 if (reOnSource.match(str).hasMatch() ||
5134 reTapeOn.match(str).hasMatch() )
5142 if (tRightMargin <= t && (!needCableSign || hasCableSign))
5144 reachedEndOfSession =
true;
5147 ": got to the end of a session: " +
5157 ": got unexpected `source on' record; string: \"" +
asciifyString(str) +
"\"");
5160 else if ((match=reScanName.match(str)).hasMatch())
5165 "::readLogFile(): station " +
stationName_ +
": the scan name \"" +
5166 osRec->
getScanName() +
"\" will be replaced with \"" + match.captured(1) +
5167 "\", looks like discontinuity in the log file");
5172 ": the scan is not empty: size of cable cal list is " +
5173 QString(
"").setNum(osRec->
cableCals().size()));
5177 ": the scan is not empty: size of meteo parameters list is " +
5178 QString(
"").setNum(osRec->
meteoPars().size()));
5183 if (match.captured(2).size())
5190 ": the experiment name has been changed: \"" +
5192 match.captured(2) +
"\"");
5196 ": found experiment name: \"" + match.captured(2) +
"\"");
5202 else if ((match=reSourceName.match(str)).hasMatch()
5215 "\" will be replaced with \"" + match.captured(1).toUpper() +
5216 "\", looks like discontinuity in the log file");
5225 else if (reDataOff.match(str).hasMatch() ||
5226 reTapeOff.match(str).hasMatch() )
5233 if (tRightMargin <= t && (!needCableSign || hasCableSign))
5235 reachedEndOfSession =
true;
5238 ": got to the end of a session: " +
5252 "::readLogFile(): station " +
stationName_ +
": the scan name \"" +
5254 "\" too short and cannot be used; the `data_valid=off' string: \"" +
5267 ": got unexpected data_valid=off record; string: \"" +
asciifyString(str) +
"\"");
5277 QRegularExpression reNotUserComments(
";\"(?:/| Command from |FiLa10G:|Flexbuff:|"
5278 "start transferring scan|Error opening connection to FILA10G|"
5279 "Error opening connection to flexbuff|.+\\s+1pps diff:).*",
5280 QRegularExpression::CaseInsensitiveOption);
5281 QRegularExpression reFilter1(
";\"\\s*Comment from\\s+'\\w+\\(?\\d?\\)?':\\s+\""
5282 "\\s+CHECKLIST\\(?\\w*\\)?:\\s+(\\b.+)", QRegularExpression::CaseInsensitiveOption);
5283 QRegularExpression reFilter2(
";\"\\s*CHECKLIST:\\s+(.+)",
5284 QRegularExpression::CaseInsensitiveOption);
5285 QRegularExpression reFilter3(
";\"\\s*Comment from\\s+'\\w+\\(?\\w*\\)?':\\s+\"\\s+(\\b.+)",
5286 QRegularExpression::CaseInsensitiveOption);
5287 QRegularExpression reFilterLast(
";\"\\s*(\\b.+)",
5288 QRegularExpression::CaseInsensitiveOption);
5289 if (reOpComments.match(str).hasMatch())
5294 if (!reNotUserComments.match(strTmp).hasMatch())
5296 if ((match=reFilter1.match(strTmp)).hasMatch())
5297 strTmp = match.captured(1);
5298 else if ((match=reFilter2.match(strTmp)).hasMatch())
5299 strTmp = match.captured(1);
5300 else if ((match=reFilter3.match(strTmp)).hasMatch())
5301 strTmp = match.captured(1);
5302 else if ((match=reFilterLast.match(strTmp)).hasMatch())
5303 strTmp = match.captured(1);
5305 if (strTmp.size() < 100)
5309 QStringList sLst=strTmp.split(QRegExp(
"\\s"));
5311 for (
int i=0; i<sLst.size(); i++)
5313 sAux +=
" " + sLst.at(i);
5314 if (sAux.size() > 81)
5328 if ((match=reTrakl.match(str)).hasMatch())
5342 if (pTs->
trakls().size() < 10)
5351 else if (reTsysVgos.match(str).hasMatch())
5353 QMap<QString, float> tsys;
5357 if (0.3/
DAY2SEC < fabs(lastReadTsys - t))
5361 tsr->
setOsRec(isOnSource?osRec:NULL);
5374 if (tsr->
trakls().size() < 5)
5388 else if (reTpcontVgos.match(str).hasMatch())
5390 QMap<QString, QVector<int> >
5395 if (0.2/
DAY2SEC < fabs(lastReadTsys - t))
5399 tsr->
setOsRec(isOnSource?osRec:NULL);
5412 if (tsr->
trakls().size() < 5)
5427 else if (rePcalVgos.match(str).hasMatch())
5429 QMap<QString, float*> pcals;
5433 if (0.2/
DAY2SEC < fabs(lastReadPcal - t))
5437 pcr->
setOsRec(isOnSource?osRec:NULL);
5446 ": got duplicate pcals; input: \"" +
asciifyString(str) +
"\"");
5449 for (QMap<QString, float*>::iterator it=pcals.begin(); it!=pcals.end(); ++it)
5450 delete[] it.value();
5455 else if ((match=reDot2gpsVgos.match(str)).hasMatch())
5457 float dot2gps=1.0e20;
5464 if (0.2/
DAY2SEC < fabs(lastReadDot2xps - t))
5468 d2r->
setOsRec(isOnSource?osRec:NULL);
5478 ": got duplicate dot2gps; input: \"" +
asciifyString(str) +
"\"");
5480 lastReadDot2xps = t;
5484 else if ((match=reDbbc3Tp.match(str)).hasMatch())
5488 QString sensorId(match.captured( 1));
5489 QString boardId(match.captured( 3));
5490 QString agc(match.captured( 6));
5500 bw = match.captured( 4).toDouble();
5501 gainU = match.captured( 7).toDouble();
5502 gainL = match.captured( 8).toDouble();
5503 tpOffU = match.captured( 9).toDouble();
5504 tpOffL = match.captured(10).toDouble();
5505 tpOnU = match.captured(11).toDouble();
5506 tpOnL = match.captured(12).toDouble();
5507 sensorId= sensorId.simplified().rightJustified(5,
' ');
5508 QString chanKey=
setupTpSensor(sensorId +
'l',
"readLogFile()");
5515 if (1.0/
DAY2SEC < fabs(lastReadTsys - t))
5519 tp->
setOsRec(isOnSource?osRec:NULL);
5527 tp->
addRecord(sensorId, boardId, bw, agc, gainU, gainL, tpOffU, tpOffL, tpOnU, tpOnL,
5533 "::readLogFile(): station " +
stationName_ +
": parsing chanKey has failed for \"" +
5534 sensorId +
'u' +
"\"; input: \"" +
asciifyString(str) +
"\"");
5538 "::readLogFile(): station " +
stationName_ +
": parsing chanKey has failed for \"" +
5539 sensorId +
'l' +
"\"; input: \"" +
asciifyString(str) +
"\"");
5543 else if ((match=reSefd.match(str)).hasMatch())
5548 QVector<double> vec;
5552 if (0.3/
DAY2SEC < fabs(lastReadSefd - t))
5559 ": got duplicate SEFD; input: \"" +
asciifyString(str) +
"\"");
5566 else if (wantTsys && reTsys.match(str).hasMatch())
5568 QMap<QString, float> tsys;
5571 if (fabs(lastReadTsys - t) < 0.1/
DAY2SEC)
5578 tsr->
setOsRec(isOnSource?osRec:NULL);
5588 if (tsr->
trakls().size() < 5)
5599 else if (reMeteo.match(str).hasMatch())
5615 else if ((match=reBbc.match(str)).hasMatch())
5620 else if ((match=reVc.match(str)).hasMatch())
5625 else if ((match=rePatch.match(str)).hasMatch())
5629 else if ((match=reLo.match(str)).hasMatch())
5633 else if ((match=reLoRxg.match(str)).hasMatch())
5637 else if ((match=reChanSkyFreqValues.match(str)).hasMatch())
5641 else if ((match=reVci.match(str)).hasMatch())
5648 else if ((match=reCableCal.match(str)).hasMatch())
5653 double scale = 4.0e5;
5665 else if ((match=reCdms.match(str)).hasMatch())
5670 double scale = 2e12;
5683 else if ((match=reCableLong.match(str)).hasMatch())
5685 double scale = 4.0e5;
5690 else if (!hasCableSign)
5693 if ((match=reCableDiff.match(str)).hasMatch())
5698 hasCableSign =
true;
5701 ": the cable calibration sign was set to \"" +
5706 else if (reCableSign.match(str).hasMatch())
5708 if (str.contains(
"positive", Qt::CaseInsensitive))
5711 hasCableSign =
true;
5714 ": the cable calibration sign was set to \"+\". Source: cable_sign_is");
5716 else if (str.contains(
"negative", Qt::CaseInsensitive))
5719 hasCableSign =
true;
5722 ": the cable calibration sign was set to \"-\". Source: cable_sign_is");
5726 "::readLogFile(): station " +
stationName_ +
": cannot determine proper cable sign "
5727 "from cable_sign_is pattern; input: \"" +
asciifyString(str) +
"\"");
5729 else if (reCableDiffIs.match(str).hasMatch())
5731 if (str.contains(
"positive", Qt::CaseInsensitive) ||
5732 str.contains(
"larger", Qt::CaseInsensitive) )
5735 hasCableSign =
true;
5738 ": the cable calibration sign was set to \"+\". Source: cable_diff_is");
5740 else if ( str.contains(
"negative", Qt::CaseInsensitive) ||
5741 str.contains(
"smaller", Qt::CaseInsensitive) )
5744 hasCableSign =
true;
5747 ": the cable calibration sign was set to \"-\". Source: cable_diff_is");
5752 ": cannot determine proper cable sign from cable_diff_is pattern; input: \"" +
5768 "::readLogFile(): station " +
stationName_ +
": picked up not finished onSource record");
5774 "::readLogFile(): station " +
stationName_ +
": no proc record has been found in the log file");
5776 if (operatorComments.size())
5779 "::readLogFile(): station " +
stationName_ +
": collected operator's comments: ");
5780 for (
int i=0; i<operatorComments.size(); i++)
5782 "::readLogFile(): station " +
stationName_ +
": " + operatorComments.at(i));
5787 if (flogSize < 1024)
5789 str.setNum(flogSize);
5792 else if (flogSize < 1048576)
5794 str.setNum(flogSize/1024);
5797 else if (flogSize < 1073741824)
5799 str.setNum(flogSize/1048576);
5804 str.setNum(flogSize/1073741824);
5808 "::readLogFile(): station " +
stationName_ +
": " + QString(
"").setNum(numOfReadStrs) +
5809 " strings of the log file (" + str +
") were read" +
5810 (numOfSkippedStrs>1?
" (" + QString(
"").setNum(numOfSkippedStrs) +
" strings were skipped)":
""));
5812 "::readLogFile(): station " +
stationName_ +
": the log file version: " + versionStr);
5813 if (numOfProcedureExpanded)
5816 "::readLogFile(): station " +
stationName_ +
": " + QString(
"").setNum(numOfProcedureExpanded) +
5817 " time(s) procedure(s) were expanded:");
5821 "::readLogFile(): station " +
stationName_ +
": " + it.value()->getName() +
": " +
5822 QString(
"").setNum(it.value()->getNumOfExpanded()));
5825 "::readLogFile(): station " +
stationName_ +
": collected " +
5831 "::readLogFile(): station " +
stationName_ +
": collected " +
5834 "::readLogFile(): station " +
stationName_ +
": collected " +
5838 "::readLogFile(): station " +
stationName_ +
": collected " +
5850 "::readLogFile(): station " +
stationName_ +
": collected " +
5852 " meteo records from RINEX files");
5855 "::readLogFile(): station " +
stationName_ +
": nothing to get from RINEX files");
5869 else if (
reFsNew_.match(str).hasMatch())
5871 else if (
reFsOld_.match(str).hasMatch())
5873 else if (
rePcmt_.match(str).hasMatch())
5875 else if (
reMet_.match(str).hasMatch())
5888 int nYear=0, nMonth=0, nDay=0, nHour=0, nMin=0;
5889 double dSecond=0.0, f=0.0;
5891 QRegularExpressionMatch match;
5898 if (
reFsOld_.match(str).hasMatch())
5900 nDay = str.mid(0,3).toInt(&isOk);
5903 nHour = str.mid(3,2).toInt(&isOk);
5906 nMin = str.mid(5,2).toInt(&isOk);
5909 dSecond = str.mid(7,2).toInt(&isOk);
5919 "::extractEpoch(): looks like not OLD FS format, string: \"" +
asciifyString(str) +
"\"");
5926 if (
reFsNew_.match(str).hasMatch())
5928 nYear = str.mid(0,2).toInt(&isOk);
5931 nDay = str.mid(2,3).toInt(&isOk);
5934 nHour = str.mid(5,2).toInt(&isOk);
5937 nMin = str.mid(7,2).toInt(&isOk);
5940 dSecond = str.mid(9,2).toInt(&isOk);
5943 f = str.mid(11,2).toInt(&isOk);
5947 nYear += (nYear>68)?1900:2000;
5959 "::extractEpoch(): looks like not NEW FS format, string: \"" +
asciifyString(str) +
"\"");
5972 nYear = match.captured(1).toInt(&isOk);
5975 nDay = match.captured(2).toInt(&isOk);
5978 nHour = match.captured(3).toInt(&isOk);
5981 nMin = match.captured(4).toInt(&isOk);
5984 dSecond = match.captured(5).toDouble(&isOk);
6021 "::extractEpoch(): looks like not NEWEST FS format, string: \"" +
asciifyString(str) +
"\"");
6029 if (
rePcmt_.match(str).hasMatch())
6031 QStringList l=str.split(QRegExp(
"\\s+"));
6034 nYear = l.at(0).toInt(&isOk);
6037 nMonth = l.at(1).toInt(&isOk);
6040 nDay = l.at(2).toInt(&isOk);
6043 nHour = l.at(3).toInt(&isOk);
6046 nMin = l.at(4).toInt(&isOk);
6048 dSecond = l.at(5).toDouble(&isOk);
6056 "::extractEpoch(): not enough data for PCMT format, the string: \"" +
6064 "::extractEpoch(): looks like not PCMT format, the string: \"" +
asciifyString(str) +
"\"");
6079 "::extractEpoch(): year has changed: " + QString(
"").setNum(
inYear_) +
" => " +
6080 QString(
"").setNum(nYear) +
"; input: \"" +
asciifyString(str) +
"\"");
6095 "::extractEpoch(): looks like FS format has changed NEWEST=>NEW: \"" +
6109 "::extractEpoch(): looks like FS format has changed NEW=>OLD: \"" +
asciifyString(str) +
"\"");
6116 "::extractEpoch(): failed to parse, string: \"" +
asciifyString(str) +
"\"");
6120 t.
setUpEpoch(nYear, nMonth, nDay, nHour, nMin, dSecond);
6130 return content.size() > 0;
6157 QString metStr(str.mid(reMeteo.match(str).capturedEnd(1)));
6159 if (metStr.contains(
"C"))
6160 metStr = metStr.remove(
"C");
6161 if (metStr.contains(
"mB"))
6162 metStr = metStr.remove(
"mB");
6163 if (metStr.contains(
"%"))
6164 metStr = metStr.remove(
"%");
6165 if (metStr.contains(
"weather:"))
6166 metStr = metStr.remove(
"weather:");
6171 "::extractMeteoReading(): cannot extract meteo data from \"" +
asciifyString(str) +
"\"");
6176 QStringList lst=metStr.split(
",");
6180 const QString &strT =lst.at(oom[0]);
6181 const QString &strP =lst.at(oom[1]);
6182 const QString &strRh=lst.at(oom[2]);
6184 d = strT.toDouble(&isOk);
6187 if (-50.0<=d && d<=80.0)
6190 d = strP.toDouble(&isOk);
6197 "::extractMeteoReading(): the extracted atmospheric pressure looks suspicious: " +
6198 QString(
"").setNum(d) +
"hPa (i.e.,==std.atm.); skipped");
6200 else if (d >= 500.0)
6203 d = strRh.toDouble(&isOk);
6206 if (-9.9<=d && d<=120.0)
6211 "::extractMeteoReading(): the extracted relative humidity looks suspicious: " +
6212 QString(
"").setNum(d) +
"%; adjusted it to zero");
6218 "::extractMeteoReading(): the extracted relative humidity looks suspicious: " +
6219 QString(
"").setNum(d) +
"%; adjusted it to 100%");
6229 "::extractMeteoReading(): the extracted relative humidity looks unrealstic: " +
6230 QString(
"").setNum(d) +
"%; skipped");
6233 else if (strRh.contains(
"EE.0", Qt::CaseInsensitive))
6237 "::extractMeteoReading(): forcefully set relative humidity to 1.00 from the string \"" +
6242 "::extractMeteoReading(): failed to extract relative humidity from \"" + strRh +
"\"");
6248 "::extractMeteoReading(): the extracted atmospheric pressure is too low: " +
6249 QString(
"").setNum(d) +
"hPa; skipped");
6254 "::extractMeteoReading(): failed to extract pressure from \"" + strP +
"\"");
6260 "::extractMeteoReading(): the extracted atmospheric temperature looks unreal: " +
6261 QString(
"").setNum(d) +
"C; skipped");
6266 "::extractMeteoReading(): failed to extract temperature: from \"" + strT +
"\"");
6270 "::extractMeteoReading(): the number of data less than 3: \"" + metStr +
"\"");
6281 QString bbcStr(str.mid(match.capturedEnd(2) + 1));
6282 QString bbcId(match.captured(2));
6287 if (nearTheEnd <= t)
6292 cIdx = bbcId.toInt(&isOk);
6297 ": cannot convert \"" + bbcId +
"\" to int; input: \"" +
asciifyString(str) +
"\"");
6301 QStringList lst=bbcStr.split(
",");
6331 if (3 <= lst.size())
6335 d = lst.at(0).toDouble(&isOk);
6340 ": cannot convert \"" + lst.at(0) +
"\" to double; input: \"" +
6350 ": IF frequency has changed for BBC #" + bbcId +
": " +
6351 QString(
"").sprintf(
"%.2f => %.2f", cs.
bbcFreqByIdx()[cIdx], d) +
6357 d = lst.at(2).toDouble(&isOk);
6362 ": cannot convert \"" + lst.at(2) +
"\" to double; input: \"" +
6371 ": IF bandwidth has changed for BBC #" + bbcId +
": " +
6386 ": got an unexpected \"bbc\" record; input: \"" +
asciifyString(str) +
"\"");
6394 ": the number of data less than 3: \"" + bbcStr +
"\"");
6408 QString vcStr(str.mid(match.capturedEnd(2) + 1));
6413 if (nearTheEnd <= t)
6416 QString bbcId(match.captured(2));
6419 cIdx = bbcId.toInt(&isOk);
6424 ": cannot convert \"" + bbcId +
"\" to int; input: \"" +
asciifyString(str) +
"\"");
6428 QStringList lst=vcStr.split(
",");
6454 d = lst.at(0).toDouble(&isOk);
6459 ": cannot convert \"" + lst.at(0) +
"\" to double; input: \"" +
6469 ": video frequency has changed for IF #" + bbcId +
": " +
6470 QString(
"").sprintf(
"%.2f => %.2f", cs.
bbcFreqByIdx()[cIdx], d) +
6478 d = lst.at(1).toDouble(&isOk);
6483 ": cannot convert \"" + lst.at(2) +
"\" to double; input: \"" +
6493 ": bandwidth has changed for IF #" + bbcId +
": " +
6505 ": got unexpected \"vc\" record; input: \"" +
asciifyString(str) +
"\"");
6513 ": the number of data less than 2: \"" + vcStr +
"\"");
6526 QString loStr(str.mid(match.capturedEnd(1)));
6531 if (nearTheEnd <= t)
6535 QString loId(match.captured(2));
6536 QStringList lst=loStr.split(
",");
6543 if (4 <= lst.size())
6546 d = lst.at(1).toDouble(&isOk);
6551 ": cannot convert \"" + lst.at(1) +
"\" to double; input: \"" +
asciifyString(str) +
"\"");
6559 "::extractLoReading(): station " +
stationName_ +
": LO frequency changed for LO \"" + loId +
6561 QString(
"").sprintf(
"%.2f", cs.
loFreqById()[loId]) +
" => " +
6562 QString(
"").sprintf(
"%.2f", d) +
"; input: \"" +
asciifyString(str) +
"\"");
6565 const QString &sb=lst.at(2);
6566 const QString &pz=lst.at(3);
6570 else if (sb ==
"lsb")
6577 ": cannot figure out side band form the string \"" +
asciifyString(str) +
"\"");
6582 else if (pz ==
"lcp")
6589 ": cannot figure out polarization form the string \"" +
asciifyString(str) +
"\"");
6601 ": the number of data less than 4: \"" + loStr +
"\"");
6615 QString loStr(str.mid(match.capturedEnd(1)));
6620 if (nearTheEnd <= t)
6624 QString loId(match.captured(2));
6625 QStringList lst=loStr.split(
",");
6635 if (3 <= lst.size())
6638 d = lst.at(1).toDouble(&isOk);
6643 ": cannot convert \"" + lst.at(1) +
"\" to double; input: \"" +
asciifyString(str) +
"\"");
6650 "::extractLoRxgReading(): station " +
stationName_ +
": frequency changed for LO \"" + loId +
6652 QString(
"").sprintf(
"%.2f", cs.
loFreqById()[loId]) +
" => " +
6653 QString(
"").sprintf(
"%.2f", d) +
"; input: \"" +
asciifyString(str) +
"\"");
6657 const QString &pz=lst.at(2);
6662 else if (pz ==
"lcp")
6667 ": cannot figure out polarization form the string \"" +
asciifyString(str) +
"\"");
6672 "::extractLoRxgReading(): station " +
stationName_ +
": polarization changed for LO \"" +
6682 ": the number of data less than 3: \"" + loStr +
"\"");
6695 QString patchStr(str.mid(match.capturedEnd(1)));
6699 if (nearTheEnd <= t)
6703 QStringList lst=patchStr.split(
",");
6715 QString loId(lst.at(0));
6717 for (
int i=1; i<lst.size(); i++)
6719 QString cid(lst.at(i));
6720 QChar sb(cid.at(cid.size() - 1));
6721 if (sb ==
'l' || sb ==
'h')
6725 cIdx = cid.toInt(&isOk);
6730 ": cannot convert \"" + cid +
"\" to int; input: \"" +
asciifyString(str) +
"\"");
6760 const QRegularExpressionMatch& match,
6765 if (nearTheEnd <= t)
6770 double skyFrq=-1.0, loFrq=-1.0, videoFrq=-1.0;
6771 QString bbcId(match.captured(1));
6773 cIdx = bbcId.toInt(&isOk);
6777 "::extractChanSkyFrqReading(): station " +
stationName_ +
6778 ": cannot get channel index; input: \"" +
asciifyString(str) +
"\"");
6781 skyFrq = match.captured(2).toDouble(&isOk);
6785 "::extractChanSkyFrqReading(): station " +
stationName_ +
6786 ": cannot get sky frequency; input: \"" +
asciifyString(str) +
"\"");
6789 loFrq = match.captured(3).toDouble(&isOk);
6793 "::extractChanSkyFrqReading(): station " +
stationName_ +
6794 ": cannot get LO frequency; input: \"" +
asciifyString(str) +
"\"");
6797 videoFrq = match.captured(4).toDouble(&isOk);
6801 "::extractChanSkyFrqReading(): station " +
stationName_ +
6802 ": cannot get video frequency; input: \"" +
asciifyString(str) +
"\"");
6806 QString loId(
""), cId(
"");
6807 char sbIds[2] = {
'l',
'u'};
6820 for (
int i=0; i<2; i++)
6822 cId = QString(
"").sprintf(
"%02d%c", cIdx, sbIds[i]);
6828 "::extractChanSkyFrqReading(): station " +
stationName_ +
6829 ": video frequency has changed for IF #" + bbcId +
": " +
6830 QString(
"").sprintf(
"%.2f => %.2f", cs.
bbcFreqByIdx()[cIdx], videoFrq) +
6839 if (1.0e-2 < fabs(loFrq + videoFrq - skyFrq))
6841 "::extractChanSkyFrqReading(): station " +
stationName_ +
6842 ": got unexpected frequency setup; input: \"" +
asciifyString(str) +
"\"");
6853 "::extractChanSkyFrqReading(): station " +
stationName_ +
6854 ": got unexpected \"setup\" record (expected type #" + QString(
"").setNum(cs.
getHwType()) +
6870 QString targetStr(str.mid(match.capturedEnd(2) + 1));
6875 if (nearTheEnd <= t)
6880 QString bbcId(match.captured(2));
6881 cIdx = bbcId.toInt(&isOk);
6886 ": cannot convert \"" + bbcId +
"\" to int; input: \"" +
asciifyString(str) +
"\"");
6891 QStringList lst=targetStr.split(
",");
6892 if (2 <= lst.size())
6896 d = lst.at(0).toDouble(&isOk);
6900 "::extractVciReading(): station " +
stationName_ +
": cannot convert \"" + lst.at(0) +
6912 ": video frequency has changed for IF #" + bbcId +
": " +
6913 QString(
"").sprintf(
"%.2f => %.2f", cs.
bbcFreqByIdx()[cIdx], d) +
6918 QString ss(lst.at(1));
6921 QString pc(ss.at(ss.size() - 1));
6939 d = ss.toDouble(&isOk);
6943 "::extractVciReading(): station " +
stationName_ +
": cannot convert \"" + lst.at(2) +
6954 "::extractVciReading(): station " +
stationName_ +
": found unused channel #" +
6955 QString(
"").sprintf(
"%02d", cIdx) +
6956 ", attached it to the LO \"b\"; input: \"" +
asciifyString(str) +
"\"");
6966 ": got unexpected \"vci\" record; input: \"" +
asciifyString(str) +
"\"");
6974 ": the number of data less than 2; input: \"" +
asciifyString(str) +
"\"");
6984 SgMJD& t, QMap<QString, float>& tSys,
const SgMJD& tAtTheBegin)
6988 QRegularExpression reNoData(
"\\$+");
6989 QRegularExpression reNotASensor(
"i([0-9A-Za-z])+");
6990 QRegularExpression reDualSideBand(
"([0-9A-Za-z])+d");
6995 if (t < tAtTheBegin)
6998 QRegularExpressionMatch match;
6999 QString tsysStr(str.mid(reTsys.match(str).capturedEnd(1)));
7001 if (!tsysStr.size())
7005 ": cannot extract tsys data from \"" +
asciifyString(str) +
"\"");
7010 QStringList lst=tsysStr.split(
",");
7014 ": got odd number of tsys readings: \"" +
asciifyString(str) +
"\"");
7017 int numOfRecs=lst.size()/2;
7018 for (
int i=0; i<numOfRecs; i++)
7020 const QString &strIdx=lst.at(2*i);
7021 const QString &strVal=lst.at(2*i + 1);
7022 QString chanId(strIdx);
7028 if (!reNotASensor.match(strIdx).hasMatch())
7030 if (reNoData.match(strVal).hasMatch())
7036 f = strVal.toFloat(&isOk);
7039 QString sensorKey(
"");
7041 if ((match=reDualSideBand.match(strIdx)).hasMatch())
7043 QString sss(match.captured(1));
7044 sensorKey =
setupTpSensor(sss +
"u",
"extractTsysReading()");
7045 if (sensorKey.size())
7047 tSys.insert(sensorKey, f);
7053 sensorKey =
setupTpSensor(sss +
"l",
"extractTsysReading()");
7054 if (sensorKey.size())
7056 tSys.insert(sensorKey, f);
7066 if (sensorKey.size())
7067 tSys.insert(sensorKey, f);
7074 "::extractTsysReading(): station " +
stationName_ +
": tsysVal #" + QString(
"").setNum(i) +
7075 " is empty of tsys readings: \"" +
asciifyString(str) +
"\"");
7080 "::extractTsysReading(): station " +
stationName_ +
": chanKey #" + QString(
"").setNum(i) +
7081 " is empty of tsys readings: \"" +
asciifyString(str) +
"\"");
7091 SgMJD& t, QMap<QString, float>& tSys,
const SgMJD& tAtTheBegin)
7095 QRegularExpression reNoData(
"\\$+");
7096 QRegularExpression reNoChan(
"(AV|SM)(\\w)(\\d)");
7100 if (t < tAtTheBegin)
7103 QString tsysStr(str.mid(reTsys.match(str).capturedEnd(1)));
7105 if (!tsysStr.size())
7108 "::extractTsysVgosReading(): station " +
stationName_ +
7109 ": cannot extract tsys data from \"" +
asciifyString(str) +
"\"");
7114 QStringList lst=tsysStr.split(
",");
7117 "::extractTsysVgosReading(): station " +
stationName_ +
7118 ": got odd number of tsys readings: \"" +
asciifyString(str) +
"\"");
7128 int numOfRecs=lst.size()/2;
7129 for (
int i=0; i<numOfRecs; i++)
7131 const QString &strIdx=lst.at(2*i);
7132 const QString &strVal=lst.at(2*i + 1);
7138 if (!reNoChan.match(strIdx).hasMatch() && !reNoData.match(strIdx).hasMatch())
7140 if (reNoData.match(strVal).hasMatch())
7146 f = strVal.toFloat(&isOk);
7150 QString sensorKey=
setupTpSensor(strIdx,
"extractTsysVgosReading()");
7151 if (sensorKey.size())
7152 tSys.insert(sensorKey, f);
7158 "::extractTsysVgosReading(): station " +
stationName_ +
": tsysVal #" + QString(
"").setNum(i) +
7159 " is empty of tsys readings: \"" +
asciifyString(str) +
"\"");
7163 "::extractTsysVgosReading(): station " +
stationName_ +
": chanKey #" + QString(
"").setNum(i) +
7164 " is empty of tsys readings: \"" +
asciifyString(str) +
"\"");
7172 "::extractTsysVgosReading(): station " +
stationName_ +
7173 ": got an unexpected \"bbc\" record; input: \"" +
asciifyString(str) +
"\"");
7185 const double rdbeChannelBandwidth=32.0;
7198 double loFreq=-9999.9, ifFreq=-9999.9, ifBw=-9.9;
7202 QString chanId(sensorTag.simplified().rightJustified(6,
' '));
7204 QChar cSideBand(
'-');
7205 QString sFreqSfx(
""), sPlrzSfx(
"x"), sLoSBndSfx(
"x"), sIfSBndSfx(
"x");
7211 QString cPlrz=sensorTag.at(sensorTag.size() - 1);
7212 QString cBand=sensorTag.at(sensorTag.size() - 2);
7213 QString sIdx =sensorTag.left(sensorTag.size() - 2);
7214 loId = QString(cBand) + cPlrz;
7220 else if (cBand ==
'b')
7222 else if (cBand ==
'c')
7224 else if (cBand ==
'd')
7226 else if (cBand ==
'e')
7228 else if (cBand ==
'f')
7230 else if (cBand ==
'g')
7232 else if (cBand ==
'h')
7238 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7239 ": get unexpected LO key \"" + cBand +
7244 sensorIdx = sIdx.toInt(&isOk);
7246 sensorIdx += offset;
7250 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7251 ": cannot convert \"" + sIdx +
"\" to int; the tag is \"" +
7258 else if (cPlrz ==
'1')
7264 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7265 ": cannot figure out RDBE polarization from \"" + cPlrz +
"\"; the tag is: \"" +
7270 ifFreq = 512.0 + rdbeChannelBandwidth/2.0 + rdbeChannelBandwidth*(sensorIdx%16);
7272 ifFreq = 512.0 + rdbeChannelBandwidth/2.0 + rdbeChannelBandwidth*(15 - sensorIdx%16);
7276 ifBw = rdbeChannelBandwidth;
7280 QString sIdx=sensorTag.left(sensorTag.size() - 1);
7281 cSideBand = sensorTag.at(sensorTag.size() - 1);
7286 sensorIdx = sIdx.toInt(&isOk);
7288 sensorIdx = sIdx.toInt(&isOk, 16);
7291 sensorIdx = sIdx.toInt(&isOk, 16);
7295 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7296 ": cannot convert \"" + sIdx +
"\" to int; the tag is \"" +
7297 sensorTag +
"\", other");
7306 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7307 ": cannot find LO id for the sensorIdx " + QString(
"").setNum(sensorIdx) +
7308 "; the tag is \"" + sensorTag +
"\"");
7317 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7318 ": LO polarization for LO \"" + loId +
"\" is not defined; the tag is: \"" +
7329 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7330 ": cannot find BBC frequency for the sensorIdx " + QString(
"").setNum(sensorIdx) +
7331 "; the tag is \"" + sensorTag +
"\"");
7340 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7341 ": cannot find BBC bandwidth for the sensorIdx " + QString(
"").setNum(sensorIdx) +
7342 "; the tag is \"" + sensorTag +
"\"");
7346 if (cSideBand.toLower() ==
'u')
7348 else if (cSideBand.toLower() ==
'l')
7350 else if (cSideBand.toLower() ==
'd')
7355 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7356 ": cannot guess sideband; the tag is \"" + sensorTag +
"\"");
7368 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7369 ": LO frequency for LO \"" + loId +
"\" is not defined; the tag is: \"" +
7376 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7377 ": LO sideband for LO \"" + loId +
"\" is not defined; the tag is: \"" +
7386 sFreqSfx.sprintf(
"%08.1f-%08.1f:%05.1f", loFreq, ifFreq, ifBw);
7394 QString sensorKey(
"");
7395 sensorKey.sprintf(
"%08.1f-", skyFrq);
7397 sensorKey += sPlrzSfx +
'-' + loId +
'-' + sLoSBndSfx +
'-' + sIfSBndSfx +
'-' + chanId +
'-' + sFreqSfx;
7411 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7412 ": got new LO ID \"" + loId +
"\" for sensor key \"" + sensorKey +
7430 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7431 ": got new LO frequency " +
7432 QString(
"").sprintf(
"%8.1f", loFreq) +
" for sensor \"" +
7433 chanId +
"\", with the sensor key \"" + sensorKey +
7434 "\", the previous one is " +
7451 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7452 ": got new LO sideband " +
7454 chanId +
"\", with the sensor key \"" + sensorKey +
7455 "\", the previous one is " +
7471 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7472 ": got new LO polarization " +
7474 chanId +
"\", with the sensor key \"" + sensorKey +
7475 "\", the previous one is " +
7493 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7494 ": got new IF frequency " +
7495 QString(
"").sprintf(
"%8.1f", ifFreq) +
" for sensor \"" +
7496 chanId +
"\", with the sensor key \"" + sensorKey +
7497 "\", the previous one is " +
7515 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7516 ": got new IF bandwidth " +
7517 QString(
"").sprintf(
"%8.1f", ifBw) +
" for sensor \"" +
7518 chanId +
"\", with the sensor key \"" + sensorKey +
7519 "\", the previous one is " +
7536 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7538 chanId +
", for the channel key \"" + sensorKey +
7555 if (cs.
ifIdxById()[chanId] != sensorIdx)
7558 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7559 ": got new value, " +
7560 QString(
"").setNum(sensorIdx) +
", for the channel id \"" + chanId +
7561 "\", the previous one is " +
7562 QString(
"").setNum(cs.
ifIdxById()[chanId]) +
7584 "::setupTpSensor(): station " +
stationName_ +
", caller " + callerName +
7585 ": got new sideband, " +
7586 sideBand2Str(ifSBnd) +
", for the channel id \"" + chanId +
7587 "\", the previous one is " +
7605 SgMJD& t, QMap<QString, QVector<int> >& tPcont,
const SgMJD& tAtTheBegin)
7610 QRegularExpression reNoData(
"\\$+");
7616 if (t < tAtTheBegin)
7619 QString tpcontStr(str.mid(reTpcont.match(str).capturedEnd(1)));
7621 if (!tpcontStr.size())
7624 "::extractTpcontVgosReading(): station " +
stationName_ +
7625 ": cannot extract tpcont data from \"" +
asciifyString(str) +
"\"");
7630 QStringList lst=tpcontStr.split(
",");
7633 "::extractTpcontVgosReading(): station " +
stationName_ +
7634 ": got odd number of tpcont readings: \"" +
asciifyString(str) +
"\"");
7646 int numOfRecs=lst.size()/3;
7647 for (
int i=0; i<numOfRecs; i++)
7649 const QString &strIdx=lst.at(3*i);
7650 const QString &strValOn=lst.at(3*i + 1);
7651 const QString &strValOf=lst.at(3*i + 2);
7653 if (strIdx.size() && strValOn.size() && strValOf.size())
7655 if (reNoData.match(strValOn).hasMatch())
7661 nOn = strValOn.toInt(&isOk);
7663 if (isOk && reNoData.match(strValOf).hasMatch())
7669 nOf = strValOf.toInt(&isOk);
7673 QString sensorKey=
setupTpSensor(strIdx,
"extractTpcontVgosReading()");
7677 if (sensorKey.size())
7678 tPcont.insert(sensorKey, QVector<int>(v));
7683 if (strIdx.size() == 0)
7685 "::extractTpcontVgosReading(): station " +
stationName_ +
": chanKey #" + QString(
"").setNum(i) +
7686 " is empty of tpcont readings: \"" +
asciifyString(str) +
"\"");
7688 if (strValOn.size())
7690 "::extractTpcontVgosReading(): station " +
stationName_ +
": tpcalon #" + QString(
"").setNum(i) +
7691 " is empty of tpcont readings: \"" +
asciifyString(str) +
"\"");
7693 if (strValOf.size())
7695 "::extractTpcontVgosReading(): station " +
stationName_ +
": tpcaloff #" + QString(
"").setNum(i) +
7696 " is empty of tpcont readings: \"" +
asciifyString(str) +
"\"");
7706 "::extractTpcontVgosReading(): station " +
stationName_ +
7707 ": got an unexpected \"bbc\" record; input: \"" +
asciifyString(str) +
"\"");
7718 SgMJD& t, QMap<QString, float*>& pcal,
const SgMJD& tAtTheBegin)
7723 QRegularExpression reNoData(
"\\$+");
7729 if (t < tAtTheBegin)
7732 QString pcalStr(str.mid(rePcal.match(str).capturedEnd(1)));
7734 if (!pcalStr.size())
7737 "::extractPcalVgosReading(): station " +
stationName_ +
7738 ": cannot extract tpcont data from \"" +
asciifyString(str) +
"\"");
7743 QStringList lst=pcalStr.split(
",");
7746 "::extractPcalVgosReading(): station " +
stationName_ +
7747 ": got odd number of tpcont readings: \"" +
asciifyString(str) +
"\"");
7762 int numOfRecs=lst.size()/3;
7763 for (
int i=0; i<numOfRecs; i++)
7765 const QString &strIdx=lst.at(3*i).simplified();
7766 const QString &strValAm=lst.at(3*i + 1);
7767 const QString &strValPh=lst.at(3*i + 2);
7768 QString chanId(strIdx.simplified().rightJustified(8,
' '));
7771 if (strIdx.size() && strValAm.size() && strValPh.size())
7773 if (reNoData.match(strValAm).hasMatch())
7779 dAmp = strValAm.toFloat(&isOk);
7781 if (isOk && reNoData.match(strValPh).hasMatch())
7787 dPhs = strValPh.toFloat(&isOk);
7791 QChar cPlrz(strIdx.at(0));
7792 QChar cBand(strIdx.at(1));
7796 else if (cBand ==
'b')
7798 else if (cBand ==
'c')
7800 else if (cBand ==
'd')
7807 else if (cPlrz ==
'1')
7813 "::extractPcalVgosReading(): station " +
stationName_ +
7814 ": cannot figure out polarization from \"" + strIdx.at(strIdx.size() - 1) +
7818 idx = strIdx.mid(2).toInt(&isOk);
7824 QString chanKey(
"");
7826 chanKey = cBand +
'-' + cPlrz +
'-' + chanId;
7834 "::extractPcalVgosReading(): station " +
stationName_ +
": get new id, " +
7835 chanId +
", for the channel key \"" + chanKey +
7836 "\", the previous one is " +
7845 float *f=
new float[2];
7854 "::extractPcalVgosReading(): station " +
stationName_ +
": cannot convert str \"" +
7855 strIdx.mid(2) +
"\" to int; input: \"" +
asciifyString(str) +
"\"");
7860 if (strIdx.size() == 0)
7862 "::extractPcalVgosReading(): station " +
stationName_ +
": sensorKey #" + QString(
"").setNum(i) +
7863 " is empty of tpcont readings: \"" +
asciifyString(str) +
"\"");
7865 if (strValAm.size())
7867 "::extractPcalVgosReading(): station " +
stationName_ +
": amplitude #" + QString(
"").setNum(i) +
7868 " is empty of tpcont readings: \"" +
asciifyString(str) +
"\"");
7870 if (strValPh.size())
7872 "::extractPcalVgosReading(): station " +
stationName_ +
": phase #" + QString(
"").setNum(i) +
7873 " is empty of tpcont readings: \"" +
asciifyString(str) +
"\"");
7884 const QRegularExpressionMatch& match,
SgMJD& t, QString& sKey,
float& dot2gps,
7885 const SgMJD& tAtTheBegin)
7892 if (t < tAtTheBegin)
7895 sKey = match.captured(1);
7897 QString cap3(match.captured(2));
7899 f = cap3.toFloat(&isOk);
7904 "::extractDot2xpsVgosReading(): station " +
stationName_ +
": cannot convert \"" + cap3 +
7924 if (t < tAtTheBegin)
7931 if ((s=match.captured(1)).size())
7933 d = s.toDouble(&isOk);
7937 ": cannot convert to double: \"" + s +
"\"; input: \"" +
asciifyString(str) +
"\"");
7941 if ((s=match.captured(2)).size())
7943 d = s.toDouble(&isOk);
7947 ": cannot convert to double: \"" + s +
"\"; input: \"" +
asciifyString(str) +
"\"");
7951 if ((s=match.captured(3)).size())
7953 d = s.toDouble(&isOk);
7957 ": cannot convert to double: \"" + s +
"\"; input: \"" +
asciifyString(str) +
"\"");
7961 if ((s=match.captured(4)).size())
7963 d = s.toDouble(&isOk);
7967 ": cannot convert to double: \"" + s +
"\"; input: \"" +
asciifyString(str) +
"\"");
7978 SgMJD& t, QString& sensorId, QString& srcName,
double& az,
double& de, QVector<double>& vec,
7979 const SgMJD& tAtTheBegin)
7983 QString sensorTag(match.captured(4));
7986 QRegularExpression notATag(
"i[A-Za-z0-9]");
7990 if (t < tAtTheBegin)
7992 if (notATag.match(sensorTag).hasMatch())
7999 srcName = match.captured(1);
8000 QString sensorKey=
setupTpSensor(sensorTag,
"extractSefdReading()");
8001 if (!sensorKey.size())
8005 sensorId = sensorKey;
8008 if ((s=match.captured(2)).size())
8010 d = s.toDouble(&isOk);
8014 ": cannot convert to double: \"" + s +
"\"; input: \"" +
asciifyString(str) +
"\"");
8019 if ((s=match.captured(3)).size())
8021 d = s.toDouble(&isOk);
8025 ": cannot convert to double: \"" + s +
"\"; input: \"" +
asciifyString(str) +
"\"");
8030 for (
int i=0; i<6; i++)
8032 if ((s=match.captured(7 + i)).size())
8034 d = s.toDouble(&isOk);
8038 ": cannot convert to double: \"" + s +
"\"; input: \"" +
asciifyString(str) +
"\"");
8050 SgMJD& t,
double& v)
8056 QString strCableVal(match.captured(2));
8059 if (strCableVal.endsWith(
'-'))
8060 strCableVal.chop(1);
8061 v = strCableVal.toDouble(&isOk);
8064 "::extractCableCalibration(): failed to extract cable calibration value from \"" +
8065 strCableVal +
"\"");
8066 else if (fabs(v) > 1.0e6)
8071 "::extractCableCalibration(): the exctracted value looks suspicious: \"" +
8072 strCableVal +
"\", skipped");
8083 const QRegularExpressionMatch& match,
SgMJD& t,
double& v, QString& source, QString& scan)
8085 int nYear=0, nMonth=0, nDay=0, nHour=0, nMin=0;
8086 double dSecond=0.0, f=0.0;
8090 nYear = match.captured(1).toInt(&isOk);
8093 nMonth = match.captured(2).toInt(&isOk);
8096 nDay = match.captured(3).toInt(&isOk);
8099 nHour = match.captured(4).toInt(&isOk);
8102 nMin = match.captured(5).toInt(&isOk);
8105 dSecond = match.captured(6).toDouble(&isOk);
8107 t.
setUpEpoch(nYear, nMonth, nDay, nHour, nMin, dSecond);
8115 "::extractDataFromPcmtRecord(): failed to extract epoch from the string \"" +
asciifyString(str) +
"\"");
8119 f = match.captured(7).toDouble(&isOk);
8123 source = match.captured(8);
8124 if (match.lastCapturedIndex() >= 9)
8125 scan = match.captured(9);
8127 std::cout <<
" --- no scan\n";
8131 "::extractDataFromPcmtRecord(): failed to extract cable cal value from the string \"" +
8144 int nYear=0, nMonth=0, nDay=0, nHour=0, nMin=0;
8145 double dSecond=0.0, f=0.0;
8148 nYear = match.captured(1).toInt(&isOk);
8151 nMonth = match.captured(2).toInt(&isOk);
8154 nDay = match.captured(3).toInt(&isOk);
8157 nHour = match.captured(4).toInt(&isOk);
8160 nMin = match.captured(5).toInt(&isOk);
8163 dSecond = match.captured(6).toDouble(&isOk);
8165 t.
setUpEpoch(nYear, nMonth, nDay, nHour, nMin, dSecond);
8173 "::extractDataFromMetRecord(): failed to extract epoch from the string \"" +
8178 f = match.captured(7).toDouble(&isOk);
8182 f = match.captured(8).toDouble(&isOk);
8186 f = match.captured(9).toDouble(&isOk);
8191 "::extractDataFromMetRecord(): failed to extract relative humidity from the string \"" +
8197 "::extractDataFromMetRecord(): failed to extract pressure from the string \"" +
8203 "::extractDataFromMetRecord(): failed to extract temperature from the string \"" +
8218 QString strCableDiff(match.captured(2));
8219 QString strCableSign(match.captured(3));
8221 d = strCableDiff.toDouble(&isOk);
8224 if (fabs(d) < 1.0e6)
8226 if (strCableSign.contains(
"-"))
8228 else if (strCableSign.contains(
"+"))
8232 "::extractCableCalibrationSignByDiff(): get unusable cable sign char sequence: \"" +
8233 strCableSign +
"\"");
8239 "::extractCableCalibrationSignByDiff(): the cable diff is too big: \"" + strCableDiff +
"\"");
8244 "::extractCableCalibrationSignByDiff(): cannot convert diff to double: \"" + strCableDiff +
"\"");
8252 const SgMJD& tFinis,
const QString& rinexStnName)
8254 const QString eoh(
"END OF HEADER");
8255 QString path2Rinex(
"");
8257 int idx=fileName.lastIndexOf(
"/");
8259 path2Rinex = fileName.left(idx);
8261 QDir dir(path2Rinex);
8262 QStringList nameFilters;
8264 nameFilters << rinexStnName +
"*.??m";
8265 QStringList nameList=dir.entryList(nameFilters,
8266 QDir::Files | QDir::Readable, QDir::Name | QDir::IgnoreCase);
8267 if (!nameList.size())
8270 "::checkRinexFile(): no RINEX file found");
8275 "::checkRinexFile(): processing RINEX files for the station " +
stationName_);
8283 QRegExp reData(
"\\s*(\\d{1,2})\\s+(\\d{1,2})\\s+(\\d{1,2})\\s+"
8284 "(\\d{1,2})\\s+(\\d{1,2})\\s+(\\d{1,2})\\s+"
8285 "(\\d{1,4}\\.\\d+)\\s+([+-\\.\\d]+)\\s+([+-]?[\\.\\d]+)(?:\\s+|$|-99)",
8286 Qt::CaseInsensitive);
8287 int nYr, nMn, nDy, nHr, nMi, nSc;
8288 double fPr, fTp, fRh;
8299 "::checkRinexFile(): using offset of " + QString(
"").setNum(dP) +
" mbar for atmospheric "
8303 for (
int i=0; i<nameList.size(); i++)
8305 const QString &fn=nameList.at(i);
8308 "::checkRinexFile(): processing " + fn +
" file");
8311 f.setFileName(path2Rinex +
"/" + fn);
8312 if (f.open(QFile::ReadOnly))
8316 while (!s.atEnd() && !str.contains(eoh))
8322 "::checkRinexFile(): skipped " + QString(
"").setNum(idx) +
" strings");
8325 nYr = nMn = nDy = nHr = nMi = nSc = 0;
8326 fPr = fTp = fRh = 0.0;
8328 if (reData.indexIn(str) != -1)
8330 nYr = reData.cap(1).toInt(&isOk);
8333 nMn = reData.cap(2).toInt(&isOk);
8336 nDy = reData.cap(3).toInt(&isOk);
8339 nHr = reData.cap(4).toInt(&isOk);
8342 nMi = reData.cap(5).toInt(&isOk);
8345 nSc = reData.cap(6).toInt(&isOk);
8348 fPr = reData.cap(7).toDouble(&isOk);
8351 fTp = reData.cap(8).toDouble(&isOk);
8354 fRh = reData.cap(9).toDouble(&isOk);
8357 SgMJD t(nYr, nMn, nDy, nHr, nMi, (
double)nSc);
8358 if (tStart<=t && t<= tFinis)
8365 "::checkRinexFile(): the extracted relative humidity looks "
8366 "suspicious: " + QString(
"").setNum(fRh) +
"%; adjusted it to zero");
8369 else if (100.0 < fRh)
8372 "::checkRinexFile(): the extracted relative humidity looks "
8373 "suspicious: " + QString(
"").setNum(fRh) +
"%; adjusted it to 100%");
8387 "::checkRinexFile(): cannot convert relative humidity to double, "
8388 "string=\"" + reData.cap(9) +
"\"");
8392 "::checkRinexFile(): cannot convert temperature to double, string=\"" +
8393 reData.cap(8) +
"\"");
8397 "::checkRinexFile(): cannot convert pressure to double, string=\"" +
8398 reData.cap(7) +
"\"");
8402 "::checkRinexFile(): cannot convert second to int, string=\"" +
8403 reData.cap(6) +
"\"");
8407 "::checkRinexFile(): cannot convert minute to int, string=\"" +
8408 reData.cap(5) +
"\"");
8412 "::checkRinexFile(): cannot convert hour to int, string=\"" + reData.cap(4) +
"\"");
8416 "::checkRinexFile(): cannot convert day to int, string=\"" + reData.cap(3) +
"\"");
8420 "::checkRinexFile(): cannot convert month to int, string=\"" + reData.cap(2) +
"\"");
8424 "::checkRinexFile(): cannot convert year to int, string=\"" + reData.cap(1) +
"\"");
8430 "::checkRinexFile(): extracted " + QString(
"").setNum(count) +
" meteo records from " +
8431 QString(
"").setNum(idx) +
" strings of " + f.fileName() +
" RINEX file");
8436 "::checkRinexFile(): unable to read the file \"" + f.fileName() +
"\"");
8450 bool createAntabFile,
bool overwriteAntabFile,
bool reportAllReadings)
8467 "::propagateData(): the cable calibration data for " + stn->
getKey() +
" are CDMS");
8472 "::propagateData(): both /cable/ and /CDMS/ commands were found for " + stn->
getKey() +
8473 " in the log file");
8489 int numOfReadStrs=0;
8490 bool reachedEndOfSession=
false;
8491 QRegularExpressionMatch match;
8495 QString sEpoch(
"(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):([0-9\\.]+)\\s*UTC\\s*");
8496 QString sSep(
"\\s*,\\s*");
8497 QString sDbl(
"([0-9\\.+-]+)");
8501 QRegularExpression reBbc(sEpoch +
":\\s*BBC(\\d+):\\s*" + sDbl + sSep +
8502 "(\\d+)" + sSep +
"(\\w+)" + sSep +
"(\\d+)" + sSep +
"(\\d+)" + sSep +
"(\\d+)" + sSep +
8503 "(\\d+)" + sSep +
"(\\d+)" + sSep +
"(\\d+)" + sSep +
"SEFDU:\\s*" + sDbl +
"\\s*Jy" + sSep +
8504 "SEFDL:\\s*" + sDbl +
"\\s*Jy.*");
8510 QString sensorId(
"");
8511 int nYr, nMn, nDy, nHr, nMi;
8515 double bbcGainU, bbcGainL;
8516 double bbcTPUOn, bbcTPLOn, bbcTPUOff, bbcTPLOff;
8517 double bbcSEFDU, bbcSEFDL;
8519 bool isDataOn=
false;
8520 bool isOnSource=
false;
8525 fileSize = QFileInfo(fileName).size();
8538 ": previously accumulated dbbc3 TP records were reset");
8543 bool have2reportNumOfStrings=10000000 < fileSize;
8544 while (!s.atEnd() && !reachedEndOfSession)
8549 if (have2reportNumOfStrings && numOfReadStrs%200000 == 0)
8550 std::cout <<
" -- read " << numOfReadStrs/1000 <<
"K strings; file size: " << fileSize <<
"\n";
8554 nYr = nMn = nDy = nHr = nMi = 0;
8555 dSc = ifFrq = bw = bbcGainU = bbcGainL = bbcTPUOn =
8556 bbcTPLOn = bbcTPUOff = bbcTPLOff = bbcSEFDU = bbcSEFDL = 0.0;
8558 if ((match=reBbc.match(str)).hasMatch())
8560 agc = match.captured(10);
8562 nYr = match.captured( 1).toInt();
8563 nMn = match.captured( 2).toInt();
8564 nDy = match.captured( 3).toInt();
8565 nHr = match.captured( 4).toInt();
8566 nMi = match.captured( 5).toInt();
8567 dSc = match.captured( 6).toDouble();
8569 sensorId = match.captured(7).simplified().rightJustified(5,
' ');
8571 ifFrq = match.captured( 8).toDouble();
8572 bw = match.captured( 9).toDouble();
8573 bbcGainU = match.captured(11).toDouble();
8574 bbcGainL = match.captured(12).toDouble();
8575 bbcTPUOn = match.captured(13).toDouble();
8576 bbcTPLOn = match.captured(14).toDouble();
8577 bbcTPUOff = match.captured(15).toDouble();
8578 bbcTPLOff = match.captured(16).toDouble();
8579 bbcSEFDU = match.captured(17).toDouble();
8580 bbcSEFDL = match.captured(18).toDouble();
8586 if (osRec && osRec->
tStart()<t)
8591 if (osRec && osRec->
tDataOn()<t)
8597 if (0.1/
DAY2SEC < fabs(lastReadTsys - t))
8601 tp->
setOsRec(isOnSource?osRec:NULL);
8611 tp->
addRecord(sensorId,
"", bw, agc, bbcGainU, bbcGainL, bbcTPUOff, bbcTPLOff,
8612 bbcTPUOn, bbcTPLOn, bbcSEFDU, bbcSEFDL);
8622 "::readDbbc3DumpFile(): station " +
stationName_ +
": " + QString(
"").setNum(numOfReadStrs) +
8623 " strings of the DBBC3 dump file \"" + fileName +
"\" were read");
8625 "::readDbbc3DumpFile(): station " +
stationName_ +
": collected " +
8649 return "SgVlbaLogCollector";
8670 for (QMap<QString, SgStnLogReadings*>::iterator it=
readingsByKey_.begin();
8684 QString stnPattern(
"([\\w]{2})");
8685 QString srcPattern(
"([\\d\\w+-]{2,8})");
8686 QString epcPattern(
"(\\d{3})(?:-|\\s+)(\\d{2}):(\\d{2}):(\\d{2})");
8687 QString dblPattern(
"([+-\\.\\d]+)");
8689 QRegExp rePulseCalInfo(
"PulseCal information for\\s+" + stnPattern +
"\\s+",
8690 Qt::CaseInsensitive);
8691 QRegExp reScanCalInfo(
"Scan information for\\s+" + stnPattern +
"\\s+",
8692 Qt::CaseInsensitive);
8693 QRegExp reWeatherInfo(
"Weather information for\\s+" + stnPattern +
"\\s+",
8694 Qt::CaseInsensitive);
8695 QRegExp rePulseCalData
8696 (epcPattern +
"\\s+'CC'\\s+" + dblPattern +
"\\s+" + dblPattern,
8697 Qt::CaseInsensitive);
8698 QRegExp reScanCalData
8699 (srcPattern +
"\\s+" + epcPattern +
"\\s+" + epcPattern +
"\\s+" +
8700 dblPattern +
"\\s+" + dblPattern +
"\\s+" + dblPattern,
8701 Qt::CaseInsensitive);
8702 QRegExp rePulseScanData
8703 (
"!\\s+" + stnPattern +
"\\s+([\\w\\d+-]+)\\s+" + srcPattern +
"/(\\d+)\\s+" +
8704 epcPattern +
"/" + epcPattern,
8705 Qt::CaseInsensitive);
8706 QRegExp reWeatherData
8707 (epcPattern +
"\\s+" + dblPattern +
"\\s+" + dblPattern +
"\\s+" + dblPattern +
"\\s+" +
8708 dblPattern +
"\\s+" + dblPattern +
"\\s+" + dblPattern +
"\\s+" + dblPattern,
8709 Qt::CaseInsensitive);
8715 bool have2read, isOk;
8722 "::readLogFile(): the log file " + fileName +
" does not exist");
8728 "::readLogFile(): reading log file " + fileName);
8731 if (f.open(QFile::ReadOnly))
8742 if (rePulseCalInfo.indexIn(str) != -1)
8744 key = rePulseCalInfo.cap(1);
8753 while (!s.atEnd() && !str.contains(
" information "))
8758 if (rePulseCalData.indexIn(str) != -1)
8760 if (
strs2mjd(nYear, rePulseCalData.cap(1), rePulseCalData.cap(2),
8761 rePulseCalData.cap(3), rePulseCalData.cap(4), t))
8763 d = rePulseCalData.cap(5).toDouble(&isOk);
8768 "::readLogFile(): failed to extract cable cal value from PulseCalData: \"" +
8773 "::readLogFile(): failed to extract epoch from PulseCalData: \"" + str +
"\"");
8775 if (rePulseScanData.indexIn(str) != -1)
8777 m = rePulseScanData.cap(4).toInt(&isOk);
8782 if (
strs2mjd(nYear, rePulseScanData.cap(5), rePulseScanData.cap(6),
8783 rePulseScanData.cap(7), rePulseScanData.cap(8), t))
8785 if (
strs2mjd(nYear, rePulseScanData.cap(9), rePulseScanData.cap(10),
8786 rePulseScanData.cap(11), rePulseScanData.cap(12), t_aux))
8801 "::readLogFile(): got a duplicate string of PulseScanData: \"" + str +
"\"");
8807 "::readLogFile(): failed to extract epoch_2 from PulseScanData: \"" + str +
"\"");
8811 "::readLogFile(): failed to extract epoch_1 from PulseScanData: \"" + str +
"\"");
8816 "::readLogFile(): failed to extract qualifier value from PulseCalData: \"" + str +
"\"");
8850 if (reWeatherInfo.indexIn(str) != -1)
8852 key = reWeatherInfo.cap(1);
8861 while (!s.atEnd() && !str.contains(
" information "))
8864 if (reWeatherData.indexIn(str) != -1)
8866 if (
strs2mjd(nYear, reWeatherData.cap(1), reWeatherData.cap(2),
8867 reWeatherData.cap(3), reWeatherData.cap(4), t))
8869 double temp, press, dewpt;
8870 temp = reWeatherData.cap(5).toDouble(&isOk);
8873 press = reWeatherData.cap(6).toDouble(&isOk);
8876 dewpt = reWeatherData.cap(7).toDouble(&isOk);
8882 "::readLogFile(): failed to extract dew point from WeatherData: \"" + str +
"\"");
8886 "::readLogFile(): failed to extract pressure from WeatherData: \"" + str +
"\"");
8890 "::readLogFile(): failed to extract temperature from WeatherData: \"" + str +
"\"");
8894 "::readLogFile(): failed to extract epoch from WeatherData: \"" + str +
"\"");
8904 for (QMap<QString, SgStnLogReadings*>::iterator it=
readingsByKey_.begin();
8914 "::readLogFile(): collected logs of " + QString(
"").setNum(
readingsByKey_.size())+
8915 " stations from the log file");
8917 "::readLogFile(): parsing of the log file has been completed");
8926 const QString& sMin,
const QString& sSec,
SgMJD& t)
8932 dy = sDay.toInt(&isOk);
8935 hr = sHr.toInt(&isOk);
8938 mi = sMin.toInt(&isOk);
8941 se = sSec.toInt(&isOk);
8946 "::strs2mjd(): failed to extract seconds from \"" + sSec + +
"\"");
8950 "::strs2mjd(): failed to extract minutes from \"" + sMin + +
"\"");
8954 "::strs2mjd(): failed to extract hours from \"" + sHr + +
"\"");
8958 "::strs2mjd(): failed to extract days from \"" + sDay +
"\"");
8983 "::propagateData(): cannot find VLBA station " + stn->
getKey() +
" (aka " + vlbaKey +
8984 ") in the log file");
8991 "::propagateData(): cannot find a station " + stn->
getKey() +
" in the map of VLBA stations");
9037 {
"BR",
"CA",
"EB",
"FD",
"GA",
"GT",
"HN",
"JV",
"KP",
"LA",
"MK",
"NL",
"OV",
"PT",
"SC" };
9039 {
"BR-VLBA ",
"CAMBRIDG",
"EFLSBERG",
"FD-VLBA ",
"VLBA85_3",
"GBT-VLBA",
"HN-VLBA ",
9040 "JODRELL2",
"KP-VLBA ",
"LA-VLBA ",
"MK-VLBA ",
"NL-VLBA ",
"OV-VLBA ",
"PIETOWN ",
9058 for (
int i=0; i<str.size(); i++)
9061 n = str.at(i).unicode();
9063 s += QString(
"").sprintf(
"\\0x%04X", n);
SgIoExtFilterHandler compressors
const SgMJD tZero(1957, 10, 4)
#define DAY2SEC
radians to mas:
#define RAD2DEG
< radians to degrees:
QString asciifyString(const QString &str)
#define NUM_OF_VLBA_ENTRIES
SgVersion libraryVersion("SgLib", 0, 7, 5, "Tuscarora (rc1)", SgMJD(2022, 2, 18, 17, 34))
QString polarization2Str(SgChannelPolarization p)
QString sideBand2Str(SgChannelSideBand sb)
bool isAttr(uint a) const
static const QString className()
void setOsRec(SgOnSourceRecord *os)
const SgMJD & getT() const
const SgOnSourceRecord * getOsRec() const
QMap< QString, double > & ifFreqBySensorKey()
QMap< QString, SgChannelSideBand > & ifSideBandById()
QMap< QString, int > & ifIdxById()
QMap< QString, QList< QString > > & origSensorIdById()
QMap< QString, SgChannelPolarization > loPolarizationById_
QMap< QString, SgChannelSideBand > & loSideBandById()
QMap< QString, SgChannelPolarization > & loPolarizationById()
QMap< QString, double > & ifBandwidthBySensorKey()
QMap< QString, SgChannelPolarization > & pcalPolarizationById()
QMap< QString, QString > loIdByCid_
QMap< int, double > & bbcBandwidthByIdx()
void setBackEndType(BackEndType tp)
QMap< QString, QString > & ifIdBySensorKey()
bool selfCheck(const QString &stnKey)
QMap< int, double > & bbcFreqByIdx()
QMap< QString, QString > & xpsIdByKey()
QMap< QString, double > & loFreqById()
QMap< QString, QString > ifIdBySensorKey_
QMap< QString, QString > & pcalIdByKey()
QMap< QString, int > ifIdxById_
static double calcSkyFreq(double loFreq, double bbcFreq, double width, SgChannelSideBand loSideBand, SgChannelSideBand ifSideBand)
QMap< QString, SgChannelSideBand > loSideBandById_
QMap< QString, QString > & loIdByCid()
QMap< int, QString > loIdByIdx_
static const QString className()
QMap< QString, SgChannelPolarization > & loPolarizationBySensorKey()
QMap< QString, QString > & loIdBySensorKey()
QMap< int, double > bbcFreqByIdx_
QMap< QString, double > loFreqById_
QMap< int, QString > & loIdByIdx()
QMap< QString, double > & loFreqBySensorKey()
QMap< QString, double > loFreqBySensorKey_
QMap< QString, SgChannelPolarization > & ifPolarizationById()
QMap< int, double > & ifFreqByIdx()
BackEndType getBackEndType() const
QMap< int, double > bbcBandwidthByIdx_
QMap< QString, SgChannelSideBand > ifSideBandById_
QMap< QString, SgChannelSideBand > & loSideBandBySensorKey()
void setHwType(HwType tp)
const QString & getBandKey() const
const QList< SgChannelSideBand > & getSideBands() const
double getBandWidth() const
const QList< ChanCfg > & getChannelCfgs() const
const QString & getStnKey() const
QMap< QString, StnCfg > stnCfgByKey_
static const QString className()
bool parseSkdFile(const QString &fileName)
void addRecord(const QString &sensorId, const QString &boardId, double bw, const QString &agc, double gainU, double gainL, double tpOffU, double tpOffL, double tpOnU, double tpOnL, double sefdU, double sefdL)
void setOsRec(SgOnSourceRecord *os)
const SgOnSourceRecord * getOsRec() const
const SgMJD & getT() const
void setIsOnSource(bool isOnSource)
void setT(const SgMJD &t)
const QMap< QString, TpRecord > & getTpBySensor() const
void setIsDataOn(bool isDataOn)
void setT(const SgMJD &t)
const SgOnSourceRecord * getOsRec() const
bool addDot2gpsByBrd(const QString &key, float v)
const QMap< QString, float > & getDot2gpsByBrd() const
void setOsRec(SgOnSourceRecord *os)
const SgMJD & getT() const
const SgIoExternalFilter * lookupFilterByFileName(const QString &fileName)
static void closeFlt(FILE *&p, QFile &file, QTextStream &ts)
FILE * openFlt(const QString &fileName, QFile &file, QTextStream &ts, FilterDirection)
const QString & getDefaultExtension() const
virtual void write(LogLevel, quint32, const QString &, bool=false)
bool isEligible(LogLevel lvl, quint32 f) const
@ F_YYYYMMDDHHMMSSSS
Long verbose: Fri, the 2nd of Apr, 2010; 17hr 02min 43.6400sec.
@ F_Simple
Digits: 2010/04/02 17:02:43.6.
@ F_SOLVE_SPLFL_V3
Another spoolfile represenation of epoch: 2012.01.20-09:14:28.0.
@ F_SOLVE_SPLFL
That was used in ECC.dat files: 2010.04.02-17.02.
@ F_INTERNAL
Digits, date and time: 20100402.71.
QString toString(Format format=F_Verbose) const
void setUpEpoch(int year, int month, int day, int hour, int min, double sec)
double getPressure() const
void setRelativeHumidity(double rho)
double getTemperature() const
void setTemperature(double t)
void setPressure(double p)
static double dewPt2Rho(double temperature, double dewPtTemperature)
double getRelativeHumidity() const
const SgMJD & getT() const
const SgOnSourceRecord * getOsRec() const
void setOsRec(SgOnSourceRecord *os)
static const QString className()
const SgMeteoData & getM() const
const QString & getKey() const
QList< SgCableCalReading * > & cableCals()
QList< SgTsysReading * > & tSyses()
static const QString className()
const SgMJD & getTdataOn() const
const QString & getScanName() const
void setScanName(const QString &str)
const SgMJD & getTfinis() const
void setSourceName(const QString &str)
void setTfinis(const SgMJD &t)
QList< SgDbbc3TpReading * > & dbbc3Tps()
const QString & getSourceName() const
const SgMJD & getTstart() const
void setTstart(const SgMJD &t)
QList< SgMeteoReading * > & meteoPars()
const SgOnSourceRecord * getOsRec() const
void setT(const SgMJD &t)
void setOsRec(SgOnSourceRecord *os)
const QMap< QString, float * > & getPcal() const
static const QString className()
const SgMJD & getT() const
bool addPcals(const QMap< QString, float * > &pcals)
const SgMJD & getT() const
static const QString className()
bool addValByChanKey(const SgMJD &t, const QString &srcName, double az, double el, const QString &chanKey, const QVector< double > &val)
QMap< QString, QVector< double > * > valByChanKey_
const QMap< QString, QVector< double > * > & getValByChanKey() const
const QString & getSrcName() const
QList< QString > & content()
const QMap< QString, double > * rinexPressureOffsetByStn_
QString setupTpSensor(const QString &sensorTag, const QString &callerName)
const QMap< QString, QString > * rinexFileNameByStn_
static const QRegularExpression reMet_
FieldSystemEpochFormat fsFmt_
bool useSkededChannelSetup_
bool extractTraklReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, SgTraklReading &, const SgMJD &tAtTheBegin)
static const QString className()
bool extractTsysVgosReading(const QString &str, const QRegularExpression &reTsys, SgMJD &t, QMap< QString, float > &tSys, const SgMJD &tAtTheBegin)
static const QRegularExpression reFsOld_
bool extractBbcReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool createAntabFile(const QString &stnKey, const QString &outputFileName, bool have2owrt, bool reportAllTsysData)
static const QRegularExpression rePcmt_
bool extractTsysReading(const QString &str, const QRegularExpression &reTsys, SgMJD &t, QMap< QString, float > &tSys, const SgMJD &tAtTheBegin)
bool extractDataFromMetRecord(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, SgMeteoData &m)
bool extractVciReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool readDbbc3DumpFile(const QString &fileName)
const QMap< QString, int > * defaultCableSignByStn_
bool extractCableCalibration(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, double &v)
static int fsContentStartsAt_[]
bool extractCableCalibrationSignByDiff(const QRegularExpressionMatch &match, int &v)
bool propagateData(SgVlbiStationInfo *stn, bool createAntabFile, bool overwriteAntabFile, bool reportAllTsysData)
bool extractContent(const QString &str, QString &content)
QString inputLogFileName_
bool extractVcReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
SgChannelSkeded * channelSkeded_
bool extractPatchReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool extractMeteoReading(const QString &str, const QRegularExpression &reMeteo, SgMJD &t, SgMeteoData &m, const int *oom)
FieldSystemEpochFormat guessFsFormat(const QString &str)
bool readLogFile(const QString &fileName, const QString &stnName, const SgMJD &tFirst, const SgMJD &tLast, const QString &orderOfMeteo)
bool extractChanSkyFrqReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool extractDot2gpsVgosReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, QString &sKey, float &dot2gps, const SgMJD &tAtTheBegin)
bool extractEpoch(const QString &str, SgMJD &t)
bool extractLoReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
bool extractDataFromPcmtRecord(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, double &v, QString &source, QString &scan)
static const QRegularExpression reFsNewest_
bool extractPcalVgosReading(const QString &str, const QRegularExpression &re, SgMJD &t, QMap< QString, float * > &pcal, const SgMJD &tAtTheBegin)
QMap< QString, Procedure * > procedureByName_
static const QRegularExpression reFsNew_
SgStnLogReadings logReadings_
bool checkRinexFile(const QString &fileName, const SgMJD &tStart, const SgMJD &tFinis, const QString &rinexStnName)
bool extractSefdReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, QString &sensorId, QString &srcName, double &az, double &de, QVector< double > &vec, const SgMJD &tAtTheBegin)
bool extractTpcontVgosReading(const QString &str, const QRegularExpression &reTpcont, SgMJD &t, QMap< QString, QVector< int > > &tPcont, const SgMJD &tAtTheBegin)
bool extractLoRxgReading(const QString &str, const QRegularExpressionMatch &match, SgMJD &t, const SgMJD &atEnd, SgChannelSetup &cs, const SgMJD &tFirst)
const QString & getRecorderInfo() const
QList< SgDbbc3TpReading * > & dbbc3Tps()
static const QString sFiller_
QList< SgTraklReading * > & trakls()
void removeCableCalReadings()
QList< SgDot2xpsReading * > dot2xpses_
QList< SgSefdReading * > sefds_
void export2antabFrqs_vgosSetup(QTextStream &s)
bool createAntabFile(const QString &inputLogFileName, const QString &outputFileName, const QString &stnKey, const SgChannelSkeded *channelSkeded, bool useSkededChannelSetup, bool have2overwrite, bool reportAllTsysData)
void export2antCalFrqs_vgosSetup(QTextStream &s)
QList< SgCableCalReading * > & cableCals()
void removeMeteoReadings()
void export2antabFrqs_skededSetup(QTextStream &s, const SgChannelSkeded::StnCfg &sCfg)
void allocateCableReadings()
QList< SgTsysReading * > & tSyses()
bool createAntCalFile(const QString &inputLogFileName, const QString &outputFileName, const QString &stnKey, const SgChannelSkeded *channelSkeded, bool useSkededChannelSetup, bool have2overwrite, bool reportAllReadings, bool supressNonUsedSensors, int antcalOutputData, const QString &ext4compress, const QString &userCommand)
void cleanCableCalibrations()
void interpolateMeteoParameters(SgVlbiAuxObservation *aux)
void setCableCalAmbig(double a)
void export2antabFrqs_nativeSetup(QTextStream &s)
QList< SgPcalReading * > pcals_
int determineCableSignFromLong()
static const QString className()
QList< SgSefdReading * > & sefds()
QList< SgDbbc3TpReading * > dbbc3Tps_
void export2antabFrqs_missedSetup(QTextStream &s)
static const double dFiller_
QList< SgCableCalReading * > cableCals_
bool compareChannelSetups(const SgChannelSkeded::StnCfg &sCfg)
void lookupScanName(SgOnSourceRecord *osRec, const QMap< QString, SgVlbiAuxObservation * > &auxObsByScan)
QList< SgMeteoReading * > & meteoPars()
QList< SgDot2xpsReading * > & dot2xpses()
void setRecorderInfo(const QString &info)
void setStationName(const QString &name)
void setBackEndInfo(const QString &info)
QList< SgOnSourceRecord * > & onSourceRecords()
QList< SgOnSourceRecord * > onSourceRecords_
QList< SgTraklReading * > trakls_
SgChannelSetup & channelSetup()
SgChannelSetup channelSetup_
const QString & getExperimentName() const
void setExperimentName(const QString &name)
QList< SgTsysReading * > tSyses_
QList< SgMeteoReading * > meteoPars_
const QString & getBackEndInfo() const
void export2antCalPcal_vgosSetup(QTextStream &s)
void cleanMeteoParameters()
QList< SgCableCalReading * > & cableLongs()
bool tSensorsPrinted2AntCal_
void setFsVersionLabel(const QString &ver)
QList< SgCableCalReading * > cableLongs_
void export2antCalFrqs_skededSetup(QTextStream &s, const SgChannelSkeded::StnCfg &sCfg)
bool compareChannelNumbers(const SgChannelSkeded::StnCfg &sCfg)
bool propagateData(SgVlbiStationInfo *stn)
void verifyReadings(SgVlbiStationInfo *stn, const QMap< QString, int > *defaultCableSignByStn)
static const int nFiller_
QList< SgPcalReading * > & pcals()
bool areCableCalsPresent_
void removeTsysReadings()
QMap< QString, SgOnSourceRecord * > recordByScan_
void setItType(InputType t)
void export2antCalFrqs_nativeSetup(QTextStream &s)
static const QString className()
void setT(const SgMJD &t)
const SgMJD & getT() const
void setOsRec(SgOnSourceRecord *os)
void setT(const SgMJD &t)
static const QString className()
void addTsyses(const QMap< QString, float > &tsys)
void setIsOnSource(bool isOnSource)
const QMap< QString, float > & getTsys() const
QMap< QString, QVector< int > > & tpcont()
QList< SgTraklReading * > & trakls()
const SgOnSourceRecord * getOsRec() const
void setIsDataOn(bool isDataOn)
const SgMJD & getT() const
QMap< QString, QVector< int > > tpcont_
QMap< QString, float > & tsys()
const QMap< QString, QVector< int > > & getTpcont() const
QMap< QString, float > tsys_
void addTpconts(const QMap< QString, QVector< int > > &tpcont)
SgOnSourceRecord *& osRec()
void setElement(unsigned int i, double d)
double getElement(unsigned int i) const
QString name(NameFormat fmt=NF_Human) const
static const QString className()
bool readLogFile(const QString &fileName, int year)
bool strs2mjd(int nYear, const QString &sDay, const QString &sHr, const QString &sMin, const QString &sSec, SgMJD &t)
bool propagateData(SgVlbiStationInfo *stn)
static const QString ivsStationNames_[NUM_OF_VLBA_ENTRIES]
bool isVlba(const QString &key) const
static const QString vlbaStationCodes_[NUM_OF_VLBA_ENTRIES]
QMap< QString, QString > ivs2vlba_
QMap< QString, SgStnLogReadings * > readingsByKey_
void setTsyses(const SgVector &ts)
void setCableCalibration(double cable)
void setMeteoData(const SgMeteoData &meteo)
SgMeteoData & meteoData()
SgVlbiObservation * getOwner() const
const QString & getScanName() const
QMap< QString, SgVlbiObservable * > & observableByKey()
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
QVector< QString > & tsysIfSideBands()
QVector< double > & tsysIfFreqs()
QVector< QString > & tsysIfIds()
@ Attr_HAS_CABLE_CAL
a station has cable calibration readings;
@ Attr_METEO_MODIFIED
a station has meteo parameters;
@ Attr_CABLE_CAL_MODIFIED
a station has cable calibration readings;
@ Attr_HAS_METEO
a station has meteo parameters;
@ Attr_CABLE_CAL_IS_CDMS
FS log file contains /CDMS/ readings instead of /cable/;.
void setCableCalMultiplierDBCal(double c)
QVector< QString > & tsysIfPolarizations()
SgVersion * driverVersion