26 #include <QtCore/QDataStream>
55 bitsPerSampleByCount_(),
57 grdAmbigsBySpacing_(),
58 strGrdAmbigsStat_(
""),
59 phdAmbigsBySpacing_(),
60 strPhdAmbigsStat_(
""),
61 phCalOffset_1ByBln_(),
92 for (QMap<QString, SgVlbiStationInfo*>::iterator it=
stationsByName_.begin();
97 for (QMap<QString, SgVlbiBaselineInfo*>::iterator it=
baselinesByName_.begin();
102 for (QMap<QString, SgVlbiSourceInfo*>::iterator it=
sourcesByName_.begin();
119 for (QMap<QString, SgVlbiStationInfo*>::iterator it=
stationsByName_.begin();
121 it.value()->resetAllEditings();
122 for (QMap<QString, SgVlbiSourceInfo*>::iterator it=
sourcesByName_.begin();
124 it.value()->resetAllEditings();
125 for (QMap<QString, SgVlbiBaselineInfo*>::iterator it=
baselinesByName_.begin();
127 it.value()->resetAllEditings();
138 if (s.status() != QDataStream::Ok)
141 ": saveIntermediateResults(): error writting data");
145 for (QMap<QString, SgVlbiStationInfo*>::const_iterator it=
stationsByName_.begin();
147 if (s.status() == QDataStream::Ok)
149 s << it.value()->getKey();
150 it.value()->clockBreaks().saveIntermediateResults(s);
155 ": saveIntermediateResults(): error writting clock break data: " + it.value()->getKey());
159 if (s.status() != QDataStream::Ok)
162 ": saveIntermediateResults(): error writting data");
165 return s.status() == QDataStream::Ok;
174 unsigned int attributes;
176 s >> key >> attributes >> sigma2add;
177 if (s.status() != QDataStream::Ok)
180 ": loadIntermediateResults(): error reading data: " +
181 (s.status()==QDataStream::ReadPastEnd?
"read past end of the file":
"read corrupt data"));
187 ": loadIntermediateResults(): error reading data: wrong order, key mismatch: got [" + key +
188 "], expected [" +
getKey() +
"]");
192 for (QMap<QString, SgVlbiStationInfo*>::iterator it=
stationsByName_.begin();
194 if (s.status() == QDataStream::Ok)
197 if (it.value()->getKey() != key)
200 ": loadIntermediateResults(): error reading data: wrong order, key mismatch: got [" + key +
201 "], expected [" + it.value()->getKey() +
"]");
204 if (!it.value()->clockBreaks().loadIntermediateResults(s))
207 ": loadIntermediateResults(): error reading data: clock break data for " +
208 it.value()->getKey());
215 ": loadIntermediateResults(): error writting clock break data for " + it.value()->getKey() +
216 ": " + (s.status()==QDataStream::ReadPastEnd?
"read past end of the file":
"read corrupt data"));
222 return s.status()==QDataStream::Ok;
230 QMap<QString, QMap<QString, int> >
250 if (maxNumOfChannels_ < o->getNumOfChannels())
262 "::selfCheck(): cannot find the sample rate for the " +
getKey() +
"-band");
267 "::selfCheck(): set up the sample rate to " + QString(
"").sprintf(
"%.2f",
sampleRate_) +
268 " for the " +
getKey() +
"-band");
274 "::selfCheck(): found multiple values of the sample rate at the " +
getKey() +
"-band:");
278 "::selfCheck(): " + QString(
"").sprintf(
"%.2f -> %d times", it.key(), it.value()));
279 if (it.value() > num)
286 "::selfCheck(): set up the typical sample rate to " + QString(
"").sprintf(
"%.2f",
sampleRate_) +
287 " for the " +
getKey() +
"-band");
293 "::selfCheck(): cannot find the bits per sample for the " +
getKey() +
"-band");
298 "::selfCheck(): set up the bits per sample to " + QString(
"").sprintf(
"%d",
bitsPerSample_) +
299 " for the " +
getKey() +
"-band");
305 "::selfCheck(): found multiple values of the bits per sample at the " +
getKey() +
"-band:");
310 "::selfCheck(): " + QString(
"").sprintf(
"%d -> %d times", it.key(), it.value()));
311 if (it.value() > num)
318 "::selfCheck(): set up the typical bits per sample to " +
325 "::selfCheck(): the record mode has been set to \"" +
recordMode_ +
326 "\" for the " +
getKey() +
"-band:");
334 if (it.value() > num)
347 strGrdAmbigsStat_ += QString(
"").sprintf(
"%.1f (%.1f%%), ", it.key()*1.0e9, it.value()*100.0/num);
355 if (it.value() > num)
368 strPhdAmbigsStat_ += QString(
"").sprintf(
"%.3f (%.1f%%), ", it.key()*1.0e9, it.value()*100.0/num);
377 "::selfCheck(): the typical ambig.spacing for the " +
getKey() +
"-band was set to " +
384 "::selfCheck(): set up of the typical ambig.spacing for the " +
getKey() +
"-band failed");
393 "::selfCheck(): looks like an old DSN session, the error codes have been cleared");
398 isOk = isOk && it.value()->selfCheck();
404 if (numByScanIdBySrc.contains(si->
getKey()))
414 "::selfCheck(): the source \"" + str +
"\" has no any good observations in the primary band"
415 ", it was removed from the " +
getKey() +
"-band too");
419 "::selfCheck(): numbers of scans per a source were calculated",
true);
const SgMJD tZero(1957, 10, 4)
QMap< QString, SgVlbiBaselineInfo * >::iterator BaselinesByName_it
QMap< QString, SgVlbiSourceInfo * >::iterator SourcesByName_it
bool isAttr(uint a) const
void setAttributes(unsigned int a)
unsigned int getAttributes() const
virtual void write(LogLevel, quint32, const QString &, bool=false)
double getSigma2add(DataType) const
const QString & getKey() const
void setSigma2add(DataType dType, double d)
QString strPhdAmbigsStat_
QMap< int, SgVlbiBaselineInfo * > baselinesByIdx_
QMap< int, SgVlbiStationInfo * > stationsByIdx_
QMap< QString, SgVector * > phCalOffset_2ByBln_
QMap< int, int > bitsPerSampleByCount_
bool saveIntermediateResults(QDataStream &) const
QString strGrdAmbigsStat_
double typicalGrdAmbigSpacing_
QMap< QString, SgVlbiBaselineInfo * > baselinesByName_
QMap< QString, SgVlbiStationInfo * > stationsByName_
QMap< QString, SgVector * > phCalOffset_1ByBln_
QMap< double, int > sampleRateByCount_
QList< SgVlbiObservable * > observables_
QMap< int, SgVlbiSourceInfo * > sourcesByIdx_
QMap< double, int > grdAmbigsBySpacing_
QMap< double, int > phdAmbigsBySpacing_
bool loadIntermediateResults(QDataStream &)
const QString className() const
@ Attr_HAS_AMBIGS
the band contains group delays and ambiguities;
@ Attr_NOT_VALID
omit these data;
QMap< QString, SgVlbiSourceInfo * > sourcesByName_
double typicalPhdAmbigSpacing_
double getAmbiguitySpacing() const
double getSampleRate() const
int getNumOfChannels() const
const QString & getErrorCode() const
SgVlbiObservation * owner()
SgVlbiMeasurement & phDelay()
int getBitsPerSample() const
SgVlbiMeasurement & grDelay()
const QString & getScanId() const
void setTotalScanNum(int n)