source: ntrip/trunk/BNC/src/rinex/reqcanalyze.cpp@ 6284

Last change on this file since 6284 was 6284, checked in by mervart, 9 years ago
File size: 20.5 KB
Line 
1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters.
3//
4// Copyright (C) 2007
5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
7// Czech Technical University Prague, Department of Geodesy
8// http://www.fsv.cvut.cz
9//
10// Email: euref-ip@bkg.bund.de
11//
12// This program is free software; you can redistribute it and/or
13// modify it under the terms of the GNU General Public License
14// as published by the Free Software Foundation, version 2.
15//
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25/* -------------------------------------------------------------------------
26 * BKG NTRIP Client
27 * -------------------------------------------------------------------------
28 *
29 * Class: t_reqcAnalyze
30 *
31 * Purpose: Analyze RINEX Files
32 *
33 * Author: L. Mervart
34 *
35 * Created: 11-Apr-2012
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <iostream>
42#include <iomanip>
43#include <qwt_plot_renderer.h>
44
45#include "reqcanalyze.h"
46#include "bnccore.h"
47#include "bncsettings.h"
48#include "reqcedit.h"
49#include "bncutils.h"
50#include "graphwin.h"
51#include "polarplot.h"
52#include "availplot.h"
53#include "eleplot.h"
54#include "dopplot.h"
55
56using namespace std;
57
58// Constructor
59////////////////////////////////////////////////////////////////////////////
60t_reqcAnalyze::t_reqcAnalyze(QObject* parent) : QThread(parent) {
61
62 bncSettings settings;
63
64 _logFileName = settings.value("reqcOutLogFile").toString(); expandEnvVar(_logFileName);
65 _logFile = 0;
66 _log = 0;
67 _currEpo = 0;
68 _obsFileNames = settings.value("reqcObsFile").toString().split(",", QString::SkipEmptyParts);
69 _navFileNames = settings.value("reqcNavFile").toString().split(",", QString::SkipEmptyParts);
70
71 connect(this, SIGNAL(dspSkyPlot(const QString&, const QByteArray&, QVector<t_polarPoint*>*,
72 const QByteArray&, QVector<t_polarPoint*>*,
73 const QByteArray&, double)),
74 this, SLOT(slotDspSkyPlot(const QString&, const QByteArray&, QVector<t_polarPoint*>*,
75 const QByteArray&, QVector<t_polarPoint*>*,
76 const QByteArray&, double)));
77
78 connect(this, SIGNAL(dspAvailPlot(const QString&, const QByteArray&)),
79 this, SLOT(slotDspAvailPlot(const QString&, const QByteArray&)));
80}
81
82// Destructor
83////////////////////////////////////////////////////////////////////////////
84t_reqcAnalyze::~t_reqcAnalyze() {
85 for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
86 delete _rnxObsFiles[ii];
87 }
88 for (int ii = 0; ii < _ephs.size(); ii++) {
89 delete _ephs[ii];
90 }
91 delete _log; _log = 0;
92 delete _logFile; _logFile = 0;
93 if (BNC_CORE->mode() != t_bncCore::interactive) {
94 qApp->exit(0);
95 }
96}
97
98//
99////////////////////////////////////////////////////////////////////////////
100void t_reqcAnalyze::run() {
101
102 // Open Log File
103 // -------------
104 _logFile = new QFile(_logFileName);
105 if (_logFile->open(QIODevice::WriteOnly | QIODevice::Text)) {
106 _log = new QTextStream();
107 _log->setDevice(_logFile);
108 }
109
110 // Initialize RINEX Observation Files
111 // ----------------------------------
112 t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _log);
113
114 // Read Ephemerides
115 // ----------------
116 t_reqcEdit::readEphemerides(_navFileNames, _ephs);
117
118 // Loop over all RINEX Files
119 // -------------------------
120 for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
121 analyzeFile(_rnxObsFiles[ii]);
122 }
123
124 // Exit
125 // ----
126 emit finished();
127 deleteLater();
128}
129
130//
131////////////////////////////////////////////////////////////////////////////
132void t_reqcAnalyze::analyzeFile(t_rnxObsFile* obsFile) {
133
134 _qcFile.clear();
135
136 // A priori Coordinates
137 // --------------------
138 ColumnVector xyzSta = obsFile->xyz();
139
140 // Loop over all Epochs
141 // --------------------
142 try {
143 bool firstEpo = true;
144 while ( (_currEpo = obsFile->nextEpoch()) != 0) {
145 if (firstEpo) {
146 firstEpo = false;
147 _qcFile._startTime = _currEpo->tt;
148 _qcFile._antennaName = obsFile->antennaName();
149 _qcFile._markerName = obsFile->markerName();
150 _qcFile._receiverType = obsFile->receiverType();
151 _qcFile._interval = obsFile->interval();
152 }
153 _qcFile._endTime = _currEpo->tt;
154
155 t_qcEpo qcEpo;
156 qcEpo._epoTime = _currEpo->tt;
157 qcEpo._PDOP = cmpDOP(xyzSta);
158
159 // Loop over all satellites
160 // ------------------------
161 for (unsigned iObs = 0; iObs < _currEpo->rnxSat.size(); iObs++) {
162 const t_rnxObsFile::t_rnxSat& rnxSat = _currEpo->rnxSat[iObs];
163 t_satObs satObs;
164 t_rnxObsFile::setObsFromRnx(obsFile, _currEpo, rnxSat, satObs);
165 t_qcObs& qcObs = qcEpo._qcObs[satObs._prn];
166 setQcObs(qcEpo._epoTime, xyzSta, satObs, qcObs);
167 updateQcSat(qcObs, _qcFile._qcSat[satObs._prn]);
168 }
169 _qcFile._qcEpo.push_back(qcEpo);
170 }
171
172 analyzeMultipath();
173
174 preparePlotData(obsFile);
175
176 printReport(obsFile);
177 }
178 catch (QString str) {
179 if (_log) {
180 *_log << "Exception " << str << endl;
181 }
182 else {
183 qDebug() << str;
184 }
185 }
186}
187
188// Compute Dilution of Precision
189////////////////////////////////////////////////////////////////////////////
190double t_reqcAnalyze::cmpDOP(const ColumnVector& xyzSta) const {
191
192 if (xyzSta.size() != 3) {
193 return 0.0;
194 }
195
196 unsigned nSat = _currEpo->rnxSat.size();
197
198 if (nSat < 4) {
199 return 0.0;
200 }
201
202 Matrix AA(nSat, 4);
203
204 unsigned nSatUsed = 0;
205 for (unsigned iSat = 0; iSat < nSat; iSat++) {
206
207 const t_rnxObsFile::t_rnxSat& rnxSat = _currEpo->rnxSat[iSat];
208 const t_prn& prn = rnxSat.prn;
209
210 t_eph* eph = 0;
211 for (int ie = 0; ie < _ephs.size(); ie++) {
212 if (_ephs[ie]->prn() == prn) {
213 eph = _ephs[ie];
214 break;
215 }
216 }
217 if (eph) {
218 ColumnVector xSat(4);
219 ColumnVector vv(3);
220 if (eph->getCrd(_currEpo->tt, xSat, vv, false) == success) {
221 ++nSatUsed;
222 ColumnVector dx = xSat.Rows(1,3) - xyzSta;
223 double rho = dx.norm_Frobenius();
224 AA(nSatUsed,1) = dx(1) / rho;
225 AA(nSatUsed,2) = dx(2) / rho;
226 AA(nSatUsed,3) = dx(3) / rho;
227 AA(nSatUsed,4) = 1.0;
228 }
229 }
230 }
231
232 if (nSatUsed < 4) {
233 return 0.0;
234 }
235
236 AA = AA.Rows(1, nSatUsed);
237
238 SymmetricMatrix QQ;
239 QQ << AA.t() * AA;
240 QQ = QQ.i();
241
242 return sqrt(QQ.trace());
243}
244
245//
246////////////////////////////////////////////////////////////////////////////
247void t_reqcAnalyze::updateQcSat(const t_qcObs& qcObs, t_qcSat& qcSat) {
248 if (qcObs._hasL1 && qcObs._hasL2) {
249 qcSat._numObs += 1;
250 }
251 if (qcObs._slipL1 && qcObs._slipL2) {
252 qcSat._numSlipsFlagged += 1;
253 }
254}
255
256//
257////////////////////////////////////////////////////////////////////////////
258void t_reqcAnalyze::setQcObs(const bncTime& epoTime, const ColumnVector& xyzSta,
259 const t_satObs& satObs, t_qcObs& qcObs) {
260
261 t_eph* eph = 0;
262 for (int ie = 0; ie < _ephs.size(); ie++) {
263 if (_ephs[ie]->prn() == satObs._prn) {
264 eph = _ephs[ie];
265 break;
266 }
267 }
268 if (eph) {
269 ColumnVector xc(4);
270 ColumnVector vv(3);
271 if (xyzSta.size() && eph->getCrd(epoTime, xc, vv, false) == success) {
272 double rho, eleSat, azSat;
273 topos(xyzSta(1), xyzSta(2), xyzSta(3), xc(1), xc(2), xc(3), rho, eleSat, azSat);
274 qcObs._eleSet = true;
275 qcObs._azDeg = azSat * 180.0/M_PI;
276 qcObs._eleDeg = eleSat * 180.0/M_PI;
277 }
278 if (satObs._prn.system() == 'R') {
279 qcObs._slotSet = true;
280 qcObs._slotNum = eph->slotNum();
281 }
282 }
283
284 // Check Gaps
285 // ----------
286 if (qcObs._lastObsTime.valid()) {
287 double dt = epoTime - qcObs._lastObsTime;
288 if (dt > 1.5 * _qcFile._interval) {
289 qcObs._gapL1 = true;
290 qcObs._gapL2 = true;
291 }
292 }
293 qcObs._lastObsTime = epoTime;
294
295 // Availability and Slip Flags
296 // ---------------------------
297 double L1 = 0.0;
298 double L2 = 0.0;
299 double P1 = 0.0;
300 double P2 = 0.0;
301 for (unsigned iFrq = 0; iFrq < satObs._obs.size(); iFrq++) {
302 const t_frqObs* frqObs = satObs._obs[iFrq];
303 if (frqObs->_rnxType2ch[0] == '1') {
304 if (frqObs->_phaseValid) {
305 L1 = frqObs->_phase;
306 qcObs._hasL1 = true;
307 qcObs._slipL1 = frqObs->_slip;
308 }
309 if (frqObs->_codeValid) {
310 P1 = frqObs->_code;
311 }
312 if (frqObs->_snrValid) {
313 qcObs._SNR1 = frqObs->_snr;
314 }
315 }
316 else if ( (satObs._prn.system() != 'E' && frqObs->_rnxType2ch[0] == '2') ||
317 (satObs._prn.system() == 'E' && frqObs->_rnxType2ch[0] == '5') ) {
318 if (frqObs->_phaseValid) {
319 L2 = frqObs->_phase;
320 qcObs._hasL2 = true;
321 qcObs._slipL2 = frqObs->_slip;
322 }
323 if (frqObs->_codeValid) {
324 P2 = frqObs->_code;
325 }
326 if (frqObs->_snrValid) {
327 qcObs._SNR2 = frqObs->_snr;
328 }
329 }
330 }
331
332 // Compute the Multipath Linear Combination
333 // ----------------------------------------
334 if (L1 != 0.0 && L2 != 0.0 && P1 != 0.0 && P2 != 0.0) {
335 double f1 = 0.0;
336 double f2 = 0.0;
337 if (satObs._prn.system() == 'G') {
338 f1 = t_CST::freq(t_frequency::G1, 0);
339 f2 = t_CST::freq(t_frequency::G2, 0);
340 }
341 else if (satObs._prn.system() == 'R') {
342 f1 = t_CST::freq(t_frequency::R1, qcObs._slotNum);
343 f2 = t_CST::freq(t_frequency::R2, qcObs._slotNum);
344 }
345 else if (satObs._prn.system() == 'E') {
346 f1 = t_CST::freq(t_frequency::E1, 0);
347 f2 = t_CST::freq(t_frequency::E5, 0);
348 }
349
350 L1 = L1 * t_CST::c / f1;
351 L2 = L2 * t_CST::c / f2;
352
353 qcObs._rawMP1 = P1 - L1 - 2.0*f2*f2/(f1*f1-f2*f2) * (L1 - L2);
354 qcObs._rawMP2 = P2 - L2 - 2.0*f1*f1/(f1*f1-f2*f2) * (L1 - L2);
355 qcObs._mpSet = true;
356 }
357}
358
359//
360////////////////////////////////////////////////////////////////////////////
361void t_reqcAnalyze::analyzeMultipath() {
362
363 const double SLIPTRESH = 10.0; // cycle-slip threshold (meters)
364 const double chunkStep = 600.0; // 10 minutes
365
366 // Loop over all satellites available
367 // ----------------------------------
368 QMutableMapIterator<t_prn, t_qcSat> it(_qcFile._qcSat);
369 while (it.hasNext()) {
370 it.next();
371 const t_prn& prn = it.key();
372 t_qcSat& qcSat = it.value();
373
374 // Loop over all Chunks of Data
375 // ----------------------------
376 for (bncTime chunkStart = _qcFile._startTime;
377 chunkStart < _qcFile._endTime; chunkStart += chunkStep) {
378
379 bncTime chunkEnd = chunkStart + chunkStep;
380
381 QVector<t_qcObs*> obsVec;
382 QVector<double> MP1;
383 QVector<double> MP2;
384
385 // Loop over all Epochs within one Chunk of Data
386 // ---------------------------------------------
387 for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) {
388 t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo];
389 if (chunkStart <= qcEpo._epoTime && qcEpo._epoTime < chunkEnd) {
390 if (qcEpo._qcObs.contains(prn)) {
391 t_qcObs& qcObs = qcEpo._qcObs[prn];
392 obsVec << &qcObs;
393 if (qcObs._mpSet) {
394 MP1 << qcObs._rawMP1;
395 MP2 << qcObs._rawMP2;
396 }
397 }
398 }
399 }
400
401 // Compute the multipath mean and standard deviation
402 // -------------------------------------------------
403 if (MP1.size() > 1) {
404 double meanMP1 = 0.0;
405 double meanMP2 = 0.0;
406 for (int ii = 0; ii < MP1.size(); ii++) {
407 meanMP1 += MP1[ii];
408 meanMP2 += MP2[ii];
409 }
410 meanMP1 /= MP1.size();
411 meanMP2 /= MP2.size();
412
413 bool slipMP = false;
414
415 double stdMP1 = 0.0;
416 double stdMP2 = 0.0;
417 for (int ii = 0; ii < MP1.size(); ii++) {
418 double diff1 = MP1[ii] - meanMP1;
419 double diff2 = MP2[ii] - meanMP2;
420 if (fabs(diff1) > SLIPTRESH || fabs(diff2) > SLIPTRESH) {
421 slipMP = true;
422 break;
423 }
424 stdMP1 += diff1 * diff1;
425 stdMP2 += diff2 * diff2;
426 }
427
428 if (slipMP) {
429 stdMP1 = 0.0;
430 stdMP2 = 0.0;
431 qcSat._numSlipsFound += 1;
432 }
433 else {
434 stdMP1 = sqrt(stdMP1 / (MP1.size()-1));
435 stdMP2 = sqrt(stdMP2 / (MP2.size()-1));
436 }
437
438 for (int ii = 0; ii < obsVec.size(); ii++) {
439 t_qcObs* qcObs = obsVec[ii];
440 if (slipMP) {
441 qcObs->_slipL1 = true;
442 qcObs->_slipL2 = true;
443 }
444 else {
445 qcObs->_stdMP1 = stdMP1;
446 qcObs->_stdMP2 = stdMP2;
447 }
448 }
449 }
450 }
451 }
452}
453
454//
455////////////////////////////////////////////////////////////////////////////
456void t_reqcAnalyze::preparePlotData(const t_rnxObsFile* obsFile) {
457
458 QVector<t_polarPoint*>* dataMP1 = new QVector<t_polarPoint*>;
459 QVector<t_polarPoint*>* dataMP2 = new QVector<t_polarPoint*>;
460 QVector<t_polarPoint*>* dataSNR1 = new QVector<t_polarPoint*>;
461 QVector<t_polarPoint*>* dataSNR2 = new QVector<t_polarPoint*>;
462
463 bncSettings settings;
464 QString reqSkyPlotSystems = settings.value("reqcSkyPlotSystems").toString();
465 bool plotGPS = false;
466 bool plotGlo = false;
467 bool plotGal = false;
468 if (reqSkyPlotSystems == "GPS") {
469 plotGPS = true;
470 }
471 else if (reqSkyPlotSystems == "GLONASS") {
472 plotGlo = true;
473 }
474 else if (reqSkyPlotSystems == "Galileo") {
475 plotGal = true;
476 }
477 else {
478 plotGPS = true;
479 plotGlo = true;
480 plotGal = true;
481 }
482
483 // Loop over all observations
484 // --------------------------
485 for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) {
486 t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo];
487 QMapIterator<t_prn, t_qcObs> it(qcEpo._qcObs);
488 while (it.hasNext()) {
489 it.next();
490 const t_prn& prn = it.key();
491 const t_qcObs& qcObs = it.value();
492 if ( (prn.system() == 'G' && plotGPS) ||
493 (prn.system() == 'R' && plotGlo) ||
494 (prn.system() == 'E' && plotGal) ) {
495
496 if (qcObs._eleSet) {
497 (*dataSNR1) << (new t_polarPoint(qcObs._azDeg, 90.0 - qcObs._eleDeg, qcObs._SNR1));
498 (*dataSNR2) << (new t_polarPoint(qcObs._azDeg, 90.0 - qcObs._eleDeg, qcObs._SNR2));
499 (*dataMP1) << (new t_polarPoint(qcObs._azDeg, 90.0 - qcObs._eleDeg, qcObs._stdMP1));
500 (*dataMP2) << (new t_polarPoint(qcObs._azDeg, 90.0 - qcObs._eleDeg, qcObs._stdMP2));
501 }
502 }
503 }
504 }
505
506 // Show the plots
507 // --------------
508 if (BNC_CORE->GUIenabled()) {
509 QFileInfo fileInfo(obsFile->fileName());
510 QByteArray title = fileInfo.fileName().toAscii();
511 emit dspSkyPlot(obsFile->fileName(), "MP1", dataMP1, "MP2", dataMP2, "Meters", 2.0);
512 emit dspSkyPlot(obsFile->fileName(), "SNR1", dataSNR1, "SNR2", dataSNR2, "dbHz", 54.0);
513 emit dspAvailPlot(obsFile->fileName(), title);
514 }
515 else {
516 for (int ii = 0; ii < dataMP1->size(); ii++) {
517 delete dataMP1->at(ii);
518 }
519 delete dataMP1;
520 for (int ii = 0; ii < dataMP2->size(); ii++) {
521 delete dataMP2->at(ii);
522 }
523 delete dataMP2;
524 for (int ii = 0; ii < dataSNR1->size(); ii++) {
525 delete dataSNR1->at(ii);
526 }
527 delete dataSNR1;
528 for (int ii = 0; ii < dataSNR2->size(); ii++) {
529 delete dataSNR2->at(ii);
530 }
531 delete dataSNR2;
532 }
533}
534
535//
536////////////////////////////////////////////////////////////////////////////
537void t_reqcAnalyze::slotDspSkyPlot(const QString& fileName, const QByteArray& title1,
538 QVector<t_polarPoint*>* data1, const QByteArray& title2,
539 QVector<t_polarPoint*>* data2, const QByteArray& scaleTitle,
540 double maxValue) {
541
542 if (BNC_CORE->GUIenabled()) {
543
544 if (maxValue == 0.0) {
545 if (data1) {
546 for (int ii = 0; ii < data1->size(); ii++) {
547 double val = data1->at(ii)->_value;
548 if (maxValue < val) {
549 maxValue = val;
550 }
551 }
552 }
553 if (data2) {
554 for (int ii = 0; ii < data2->size(); ii++) {
555 double val = data2->at(ii)->_value;
556 if (maxValue < val) {
557 maxValue = val;
558 }
559 }
560 }
561 }
562
563 QwtInterval scaleInterval(0.0, maxValue);
564
565 QVector<QWidget*> plots;
566 if (data1) {
567 t_polarPlot* plot1 = new t_polarPlot(QwtText(title1), scaleInterval,
568 BNC_CORE->mainWindow());
569 plot1->addCurve(data1);
570 plots << plot1;
571 }
572 if (data2) {
573 t_polarPlot* plot2 = new t_polarPlot(QwtText(title2), scaleInterval,
574 BNC_CORE->mainWindow());
575 plot2->addCurve(data2);
576 plots << plot2;
577 }
578
579 t_graphWin* graphWin = new t_graphWin(0, fileName, plots,
580 &scaleTitle, &scaleInterval);
581
582 graphWin->show();
583
584 bncSettings settings;
585 QString dirName = settings.value("reqcPlotDir").toString();
586 if (!dirName.isEmpty()) {
587 QByteArray ext = (scaleTitle == "Meters") ? "_M.png" : "_S.png";
588 graphWin->savePNG(dirName, ext);
589 }
590 }
591}
592
593//
594////////////////////////////////////////////////////////////////////////////
595void t_reqcAnalyze::slotDspAvailPlot(const QString& fileName, const QByteArray& title) {
596
597 t_plotData plotData;
598 QMap<t_prn, t_plotData> plotDataMap;
599
600 for (int ii = 0; ii < _qcFile._qcEpo.size(); ii++) {
601 const t_qcEpo& qcEpo = _qcFile._qcEpo[ii];
602 double mjdX24 = qcEpo._epoTime.mjddec() * 24.0;
603
604 plotData._mjdX24 << mjdX24;
605 plotData._PDOP << qcEpo._PDOP;
606 plotData._numSat << qcEpo._qcObs.size();
607
608 QMapIterator<t_prn, t_qcObs> it(qcEpo._qcObs);
609 while (it.hasNext()) {
610 it.next();
611 const t_prn& prn = it.key();
612 const t_qcObs& qcObs = it.value();
613 t_plotData& data = plotDataMap[prn];
614 data._mjdX24 << mjdX24;
615 data._eleDeg << qcObs._eleDeg;
616 if (qcObs._hasL1) {
617 if (qcObs._slipL1) {
618 data._L1slip << mjdX24;
619 }
620 else if (qcObs._gapL1) {
621 data._L1gap << mjdX24;
622 }
623 else {
624 data._L1ok << mjdX24;
625 }
626 }
627 if (qcObs._hasL2) {
628 if (qcObs._slipL2) {
629 data._L2slip << mjdX24;
630 }
631 else if (qcObs._gapL2) {
632 data._L2gap << mjdX24;
633 }
634 else {
635 data._L2ok << mjdX24;
636 }
637 }
638 }
639 }
640
641
642 if (BNC_CORE->GUIenabled()) {
643 t_availPlot* plotA = new t_availPlot(0, plotDataMap);
644 plotA->setTitle(title);
645
646 t_elePlot* plotZ = new t_elePlot(0, plotDataMap);
647
648 t_dopPlot* plotD = new t_dopPlot(0, plotData);
649
650 QVector<QWidget*> plots;
651 plots << plotA << plotZ << plotD;
652 t_graphWin* graphWin = new t_graphWin(0, fileName, plots, 0, 0);
653
654 int ww = QFontMetrics(graphWin->font()).width('w');
655 graphWin->setMinimumSize(120*ww, 40*ww);
656
657 graphWin->show();
658
659 bncSettings settings;
660 QString dirName = settings.value("reqcPlotDir").toString();
661 if (!dirName.isEmpty()) {
662 QByteArray ext = "_A.png";
663 graphWin->savePNG(dirName, ext);
664 }
665 }
666}
667
668// Finish the report
669////////////////////////////////////////////////////////////////////////////
670void t_reqcAnalyze::printReport(const t_rnxObsFile* obsFile) {
671
672 if (!_log) {
673 return;
674 }
675
676 *_log << "File: " << obsFile->fileName().toAscii().data() << endl
677 << "Marker name: " << _qcFile._markerName << endl
678 << "Receiver: " << _qcFile._receiverType << endl
679 << "Antenna: " << _qcFile._antennaName << endl
680 << "Start time: " << _qcFile._startTime.datestr().c_str() << ' '
681 << _qcFile._startTime.timestr().c_str() << endl
682 << "End time: " << _qcFile._endTime.datestr().c_str() << ' '
683 << _qcFile._endTime.timestr().c_str() << endl
684 << "Interval: " << _qcFile._interval << endl
685 << "# Sat.: " << _qcFile._qcSat.size() << endl;
686
687 int numObs = 0;
688 int numSlipsFlagged = 0;
689 int numSlipsFound = 0;
690 QMapIterator<t_prn, t_qcSat> it(_qcFile._qcSat);
691 while (it.hasNext()) {
692 it.next();
693 const t_qcSat& qcSat = it.value();
694 numObs += qcSat._numObs;
695 numSlipsFlagged += qcSat._numSlipsFlagged;
696 numSlipsFound += qcSat._numSlipsFound;
697 }
698 *_log << "# Obs.: " << numObs << endl
699 << "# Slips (file): " << numSlipsFlagged << endl
700 << "# Slips (found): " << numSlipsFound << endl;
701
702 _log->flush();
703}
Note: See TracBrowser for help on using the repository browser.