30 #if QT_VERSION >= 0x050000
31 # include <QtWidgets/QMessageBox>
33 # include <QtGui/QMessageBox>
73 "::doPostReadActions(): post read actions initiated for the session " +
getName() +
77 "::doPostReadActions(): post read actions initiated for the session " +
getName() +
98 "::doPostReadActions(): evaluating ionospheric corrections for single band delays",
true);
105 "::doPostReadActions(): clock break detections not implemened yet",
true);
113 "::doPostReadActions(): elimination of outliers, early stage",
true);
127 "::doPostReadActions4Ints(): post read actions initiated for the session " +
getName() +
130 QMap<QString, int> bandIdxByKey;
134 int primaryBandIdx=-1;
155 it.value()->setSigma2add(
DT_DELAY, 20.0e-12);
158 for (
int i=0; i<
bands_.size(); i++)
160 bandIdxByKey[
bands_.at(i)->getKey()] = i;
164 if (!bandIdxByKey.contains(
"X"))
166 "::doPostReadActions4Ints(): nonstandard band naming: missed X-band");
167 if (!bandIdxByKey.contains(
"S"))
169 "::doPostReadActions4Ints(): nonstandard band naming: missed S-band");
172 "::doPostReadActions4Ints(): nonstandard band naming: the primary band is not X-band");
179 "::doPostReadActions4Ints(): evaluating ionospheric corrections for single band delays",
true);
188 "::doPostReadActions4Ints(): a clock break was detected for SB delays, cannot proceed in "
195 "::doPostReadActions4Ints(): scan for clock break @SBD completed");
199 "::doPostReadActions4Ints(): scan for clock break @SBD was not required");
206 "::doPostReadActions4Ints(): starting to resolve ambiguities",
true);
214 "::doPostReadActions4Ints(): obtained SB solution",
true);
221 for (
int i=0; i<
bands_.size(); i++)
227 "::doPostReadActions4Ints(): finished " +
228 bands_.at(i)->getKey() +
"-band clocks only solution");
235 for (
int i=0; i<
bands_.size(); i++)
241 "::doPostReadActions4Ints(): finished " +
242 bands_.at(i)->getKey() +
"-band clocks&zenith solution");
246 "::doPostReadActions4Ints(): done ambiguities",
true);
251 "::doPostReadActions4Ints(): check for ambiguities was not required");
257 "::doPostReadActions4Ints(): running clock break detections, early stage",
true);
265 "::doPostReadActions4Ints(): adding ionospheric corrections",
true);
272 int numOfRestored, numOfEliminated;
301 numOfRestored = numOfEliminated = 0;
309 while (numOfRestored + numOfEliminated);
331 "::doPostReadActions4Ints(): processing the session " +
name_ +
332 " in automatic mode has been finished");
339 "::doPostReadActions4Ints(): looks like the automatic mode has failed: the number of good obs (" +
341 ") is close to the number of parameters (" +
349 "::doPostReadActions4Ints(): looks like the automatic mode has failed: the number of good obs (" +
351 ") is less than 30% of total observations (" +
358 "::doPostReadActions4Ints(): looks like the automatic mode has failed: the WRMS (" +
404 "::pickupReferenceClocksStation(): a reference clock station was already set for the session");
413 int num=refStations.size(), idx;
417 while (idx<num && !hasFound)
427 "::pickupReferenceClocksStation(): cannot find any predefined stations in the session, "
428 "use first available one");
436 "::pickupReferenceClocksStation(): set a station " + stn->
getKey() +
437 " as a reference clocks station");
441 "::pickupReferenceClocksStation(): no reference clocks station set for the session");
453 "::setReferenceClocksStation(): cannot find the station " + stnKey +
" in the session");
467 "::setReferenceClocksStation(): unset a station " + stn->
getKey() +
468 " as a reference clocks station");
476 "::setReferenceClocksStation(): set a station " + stn->
getKey() +
477 " as a reference clocks station");
488 int num=refStations.size(), idx;
496 while (idx<num && !hasFound)
506 "::pickupReferenceCoordinatesStation(): cannot find any predefined stations in the session, "
507 "use the first available one");
513 "::pickupReferenceCoordinatesStation(): set a station " + stn->
getKey() +
514 " as a reference coordinate station");
518 "::pickupReferenceCoordinatesStation(): no reference coordinate station set for the session");
527 const QString stnBlockTag(
"+STATION_NOTES");
528 const QString phcBlockTag1(
"+MANUAL");
529 const QString phcBlockTag2(
"PCAL");
530 const QChar endBlockMark(
'+');
531 QRegExp endBlockMarkRx(
"^\\s*\\+");
534 QMap<QString, bool> manPhCal1_ByKey;
535 QMap<QString, bool> manPhCal2_ByKey;
536 QMap<QString, QString> keyByAbbr;
537 QMap<QString, QList<QString> >eventsByKey;
538 QString stnName, stnAbbr;
545 while (idx<history.size() && !hasFound)
547 if (history.at(idx)->getText().contains(stnBlockTag))
554 "::checkUseOfManualPhaseCals(): cannot find station notes block in the history records");
561 QRegExp rx(
"^\\s*([A-Z0-9]{1}[-A-Z0-9_\\s]{1,7})\\s*[:]*\\s*"
562 "\\(([-A-Za-z0-9]{1,2})[-/]{1}([A-Za-z0-9]{1,2})\\):");
563 QString sa1(
""), sa2(
"");
564 while (idx<history.size() && !hasFound)
566 const QString& str=history.at(idx)->getText();
567 if (str.indexOf(endBlockMarkRx) != -1)
571 if (str.indexOf(rx) != -1)
577 if (stnName.size() < 8)
578 stnName = stnName.leftJustified(8,
' ');
579 stnAbbr = (sa1.size()==2)?sa1:(sa2.size()==2?sa2:
"");
582 "::checkUseOfManualPhaseCals(): cannot find stnAbbr, the pair is [" + sa1 +
586 keyByAbbr[stnAbbr] = stnName;
587 sa1 = str.right(str.size() - str.indexOf(
':') - 1);
588 eventsByKey[stnName] << sa1;
591 else if (str.simplified().size()>0 && stnName.size()>0)
592 eventsByKey[stnName] << str.simplified();
598 if (keyByAbbr.size() != eventsByKey.size())
600 "::checkUseOfManualPhaseCals(): abbreviations and stations size mismatch");
602 if (!eventsByKey.contains(it.key()))
604 "::checkUseOfManualPhaseCals(): cannot find station " + it.key() +
605 " in the station notes block of the history records");
610 std::cout <<
"Got: " << keyByAbbr.size() <<
" abbrs and " << eventsByKey.size() <<
" stns \n";
611 std::cout <<
" Abbrs: \n";
612 for (QMap<QString, QString>::iterator it=keyByAbbr.begin(); it!=keyByAbbr.end(); ++it)
613 std::cout <<
" abbr: [" << qPrintable(it.key()) <<
"], key: [" << qPrintable(it.value()) <<
"]\n";
614 std::cout <<
" Stns: \n";
615 for (QMap<QString,
QList<QString> >::iterator it=eventsByKey.begin(); it!=eventsByKey.end(); ++it)
617 std::cout <<
" key: [" << qPrintable(it.key()) <<
"]: " <<
"\n";
619 for (
int i=0; i<lst.size(); i++)
620 std::cout <<
" " << i <<
": [" << qPrintable(lst.at(i)) <<
"]\n";
625 for (QMap<QString,
QList<QString> >::iterator it=eventsByKey.begin(); it!=eventsByKey.end(); ++it)
627 const QString &sName=it.key();
629 for (
int i=0; i<lst.size(); i++)
631 const QString &rec=lst.at(i);
632 if (rec.contains(
"manual", Qt::CaseInsensitive) &&
633 rec.contains(
"pcal", Qt::CaseInsensitive) &&
634 rec.contains(
"applied", Qt::CaseInsensitive)
636 manPhCal1_ByKey[sName] =
true;
637 if (rec.contains(
"manual", Qt::CaseInsensitive) &&
638 rec.contains(
"phase", Qt::CaseInsensitive) &&
639 rec.contains(
"calibration", Qt::CaseInsensitive)&&
640 rec.contains(
"applied", Qt::CaseInsensitive)
642 manPhCal1_ByKey[sName] =
true;
643 if (rec.contains(
"manual", Qt::CaseInsensitive) &&
644 rec.contains(
"phasecal",Qt::CaseInsensitive) &&
645 rec.contains(
"applied", Qt::CaseInsensitive)
647 manPhCal1_ByKey[sName] =
true;
648 if (rec.contains(
"manual", Qt::CaseInsensitive) &&
649 rec.contains(
"phase", Qt::CaseInsensitive) &&
650 rec.contains(
"cal", Qt::CaseInsensitive) &&
651 rec.contains(
"applied", Qt::CaseInsensitive)
653 manPhCal1_ByKey[sName] =
true;
655 if (manPhCal1_ByKey.contains(sName) && manPhCal1_ByKey[sName])
657 "::checkUseOfManualPhaseCals(): found manual phasecal record for " + sName +
658 " in the station block");
672 while (idx<history.size() && !hasFound)
674 if (history.at(idx)->getText().contains(phcBlockTag1) &&
675 history.at(idx)->getText().contains(phcBlockTag2) )
677 phcStr = history.at(idx)->getText();
678 phcStr.replace(
',',
' ');
685 "::checkUseOfManualPhaseCals(): cannot find manual phasecal block in the history records");
688 QStringList lst=phcStr.right(
689 phcStr.size() - phcStr.indexOf(phcBlockTag2) - phcBlockTag2.length()).
690 split(
" ", QString::SkipEmptyParts);
691 for (
int i=0; i<lst.size(); i++)
693 const QString &abbr=lst.at(i);
694 if (keyByAbbr.contains(abbr))
696 manPhCal2_ByKey[keyByAbbr[abbr]] =
true;
698 "::checkUseOfManualPhaseCals(): the use of manual phasecal was mention for the station " +
699 keyByAbbr[abbr] +
"(" + abbr +
") in the manual phasecal block");
703 "::checkUseOfManualPhaseCals(): cannot find station abbreviation " + abbr +
704 " in the station description block");
709 for (QMap<QString, bool>::const_iterator it=manPhCal1_ByKey.begin(); it!=manPhCal1_ByKey.end(); ++it)
710 if (!manPhCal2_ByKey.contains(it.key()))
714 "::checkUseOfManualPhaseCals(): according to the station notes block manual phase cals "
715 "were applied to station " + it.key() +
", but it was not listed in the manual phasecal block");
717 manPhCal2_ByKey[it.key()] =
true;
720 for (QMap<QString, bool>::const_iterator it=manPhCal2_ByKey.begin(); it!=manPhCal2_ByKey.end(); ++it)
722 const QString &sName=it.key();
723 if (!manPhCal1_ByKey.contains(sName))
726 "::checkUseOfManualPhaseCals(): according to the manual phasecal block manual phase cals "
727 "were applied to station " + sName +
", but it was not mention in the station notes block");
732 "::checkUseOfManualPhaseCals(): cable calibrations for station " + sName +
733 " have been turned off because of applied manual phase calibrations");
737 "::checkUseOfManualPhaseCals(): cannot find station " + sName +
" in the list of stations "
738 "of the session, cannot turn off cable cals for it");
762 bool isCbOccurred=
false;
769 int primaryBandIdx=-1;
772 for (
int i=0; i<
bands_.size(); i++)
775 if (primaryBandIdx<0)
778 "::check4ClockBreaksAtSBD(): cannot find an index of the primary band, check failed");
788 stations << it.value();
794 stations << it.value();
811 "::check4ClockBreaksAtSBD(): got a first SB solution",
true);
819 for (
int brkIdx=0; brkIdx<breakModel.size(); brkIdx++)
825 existedCBs << cbAgent;
830 for (
int j=0; j<stations.size(); j++)
834 "::check4ClockBreaksAtSBD(): processing " + stn->
getKey() +
" station",
true);
845 if (existedCBs.size())
866 if (cbAgents.size() > 0)
869 QMap< QString, QList<SgClockBreakAgent*> >
871 for (
int i=0; i<cbAgents.size(); i++)
877 it!=cbasByStn.end(); ++it)
882 for (
int i=0; i<l.size(); i++)
883 if (l.at(i)->sigma_>0.0 && fabs(l.at(i)->shift_/l.at(i)->sigma_)>d)
886 d = fabs(l.at(i)->shift_/l.at(i)->sigma_);
893 for (
int i=0; i<cbas.size(); i++)
894 if (cbas.at(i)->sigma_>0.0 && fabs(cbas.at(i)->shift_/cbas.at(i)->sigma_)>d)
897 d = fabs(cbas.at(i)->shift_/cbas.at(i)->sigma_);
903 "::check4ClockBreaksAtSBD(): running additional solutions to "
904 "check an effect of the clock break");
907 "::check4ClockBreaksAtSBD(): finished; old WRMS were " +
908 QString(
"").sprintf(
"%.3fps", wrms_0*1.0e12) +
", the new WRMS are " +
915 "::check4ClockBreaksAtSBD(): the clock break looks like not real, removing it");
921 isCbOccurred =
false;
924 it.value()->clockBreaks().size()>0)
929 "::check4ClockBreaksAtSBD(): detected SB clock break(s) at the station " +
936 QString(
"").sprintf(
"%.2fps", pb->
getA0()*1.0e12));
975 <<
"HOBART26" <<
"HARTRAO " <<
"ONSALA60"
QMap< QString, SgVlbiBaselineInfo * >::iterator BaselinesByName_it
const QString defaultNetIdName
QList< QString > clockRefStations4R4
QList< QString > clockRefStations4Int
QList< QString > coordRefStations4Gen
QList< QString > clockRefStations4Gen
QMap< QString, SgVlbiStationInfo * >::iterator StationsByName_it
bool isAttr(uint a) const
bool delBreak(const SgMJD &t)
virtual void write(LogLevel, quint32, const QString &, bool=false)
@ F_Simple
Digits: 2010/04/02 17:02:43.6.
QString toString(Format format=F_Verbose) const
const QString & getKey() const
int numProcessed(DataType dType) const
double chi2(DataType) const
double wrms(DataType) const
@ Attr_PROCESSED
the observation has been processed;
void setMode4Parameter(SgParameterCfg::PMode, ParIdx)
void unsetParameter(ParIdx)
void unsetAllParameters()
void setMode4Parameters(SgParameterCfg::PMode, const QList< ParIdx > &)
@ Idx_CLOCK_1
index for clocks (order #1)
@ Idx_POLUSUT1
index for EOP: d(UT1-UTC)
@ Idx_BL_LENGTH
index for baseline length
@ Idx_ZENITH
index for wet zenith delay
@ Idx_CLOCK_0
index for clocks (order #0)
void setDoWeightCorrection(bool)
bool getIsSolveCompatible() const
void setOpThreshold(double)
QMap< QString, AutomaticProcessing > & apByNetId()
void setActiveBandIdx(int)
void setOpMode(OutliersProcessingMode)
double getOpThreshold() const
void setUseDelayType(VlbiDelayType)
int getInputFileVersion() const
SgVlbiHistory & history()
const QString & getName() const
@ Attr_FF_AUTOPROCESSED
automatic data processing performed successfully;
QString networkID_
Network ID (a key);.
QString name_
name of the session (e.g., 10JUL22XE);
StationsByName stationsByName_
QList< SgVlbiBand * > & bands()
QList< SgVlbiBand * > bands_
void calculateIonoCorrections(const SgTaskConfig *)
int restoreOutliers(int bandIdx)
QList< SgVlbiObservation * > observations_
bool check4ClockBreaksAtSBD()
void process(bool haveProcessAllBands, bool interactWithGui)
void pickupReferenceCoordinatesStation()
void scanBaselines4GrDelayAmbiguities(int bandIdx)
void checkUseOfManualPhaseCals()
void correctClockBreak(SgVlbiBand *, SgVlbiStationInfo *, const SgMJD &, double, double, bool, bool=true)
void calculateClockBreaksParameters(QList< SgClockBreakAgent * > &, SgVlbiBand *)
bool doPostReadActions4Ints(const SgTaskConfig::AutomaticProcessing &)
BaselinesByName baselinesByName_
SgParametersDescriptor * parametersDescriptor_
SgVlbiBand * primaryBand_
int eliminateOutliers(int bandIdx)
void eliminateOutliersMode1()
void eliminateOutliersSimpleMode(int bandIdx, int maxNumOfPasses, double threshold, double=0.0)
void pickupReferenceClocksStation()
void detectAndProcessClockBreaks()
int suppressNotSoGoodObs()
static QString className()
void setReferenceClocksStation(const QString &stnKey)
void setClockModelOrder4Stations(int)
QMap< QString, SgVlbiAuxObservation * > * auxObservationByScanId()
@ Attr_NOT_VALID
omit the station;
@ Attr_REFERENCE_CLOCKS
the clocks are the reference ones;
@ Attr_IGNORE_CABLE_CAL
do not apply cable calibration;
@ Attr_ESTIMATE_COO
estimate station position;
SgBreakModel & clockBreaks()
void setClocksModelOrder(int n)
bool doClockBreaksDetection_
bool doIonoCorrection4SBD_
FinalSolution finalSolution_
bool doIonoCorrection4All_