[3899] | 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 | *
|
---|
[6255] | 37 | * Changes:
|
---|
[3899] | 38 | *
|
---|
| 39 | * -----------------------------------------------------------------------*/
|
---|
| 40 |
|
---|
| 41 | #include <iostream>
|
---|
[4361] | 42 | #include <iomanip>
|
---|
[4579] | 43 | #include <qwt_plot_renderer.h>
|
---|
[4574] | 44 |
|
---|
[3899] | 45 | #include "reqcanalyze.h"
|
---|
[5070] | 46 | #include "bnccore.h"
|
---|
[3899] | 47 | #include "bncsettings.h"
|
---|
[4254] | 48 | #include "reqcedit.h"
|
---|
[4255] | 49 | #include "bncutils.h"
|
---|
[4300] | 50 | #include "graphwin.h"
|
---|
[4307] | 51 | #include "polarplot.h"
|
---|
[4577] | 52 | #include "availplot.h"
|
---|
[4662] | 53 | #include "eleplot.h"
|
---|
[4672] | 54 | #include "dopplot.h"
|
---|
[3899] | 55 |
|
---|
| 56 | using namespace std;
|
---|
| 57 |
|
---|
| 58 | // Constructor
|
---|
| 59 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 60 | t_reqcAnalyze::t_reqcAnalyze(QObject* parent) : QThread(parent) {
|
---|
| 61 |
|
---|
| 62 | bncSettings settings;
|
---|
[4254] | 63 |
|
---|
[4257] | 64 | _logFileName = settings.value("reqcOutLogFile").toString(); expandEnvVar(_logFileName);
|
---|
| 65 | _logFile = 0;
|
---|
| 66 | _log = 0;
|
---|
[6271] | 67 | _currEpo = 0;
|
---|
[4254] | 68 | _obsFileNames = settings.value("reqcObsFile").toString().split(",", QString::SkipEmptyParts);
|
---|
[4257] | 69 | _navFileNames = settings.value("reqcNavFile").toString().split(",", QString::SkipEmptyParts);
|
---|
[6275] | 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&)));
|
---|
[3899] | 80 | }
|
---|
| 81 |
|
---|
| 82 | // Destructor
|
---|
| 83 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 84 | t_reqcAnalyze::~t_reqcAnalyze() {
|
---|
[4255] | 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;
|
---|
[5072] | 93 | if (BNC_CORE->mode() != t_bncCore::interactive) {
|
---|
[5066] | 94 | qApp->exit(0);
|
---|
[4452] | 95 | }
|
---|
[3899] | 96 | }
|
---|
| 97 |
|
---|
[6255] | 98 | //
|
---|
[3899] | 99 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 100 | void t_reqcAnalyze::run() {
|
---|
| 101 |
|
---|
[4255] | 102 | // Open Log File
|
---|
| 103 | // -------------
|
---|
| 104 | _logFile = new QFile(_logFileName);
|
---|
[4517] | 105 | if (_logFile->open(QIODevice::WriteOnly | QIODevice::Text)) {
|
---|
| 106 | _log = new QTextStream();
|
---|
| 107 | _log->setDevice(_logFile);
|
---|
| 108 | }
|
---|
[4255] | 109 |
|
---|
| 110 | // Initialize RINEX Observation Files
|
---|
| 111 | // ----------------------------------
|
---|
[4525] | 112 | t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _log);
|
---|
[3899] | 113 |
|
---|
[4257] | 114 | // Read Ephemerides
|
---|
| 115 | // ----------------
|
---|
| 116 | t_reqcEdit::readEphemerides(_navFileNames, _ephs);
|
---|
| 117 |
|
---|
[4255] | 118 | // Loop over all RINEX Files
|
---|
| 119 | // -------------------------
|
---|
[4254] | 120 | for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
|
---|
| 121 | analyzeFile(_rnxObsFiles[ii]);
|
---|
| 122 | }
|
---|
| 123 |
|
---|
[4255] | 124 | // Exit
|
---|
| 125 | // ----
|
---|
[4452] | 126 | emit finished();
|
---|
| 127 | deleteLater();
|
---|
[3899] | 128 | }
|
---|
[4254] | 129 |
|
---|
[6255] | 130 | //
|
---|
[4254] | 131 | ////////////////////////////////////////////////////////////////////////////
|
---|
[4260] | 132 | void t_reqcAnalyze::analyzeFile(t_rnxObsFile* obsFile) {
|
---|
[4259] | 133 |
|
---|
[6271] | 134 | _qcFile.clear();
|
---|
[4343] | 135 |
|
---|
[4342] | 136 | // A priori Coordinates
|
---|
| 137 | // --------------------
|
---|
[4679] | 138 | ColumnVector xyzSta = obsFile->xyz();
|
---|
[4342] | 139 |
|
---|
[4262] | 140 | // Loop over all Epochs
|
---|
| 141 | // --------------------
|
---|
[4541] | 142 | try {
|
---|
[6296] | 143 | QMap<QString, bncTime> lastObsTime;
|
---|
[6271] | 144 | bool firstEpo = true;
|
---|
[4541] | 145 | while ( (_currEpo = obsFile->nextEpoch()) != 0) {
|
---|
[6271] | 146 | if (firstEpo) {
|
---|
| 147 | firstEpo = false;
|
---|
| 148 | _qcFile._startTime = _currEpo->tt;
|
---|
| 149 | _qcFile._antennaName = obsFile->antennaName();
|
---|
| 150 | _qcFile._markerName = obsFile->markerName();
|
---|
| 151 | _qcFile._receiverType = obsFile->receiverType();
|
---|
| 152 | _qcFile._interval = obsFile->interval();
|
---|
[4688] | 153 | }
|
---|
[6271] | 154 | _qcFile._endTime = _currEpo->tt;
|
---|
[6255] | 155 |
|
---|
[6271] | 156 | t_qcEpo qcEpo;
|
---|
| 157 | qcEpo._epoTime = _currEpo->tt;
|
---|
| 158 | qcEpo._PDOP = cmpDOP(xyzSta);
|
---|
| 159 |
|
---|
[4541] | 160 | // Loop over all satellites
|
---|
| 161 | // ------------------------
|
---|
| 162 | for (unsigned iObs = 0; iObs < _currEpo->rnxSat.size(); iObs++) {
|
---|
| 163 | const t_rnxObsFile::t_rnxSat& rnxSat = _currEpo->rnxSat[iObs];
|
---|
[6271] | 164 | t_satObs satObs;
|
---|
| 165 | t_rnxObsFile::setObsFromRnx(obsFile, _currEpo, rnxSat, satObs);
|
---|
[6288] | 166 | t_qcSat& qcSat = qcEpo._qcSat[satObs._prn];
|
---|
[6296] | 167 | setQcObs(qcEpo._epoTime, xyzSta, satObs, lastObsTime, qcSat);
|
---|
[6288] | 168 | updateQcSat(qcSat, _qcFile._qcSatSum[satObs._prn]);
|
---|
[4262] | 169 | }
|
---|
[6271] | 170 | _qcFile._qcEpo.push_back(qcEpo);
|
---|
| 171 | }
|
---|
[6255] | 172 |
|
---|
[6281] | 173 | analyzeMultipath();
|
---|
| 174 |
|
---|
[6271] | 175 | preparePlotData(obsFile);
|
---|
[4678] | 176 |
|
---|
[6284] | 177 | printReport(obsFile);
|
---|
[4541] | 178 | }
|
---|
| 179 | catch (QString str) {
|
---|
| 180 | if (_log) {
|
---|
| 181 | *_log << "Exception " << str << endl;
|
---|
[4262] | 182 | }
|
---|
[4541] | 183 | else {
|
---|
[6255] | 184 | qDebug() << str;
|
---|
[4541] | 185 | }
|
---|
| 186 | }
|
---|
[6271] | 187 | }
|
---|
[4262] | 188 |
|
---|
[6271] | 189 | // Compute Dilution of Precision
|
---|
| 190 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 191 | double t_reqcAnalyze::cmpDOP(const ColumnVector& xyzSta) const {
|
---|
[4268] | 192 |
|
---|
[6271] | 193 | if (xyzSta.size() != 3) {
|
---|
| 194 | return 0.0;
|
---|
[4268] | 195 | }
|
---|
| 196 |
|
---|
[6271] | 197 | unsigned nSat = _currEpo->rnxSat.size();
|
---|
[4706] | 198 |
|
---|
[6271] | 199 | if (nSat < 4) {
|
---|
| 200 | return 0.0;
|
---|
[4718] | 201 | }
|
---|
[6271] | 202 |
|
---|
| 203 | Matrix AA(nSat, 4);
|
---|
| 204 |
|
---|
| 205 | unsigned nSatUsed = 0;
|
---|
| 206 | for (unsigned iSat = 0; iSat < nSat; iSat++) {
|
---|
| 207 |
|
---|
| 208 | const t_rnxObsFile::t_rnxSat& rnxSat = _currEpo->rnxSat[iSat];
|
---|
| 209 | const t_prn& prn = rnxSat.prn;
|
---|
| 210 |
|
---|
| 211 | t_eph* eph = 0;
|
---|
| 212 | for (int ie = 0; ie < _ephs.size(); ie++) {
|
---|
| 213 | if (_ephs[ie]->prn() == prn) {
|
---|
| 214 | eph = _ephs[ie];
|
---|
| 215 | break;
|
---|
| 216 | }
|
---|
[4718] | 217 | }
|
---|
[6271] | 218 | if (eph) {
|
---|
| 219 | ColumnVector xSat(4);
|
---|
| 220 | ColumnVector vv(3);
|
---|
| 221 | if (eph->getCrd(_currEpo->tt, xSat, vv, false) == success) {
|
---|
| 222 | ++nSatUsed;
|
---|
| 223 | ColumnVector dx = xSat.Rows(1,3) - xyzSta;
|
---|
| 224 | double rho = dx.norm_Frobenius();
|
---|
| 225 | AA(nSatUsed,1) = dx(1) / rho;
|
---|
| 226 | AA(nSatUsed,2) = dx(2) / rho;
|
---|
| 227 | AA(nSatUsed,3) = dx(3) / rho;
|
---|
| 228 | AA(nSatUsed,4) = 1.0;
|
---|
| 229 | }
|
---|
[4718] | 230 | }
|
---|
| 231 | }
|
---|
[6271] | 232 |
|
---|
| 233 | if (nSatUsed < 4) {
|
---|
| 234 | return 0.0;
|
---|
| 235 | }
|
---|
| 236 |
|
---|
| 237 | AA = AA.Rows(1, nSatUsed);
|
---|
| 238 |
|
---|
| 239 | SymmetricMatrix QQ;
|
---|
| 240 | QQ << AA.t() * AA;
|
---|
| 241 | QQ = QQ.i();
|
---|
| 242 |
|
---|
| 243 | return sqrt(QQ.trace());
|
---|
[4254] | 244 | }
|
---|
[4263] | 245 |
|
---|
[6255] | 246 | //
|
---|
[4263] | 247 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6288] | 248 | void t_reqcAnalyze::updateQcSat(const t_qcSat& qcSat, t_qcSatSum& qcSatSum) {
|
---|
[6285] | 249 |
|
---|
[6288] | 250 | for (int ii = 0; ii < qcSat._qcFrq.size(); ii++) {
|
---|
| 251 | const t_qcFrq& qcFrq = qcSat._qcFrq[ii];
|
---|
[6285] | 252 | t_qcFrqSum& qcFrqSum = qcSatSum._qcFrqSum[qcFrq._rnxType2ch];
|
---|
| 253 | qcFrqSum._numObs += 1;
|
---|
| 254 | if (qcFrq._slip) {
|
---|
| 255 | qcFrqSum._numSlipsFlagged += 1;
|
---|
| 256 | }
|
---|
| 257 | if (qcFrq._gap) {
|
---|
| 258 | qcFrqSum._numGaps += 1;
|
---|
| 259 | }
|
---|
[6271] | 260 | }
|
---|
| 261 | }
|
---|
[4265] | 262 |
|
---|
[6271] | 263 | //
|
---|
| 264 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6281] | 265 | void t_reqcAnalyze::setQcObs(const bncTime& epoTime, const ColumnVector& xyzSta,
|
---|
[6296] | 266 | const t_satObs& satObs, QMap<QString, bncTime>& lastObsTime,
|
---|
| 267 | t_qcSat& qcSat) {
|
---|
[4338] | 268 |
|
---|
[6281] | 269 | t_eph* eph = 0;
|
---|
| 270 | for (int ie = 0; ie < _ephs.size(); ie++) {
|
---|
| 271 | if (_ephs[ie]->prn() == satObs._prn) {
|
---|
| 272 | eph = _ephs[ie];
|
---|
| 273 | break;
|
---|
[6271] | 274 | }
|
---|
[6281] | 275 | }
|
---|
| 276 | if (eph) {
|
---|
| 277 | ColumnVector xc(4);
|
---|
| 278 | ColumnVector vv(3);
|
---|
| 279 | if (xyzSta.size() && eph->getCrd(epoTime, xc, vv, false) == success) {
|
---|
| 280 | double rho, eleSat, azSat;
|
---|
| 281 | topos(xyzSta(1), xyzSta(2), xyzSta(3), xc(1), xc(2), xc(3), rho, eleSat, azSat);
|
---|
[6288] | 282 | qcSat._eleSet = true;
|
---|
| 283 | qcSat._azDeg = azSat * 180.0/M_PI;
|
---|
| 284 | qcSat._eleDeg = eleSat * 180.0/M_PI;
|
---|
[6281] | 285 | }
|
---|
| 286 | if (satObs._prn.system() == 'R') {
|
---|
[6288] | 287 | qcSat._slotSet = true;
|
---|
| 288 | qcSat._slotNum = eph->slotNum();
|
---|
[6271] | 289 | }
|
---|
| 290 | }
|
---|
| 291 |
|
---|
[4608] | 292 | // Availability and Slip Flags
|
---|
| 293 | // ---------------------------
|
---|
[6285] | 294 | for (unsigned ii = 0; ii < satObs._obs.size(); ii++) {
|
---|
| 295 |
|
---|
| 296 | const t_frqObs* frqObs = satObs._obs[ii];
|
---|
| 297 |
|
---|
[6288] | 298 | qcSat._qcFrq.push_back(t_qcFrq());
|
---|
| 299 | t_qcFrq& qcFrq = qcSat._qcFrq.back();
|
---|
[6285] | 300 |
|
---|
| 301 | qcFrq._rnxType2ch = QString(frqObs->_rnxType2ch.c_str());
|
---|
| 302 | qcFrq._SNR = frqObs->_snr;
|
---|
| 303 | qcFrq._slip = frqObs->_slip;
|
---|
[6293] | 304 | qcFrq._phaseValid = frqObs->_phaseValid;
|
---|
| 305 | qcFrq._codeValid = frqObs->_codeValid;
|
---|
[6285] | 306 |
|
---|
| 307 | // Check Gaps
|
---|
| 308 | // ----------
|
---|
[6296] | 309 | QString key = QString(satObs._prn.toString().c_str()) + qcFrq._rnxType2ch;
|
---|
| 310 | if (lastObsTime[key].valid()) {
|
---|
| 311 | double dt = epoTime - lastObsTime[key];
|
---|
[6285] | 312 | if (dt > 1.5 * _qcFile._interval) {
|
---|
| 313 | qcFrq._gap = true;
|
---|
[6137] | 314 | }
|
---|
| 315 | }
|
---|
[6296] | 316 | lastObsTime[key] = epoTime;
|
---|
[6285] | 317 |
|
---|
| 318 | // Compute the Multipath Linear Combination
|
---|
| 319 | // ----------------------------------------
|
---|
[6292] | 320 | if (frqObs->_codeValid) {
|
---|
[6285] | 321 | t_frequency::type fA;
|
---|
| 322 | t_frequency::type fB;
|
---|
| 323 | if (satObs._prn.system() == 'G') {
|
---|
| 324 | if (frqObs->_rnxType2ch[0] == '1') {
|
---|
| 325 | fA = t_frequency::G1;
|
---|
| 326 | fB = t_frequency::G2;
|
---|
| 327 | }
|
---|
| 328 | else if (frqObs->_rnxType2ch[0] == '2') {
|
---|
| 329 | fA = t_frequency::G2;
|
---|
| 330 | fB = t_frequency::G1;
|
---|
| 331 | }
|
---|
[6137] | 332 | }
|
---|
[6285] | 333 | else if (satObs._prn.system() == 'R') {
|
---|
| 334 | if (frqObs->_rnxType2ch[0] == '1') {
|
---|
| 335 | fA = t_frequency::R1;
|
---|
| 336 | fB = t_frequency::R2;
|
---|
| 337 | }
|
---|
| 338 | else if (frqObs->_rnxType2ch[0] == '2') {
|
---|
| 339 | fA = t_frequency::R2;
|
---|
| 340 | fB = t_frequency::R1;
|
---|
| 341 | }
|
---|
[6137] | 342 | }
|
---|
[6285] | 343 | else if (satObs._prn.system() == 'E') {
|
---|
| 344 | if (frqObs->_rnxType2ch[0] == '1') {
|
---|
| 345 | fA = t_frequency::E1;
|
---|
| 346 | fB = t_frequency::E5;
|
---|
| 347 | }
|
---|
| 348 | else if (frqObs->_rnxType2ch[0] == '5') {
|
---|
| 349 | fA = t_frequency::E5;
|
---|
| 350 | fB = t_frequency::E1;
|
---|
| 351 | }
|
---|
[6137] | 352 | }
|
---|
[4608] | 353 |
|
---|
[6285] | 354 | if (fA != t_frequency::dummy && fB != t_frequency::dummy) {
|
---|
[6292] | 355 | double f_a = t_CST::freq(fA, qcSat._slotNum);
|
---|
| 356 | double f_b = t_CST::freq(fB, qcSat._slotNum);
|
---|
| 357 | double C_a = frqObs->_code;
|
---|
| 358 |
|
---|
| 359 | bool foundA = false;
|
---|
| 360 | double L_a = 0.0;
|
---|
| 361 | bool foundB = false;
|
---|
| 362 | double L_b = 0.0;
|
---|
[6285] | 363 | for (unsigned jj = 0; jj < satObs._obs.size(); jj++) {
|
---|
[6292] | 364 | const t_frqObs* frqObsHlp = satObs._obs[jj];
|
---|
| 365 | if (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fA)[1] &&
|
---|
| 366 | frqObsHlp->_phaseValid) {
|
---|
| 367 | foundA = true;
|
---|
| 368 | L_a = frqObsHlp->_phase * t_CST::c / f_a;
|
---|
[6285] | 369 | }
|
---|
[6292] | 370 | else if (frqObsHlp->_rnxType2ch[0] == t_frequency::toString(fB)[1] &&
|
---|
| 371 | frqObsHlp->_phaseValid) {
|
---|
| 372 | foundB = true;
|
---|
| 373 | L_b = frqObsHlp->_phase * t_CST::c / f_b;
|
---|
| 374 | }
|
---|
[6285] | 375 | }
|
---|
[6292] | 376 | if (foundA && foundB) {
|
---|
| 377 | qcFrq._setMP = true;
|
---|
| 378 | qcFrq._rawMP = C_a - L_a - 2.0*f_b*f_b/(f_a*f_a-f_b*f_b) * (L_a - L_b);
|
---|
| 379 | }
|
---|
[6285] | 380 | }
|
---|
| 381 | }
|
---|
[6291] | 382 | } // satObs loop
|
---|
[4263] | 383 | }
|
---|
[4350] | 384 |
|
---|
[6255] | 385 | //
|
---|
[4350] | 386 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6281] | 387 | void t_reqcAnalyze::analyzeMultipath() {
|
---|
[4675] | 388 |
|
---|
[6271] | 389 | const double SLIPTRESH = 10.0; // cycle-slip threshold (meters)
|
---|
| 390 | const double chunkStep = 600.0; // 10 minutes
|
---|
[4584] | 391 |
|
---|
[6271] | 392 | // Loop over all satellites available
|
---|
| 393 | // ----------------------------------
|
---|
[6285] | 394 | QMutableMapIterator<t_prn, t_qcSatSum> itSat(_qcFile._qcSatSum);
|
---|
| 395 | while (itSat.hasNext()) {
|
---|
| 396 | itSat.next();
|
---|
| 397 | const t_prn& prn = itSat.key();
|
---|
| 398 | t_qcSatSum& qcSatSum = itSat.value();
|
---|
[4351] | 399 |
|
---|
[6285] | 400 | // Loop over all frequencies available
|
---|
| 401 | // -----------------------------------
|
---|
| 402 | QMutableMapIterator<QString, t_qcFrqSum> itFrq(qcSatSum._qcFrqSum);
|
---|
| 403 | while (itFrq.hasNext()) {
|
---|
| 404 | itFrq.next();
|
---|
| 405 | const QString& frqType = itFrq.key();
|
---|
| 406 | t_qcFrqSum& qcFrqSum = itFrq.value();
|
---|
[4702] | 407 |
|
---|
[4353] | 408 |
|
---|
[6285] | 409 | // Loop over all Chunks of Data
|
---|
| 410 | // ----------------------------
|
---|
| 411 | for (bncTime chunkStart = _qcFile._startTime;
|
---|
| 412 | chunkStart < _qcFile._endTime; chunkStart += chunkStep) {
|
---|
| 413 |
|
---|
| 414 | bncTime chunkEnd = chunkStart + chunkStep;
|
---|
| 415 |
|
---|
| 416 | QVector<t_qcFrq*> frqVec;
|
---|
| 417 | QVector<double> MP;
|
---|
[6271] | 418 |
|
---|
[6285] | 419 | // Loop over all Epochs within one Chunk of Data
|
---|
| 420 | // ---------------------------------------------
|
---|
| 421 | for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) {
|
---|
| 422 | t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo];
|
---|
| 423 | if (chunkStart <= qcEpo._epoTime && qcEpo._epoTime < chunkEnd) {
|
---|
[6288] | 424 | if (qcEpo._qcSat.contains(prn)) {
|
---|
| 425 | t_qcSat& qcSat = qcEpo._qcSat[prn];
|
---|
| 426 | for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) {
|
---|
| 427 | t_qcFrq& qcFrq = qcSat._qcFrq[iFrq];
|
---|
[6285] | 428 | if (qcFrq._rnxType2ch == frqType) {
|
---|
| 429 | frqVec << &qcFrq;
|
---|
| 430 | if (qcFrq._setMP) {
|
---|
| 431 | MP << qcFrq._rawMP;
|
---|
| 432 | }
|
---|
| 433 | }
|
---|
| 434 | }
|
---|
[6213] | 435 | }
|
---|
[4590] | 436 | }
|
---|
| 437 | }
|
---|
[4563] | 438 |
|
---|
[6285] | 439 | // Compute the multipath mean and standard deviation
|
---|
| 440 | // -------------------------------------------------
|
---|
| 441 | if (MP.size() > 1) {
|
---|
| 442 | double meanMP = 0.0;
|
---|
| 443 | for (int ii = 0; ii < MP.size(); ii++) {
|
---|
| 444 | meanMP += MP[ii];
|
---|
[6271] | 445 | }
|
---|
[6285] | 446 | meanMP /= MP.size();
|
---|
| 447 |
|
---|
| 448 | bool slipMP = false;
|
---|
| 449 |
|
---|
| 450 | double stdMP = 0.0;
|
---|
| 451 | for (int ii = 0; ii < MP.size(); ii++) {
|
---|
| 452 | double diff = MP[ii] - meanMP;
|
---|
| 453 | if (fabs(diff) > SLIPTRESH) {
|
---|
| 454 | slipMP = true;
|
---|
| 455 | break;
|
---|
| 456 | }
|
---|
| 457 | stdMP += diff * diff;
|
---|
| 458 | }
|
---|
| 459 |
|
---|
[6281] | 460 | if (slipMP) {
|
---|
[6285] | 461 | stdMP = 0.0;
|
---|
| 462 | stdMP = 0.0;
|
---|
| 463 | qcFrqSum._numSlipsFound += 1;
|
---|
[6281] | 464 | }
|
---|
| 465 | else {
|
---|
[6285] | 466 | stdMP = sqrt(stdMP / (MP.size()-1));
|
---|
[6281] | 467 | }
|
---|
[6285] | 468 |
|
---|
| 469 | for (int ii = 0; ii < frqVec.size(); ii++) {
|
---|
| 470 | t_qcFrq* qcFrq = frqVec[ii];
|
---|
| 471 | if (slipMP) {
|
---|
| 472 | qcFrq->_slip = true;
|
---|
| 473 | }
|
---|
| 474 | else {
|
---|
| 475 | qcFrq->_stdMP = stdMP;
|
---|
| 476 | }
|
---|
| 477 | }
|
---|
[6281] | 478 | }
|
---|
[6285] | 479 | } // chunk loop
|
---|
| 480 | } // frq loop
|
---|
| 481 | } // sat loop
|
---|
[6281] | 482 | }
|
---|
| 483 |
|
---|
| 484 | //
|
---|
| 485 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 486 | void t_reqcAnalyze::preparePlotData(const t_rnxObsFile* obsFile) {
|
---|
| 487 |
|
---|
| 488 | QVector<t_polarPoint*>* dataMP1 = new QVector<t_polarPoint*>;
|
---|
| 489 | QVector<t_polarPoint*>* dataMP2 = new QVector<t_polarPoint*>;
|
---|
| 490 | QVector<t_polarPoint*>* dataSNR1 = new QVector<t_polarPoint*>;
|
---|
| 491 | QVector<t_polarPoint*>* dataSNR2 = new QVector<t_polarPoint*>;
|
---|
| 492 |
|
---|
| 493 | bncSettings settings;
|
---|
| 494 | QString reqSkyPlotSystems = settings.value("reqcSkyPlotSystems").toString();
|
---|
| 495 | bool plotGPS = false;
|
---|
| 496 | bool plotGlo = false;
|
---|
| 497 | bool plotGal = false;
|
---|
| 498 | if (reqSkyPlotSystems == "GPS") {
|
---|
| 499 | plotGPS = true;
|
---|
| 500 | }
|
---|
| 501 | else if (reqSkyPlotSystems == "GLONASS") {
|
---|
| 502 | plotGlo = true;
|
---|
| 503 | }
|
---|
| 504 | else if (reqSkyPlotSystems == "Galileo") {
|
---|
| 505 | plotGal = true;
|
---|
| 506 | }
|
---|
| 507 | else {
|
---|
| 508 | plotGPS = true;
|
---|
| 509 | plotGlo = true;
|
---|
| 510 | plotGal = true;
|
---|
| 511 | }
|
---|
| 512 |
|
---|
| 513 | // Loop over all observations
|
---|
| 514 | // --------------------------
|
---|
| 515 | for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) {
|
---|
| 516 | t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo];
|
---|
[6288] | 517 | QMapIterator<t_prn, t_qcSat> it(qcEpo._qcSat);
|
---|
[6281] | 518 | while (it.hasNext()) {
|
---|
| 519 | it.next();
|
---|
| 520 | const t_prn& prn = it.key();
|
---|
[6288] | 521 | const t_qcSat& qcSat = it.value();
|
---|
[6271] | 522 | if ( (prn.system() == 'G' && plotGPS) ||
|
---|
| 523 | (prn.system() == 'R' && plotGlo) ||
|
---|
| 524 | (prn.system() == 'E' && plotGal) ) {
|
---|
[6281] | 525 |
|
---|
[6288] | 526 | if (qcSat._eleSet) {
|
---|
[6286] | 527 | QString frqType1;
|
---|
| 528 | QString frqType2;
|
---|
[6288] | 529 | for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) {
|
---|
| 530 | const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq];
|
---|
[6287] | 531 | if (qcFrq._rnxType2ch[0] == '1' && frqType1.isEmpty()) {
|
---|
[6286] | 532 | frqType1 = qcFrq._rnxType2ch;
|
---|
| 533 | }
|
---|
[6287] | 534 | if (qcFrq._rnxType2ch[0] == '2' && frqType2.isEmpty()) {
|
---|
[6286] | 535 | frqType2 = qcFrq._rnxType2ch;
|
---|
| 536 | }
|
---|
| 537 | if (qcFrq._rnxType2ch == frqType1) {
|
---|
[6288] | 538 | (*dataSNR1) << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._SNR));
|
---|
| 539 | (*dataMP1) << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._stdMP));
|
---|
[6286] | 540 | }
|
---|
| 541 | else if (qcFrq._rnxType2ch == frqType2) {
|
---|
[6288] | 542 | (*dataSNR2) << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._SNR));
|
---|
| 543 | (*dataMP2) << (new t_polarPoint(qcSat._azDeg, 90.0 - qcSat._eleDeg, qcFrq._stdMP));
|
---|
[6286] | 544 | }
|
---|
| 545 | }
|
---|
[6284] | 546 | }
|
---|
[4700] | 547 | }
|
---|
[4353] | 548 | }
|
---|
[6271] | 549 | }
|
---|
[4353] | 550 |
|
---|
[6271] | 551 | // Show the plots
|
---|
| 552 | // --------------
|
---|
| 553 | if (BNC_CORE->GUIenabled()) {
|
---|
| 554 | QFileInfo fileInfo(obsFile->fileName());
|
---|
| 555 | QByteArray title = fileInfo.fileName().toAscii();
|
---|
[6286] | 556 | emit dspSkyPlot(obsFile->fileName(), "MP1", dataMP1, "MP2", dataMP2, "Meters", 2.0);
|
---|
| 557 | emit dspSkyPlot(obsFile->fileName(), "SNR1", dataSNR1, "SNR2", dataSNR2, "dbHz", 54.0);
|
---|
[6275] | 558 | emit dspAvailPlot(obsFile->fileName(), title);
|
---|
[6271] | 559 | }
|
---|
| 560 | else {
|
---|
| 561 | for (int ii = 0; ii < dataMP1->size(); ii++) {
|
---|
| 562 | delete dataMP1->at(ii);
|
---|
[4351] | 563 | }
|
---|
[6271] | 564 | delete dataMP1;
|
---|
| 565 | for (int ii = 0; ii < dataMP2->size(); ii++) {
|
---|
| 566 | delete dataMP2->at(ii);
|
---|
[4591] | 567 | }
|
---|
[6271] | 568 | delete dataMP2;
|
---|
| 569 | for (int ii = 0; ii < dataSNR1->size(); ii++) {
|
---|
| 570 | delete dataSNR1->at(ii);
|
---|
[4659] | 571 | }
|
---|
[6271] | 572 | delete dataSNR1;
|
---|
| 573 | for (int ii = 0; ii < dataSNR2->size(); ii++) {
|
---|
| 574 | delete dataSNR2->at(ii);
|
---|
[5141] | 575 | }
|
---|
[6271] | 576 | delete dataSNR2;
|
---|
[4350] | 577 | }
|
---|
| 578 | }
|
---|
[4572] | 579 |
|
---|
[6255] | 580 | //
|
---|
[4572] | 581 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6275] | 582 | void t_reqcAnalyze::slotDspSkyPlot(const QString& fileName, const QByteArray& title1,
|
---|
| 583 | QVector<t_polarPoint*>* data1, const QByteArray& title2,
|
---|
| 584 | QVector<t_polarPoint*>* data2, const QByteArray& scaleTitle,
|
---|
| 585 | double maxValue) {
|
---|
[4572] | 586 |
|
---|
[5068] | 587 | if (BNC_CORE->GUIenabled()) {
|
---|
[4573] | 588 |
|
---|
[6271] | 589 | if (maxValue == 0.0) {
|
---|
| 590 | if (data1) {
|
---|
| 591 | for (int ii = 0; ii < data1->size(); ii++) {
|
---|
| 592 | double val = data1->at(ii)->_value;
|
---|
| 593 | if (maxValue < val) {
|
---|
| 594 | maxValue = val;
|
---|
| 595 | }
|
---|
| 596 | }
|
---|
| 597 | }
|
---|
| 598 | if (data2) {
|
---|
| 599 | for (int ii = 0; ii < data2->size(); ii++) {
|
---|
| 600 | double val = data2->at(ii)->_value;
|
---|
| 601 | if (maxValue < val) {
|
---|
| 602 | maxValue = val;
|
---|
| 603 | }
|
---|
| 604 | }
|
---|
| 605 | }
|
---|
| 606 | }
|
---|
[4659] | 607 |
|
---|
[6271] | 608 | QwtInterval scaleInterval(0.0, maxValue);
|
---|
[4671] | 609 |
|
---|
[4573] | 610 | QVector<QWidget*> plots;
|
---|
[6271] | 611 | if (data1) {
|
---|
| 612 | t_polarPlot* plot1 = new t_polarPlot(QwtText(title1), scaleInterval,
|
---|
| 613 | BNC_CORE->mainWindow());
|
---|
| 614 | plot1->addCurve(data1);
|
---|
| 615 | plots << plot1;
|
---|
| 616 | }
|
---|
| 617 | if (data2) {
|
---|
| 618 | t_polarPlot* plot2 = new t_polarPlot(QwtText(title2), scaleInterval,
|
---|
| 619 | BNC_CORE->mainWindow());
|
---|
| 620 | plot2->addCurve(data2);
|
---|
| 621 | plots << plot2;
|
---|
| 622 | }
|
---|
[4666] | 623 |
|
---|
[6271] | 624 | t_graphWin* graphWin = new t_graphWin(0, fileName, plots,
|
---|
| 625 | &scaleTitle, &scaleInterval);
|
---|
[4666] | 626 |
|
---|
[4573] | 627 | graphWin->show();
|
---|
| 628 |
|
---|
| 629 | bncSettings settings;
|
---|
| 630 | QString dirName = settings.value("reqcPlotDir").toString();
|
---|
| 631 | if (!dirName.isEmpty()) {
|
---|
[6271] | 632 | QByteArray ext = (scaleTitle == "Meters") ? "_M.png" : "_S.png";
|
---|
[4579] | 633 | graphWin->savePNG(dirName, ext);
|
---|
[4573] | 634 | }
|
---|
| 635 | }
|
---|
[4572] | 636 | }
|
---|
[4679] | 637 |
|
---|
[6271] | 638 | //
|
---|
[4679] | 639 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6275] | 640 | void t_reqcAnalyze::slotDspAvailPlot(const QString& fileName, const QByteArray& title) {
|
---|
[4679] | 641 |
|
---|
[6280] | 642 | t_plotData plotData;
|
---|
[6278] | 643 | QMap<t_prn, t_plotData> plotDataMap;
|
---|
[6272] | 644 |
|
---|
[6278] | 645 | for (int ii = 0; ii < _qcFile._qcEpo.size(); ii++) {
|
---|
| 646 | const t_qcEpo& qcEpo = _qcFile._qcEpo[ii];
|
---|
[6280] | 647 | double mjdX24 = qcEpo._epoTime.mjddec() * 24.0;
|
---|
| 648 |
|
---|
| 649 | plotData._mjdX24 << mjdX24;
|
---|
| 650 | plotData._PDOP << qcEpo._PDOP;
|
---|
[6288] | 651 | plotData._numSat << qcEpo._qcSat.size();
|
---|
[6280] | 652 |
|
---|
[6288] | 653 | QMapIterator<t_prn, t_qcSat> it(qcEpo._qcSat);
|
---|
[6278] | 654 | while (it.hasNext()) {
|
---|
| 655 | it.next();
|
---|
| 656 | const t_prn& prn = it.key();
|
---|
[6288] | 657 | const t_qcSat& qcSat = it.value();
|
---|
[6280] | 658 | t_plotData& data = plotDataMap[prn];
|
---|
[6286] | 659 |
|
---|
[6297] | 660 | if (qcSat._eleSet) {
|
---|
| 661 | data._mjdX24 << mjdX24;
|
---|
| 662 | data._eleDeg << qcSat._eleDeg;
|
---|
| 663 | }
|
---|
[6286] | 664 |
|
---|
| 665 | QString frqType1;
|
---|
| 666 | QString frqType2;
|
---|
[6288] | 667 | for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) {
|
---|
| 668 | const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq];
|
---|
[6287] | 669 | if (qcFrq._rnxType2ch[0] == '1' && frqType1.isEmpty()) {
|
---|
[6286] | 670 | frqType1 = qcFrq._rnxType2ch;
|
---|
[6284] | 671 | }
|
---|
[6287] | 672 | if (qcFrq._rnxType2ch[0] == '2' && frqType2.isEmpty()) {
|
---|
[6286] | 673 | frqType2 = qcFrq._rnxType2ch;
|
---|
[6284] | 674 | }
|
---|
[6286] | 675 | if (qcFrq._rnxType2ch == frqType1) {
|
---|
| 676 | if (qcFrq._slip) {
|
---|
| 677 | data._L1slip << mjdX24;
|
---|
| 678 | }
|
---|
| 679 | else if (qcFrq._gap) {
|
---|
| 680 | data._L1gap << mjdX24;
|
---|
| 681 | }
|
---|
| 682 | else {
|
---|
| 683 | data._L1ok << mjdX24;
|
---|
| 684 | }
|
---|
[6284] | 685 | }
|
---|
[6286] | 686 | else if (qcFrq._rnxType2ch == frqType2) {
|
---|
| 687 | if (qcFrq._slip) {
|
---|
| 688 | data._L2slip << mjdX24;
|
---|
| 689 | }
|
---|
| 690 | else if (qcFrq._gap) {
|
---|
| 691 | data._L2gap << mjdX24;
|
---|
| 692 | }
|
---|
| 693 | else {
|
---|
| 694 | data._L2ok << mjdX24;
|
---|
| 695 | }
|
---|
[6284] | 696 | }
|
---|
| 697 | }
|
---|
[6278] | 698 | }
|
---|
| 699 | }
|
---|
| 700 |
|
---|
[6271] | 701 | if (BNC_CORE->GUIenabled()) {
|
---|
[6278] | 702 | t_availPlot* plotA = new t_availPlot(0, plotDataMap);
|
---|
[6271] | 703 | plotA->setTitle(title);
|
---|
[4679] | 704 |
|
---|
[6278] | 705 | t_elePlot* plotZ = new t_elePlot(0, plotDataMap);
|
---|
[4679] | 706 |
|
---|
[6279] | 707 | t_dopPlot* plotD = new t_dopPlot(0, plotData);
|
---|
[4679] | 708 |
|
---|
[6271] | 709 | QVector<QWidget*> plots;
|
---|
| 710 | plots << plotA << plotZ << plotD;
|
---|
| 711 | t_graphWin* graphWin = new t_graphWin(0, fileName, plots, 0, 0);
|
---|
[4679] | 712 |
|
---|
[6271] | 713 | int ww = QFontMetrics(graphWin->font()).width('w');
|
---|
| 714 | graphWin->setMinimumSize(120*ww, 40*ww);
|
---|
[4679] | 715 |
|
---|
[6271] | 716 | graphWin->show();
|
---|
[4679] | 717 |
|
---|
[6271] | 718 | bncSettings settings;
|
---|
| 719 | QString dirName = settings.value("reqcPlotDir").toString();
|
---|
| 720 | if (!dirName.isEmpty()) {
|
---|
| 721 | QByteArray ext = "_A.png";
|
---|
| 722 | graphWin->savePNG(dirName, ext);
|
---|
[4679] | 723 | }
|
---|
[4681] | 724 | }
|
---|
[4679] | 725 | }
|
---|
[4689] | 726 |
|
---|
| 727 | // Finish the report
|
---|
| 728 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6284] | 729 | void t_reqcAnalyze::printReport(const t_rnxObsFile* obsFile) {
|
---|
[5368] | 730 |
|
---|
[6301] | 731 | static const double QC_FORMAT_VERSION = 1.0;
|
---|
| 732 |
|
---|
[4689] | 733 | if (!_log) {
|
---|
| 734 | return;
|
---|
| 735 | }
|
---|
| 736 |
|
---|
[6300] | 737 | // Summary
|
---|
| 738 | // -------
|
---|
[6309] | 739 | *_log << "QC Format Version : " << QString("%1").arg(QC_FORMAT_VERSION,3,'f',1) << endl << endl
|
---|
[6301] | 740 | << "Observation File : " << obsFile->fileName().toAscii().data() << endl
|
---|
| 741 | << "Navigation File(s): " << _navFileNames.join(", ") << endl
|
---|
| 742 | << "RINEX Version : " << QString("%1").arg(obsFile->version(),4,'f',2) << endl
|
---|
| 743 | << "Marker name : " << _qcFile._markerName << endl
|
---|
[6302] | 744 | << "Marker number : " << obsFile->markerNumber() << endl
|
---|
[6301] | 745 | << "Receiver : " << _qcFile._receiverType << endl
|
---|
| 746 | << "Antenna : " << _qcFile._antennaName << endl
|
---|
[6303] | 747 | << "Approx pos XYZ : " << QString("%1 %2 %3").arg(obsFile->xyz()(1), 14, 'f', 4)
|
---|
| 748 | .arg(obsFile->xyz()(2), 14, 'f', 4)
|
---|
| 749 | .arg(obsFile->xyz()(3), 14, 'f', 4) << endl
|
---|
| 750 | << "Antenna dH/dE/dN : " << QString("%1 %2 %3").arg(obsFile->antNEU()(3), 8, 'f', 4)
|
---|
| 751 | .arg(obsFile->antNEU()(2), 8, 'f', 4)
|
---|
| 752 | .arg(obsFile->antNEU()(1), 8, 'f', 4) << endl
|
---|
[6301] | 753 | << "Start time : " << _qcFile._startTime.datestr().c_str() << ' '
|
---|
[6304] | 754 | << _qcFile._startTime.timestr(1,'.').c_str() << endl
|
---|
[6301] | 755 | << "End time : " << _qcFile._endTime.datestr().c_str() << ' '
|
---|
[6304] | 756 | << _qcFile._endTime.timestr(1,'.').c_str() << endl
|
---|
[6303] | 757 | << "Interval : " << _qcFile._interval << endl;
|
---|
[4689] | 758 |
|
---|
[6303] | 759 | // Number of systems
|
---|
| 760 | // -----------------
|
---|
| 761 | QMap<QChar, QVector<const t_qcSatSum*> > systemMap;
|
---|
[6286] | 762 | QMapIterator<t_prn, t_qcSatSum> itSat(_qcFile._qcSatSum);
|
---|
| 763 | while (itSat.hasNext()) {
|
---|
| 764 | itSat.next();
|
---|
[6303] | 765 | const t_prn& prn = itSat.key();
|
---|
[6286] | 766 | const t_qcSatSum& qcSatSum = itSat.value();
|
---|
[6303] | 767 | systemMap[prn.system()].push_back(&qcSatSum);
|
---|
| 768 | }
|
---|
[6286] | 769 |
|
---|
[6309] | 770 | *_log << "Navigation Systems: " << systemMap.size() << " ";
|
---|
[6303] | 771 | QMapIterator<QChar, QVector<const t_qcSatSum*> > itSys(systemMap);
|
---|
| 772 | while (itSys.hasNext()) {
|
---|
| 773 | itSys.next();
|
---|
| 774 | *_log << ' ' << itSys.key();
|
---|
[4693] | 775 | }
|
---|
[6303] | 776 | *_log << endl;
|
---|
[4693] | 777 |
|
---|
[6304] | 778 | itSys.toFront();
|
---|
| 779 | while (itSys.hasNext()) {
|
---|
| 780 | itSys.next();
|
---|
| 781 | const QChar& sys = itSys.key();
|
---|
| 782 | const QVector<const t_qcSatSum*>& qcSatVec = itSys.value();
|
---|
| 783 | QString prefixSys = QString(" ") + sys + QString(": ");
|
---|
[6306] | 784 | QMap<QString, QVector<const t_qcFrqSum*> > frqMap;
|
---|
[6305] | 785 | for (int ii = 0; ii < qcSatVec.size(); ii++) {
|
---|
| 786 | const t_qcSatSum* qcSatSum = qcSatVec[ii];
|
---|
| 787 | QMapIterator<QString, t_qcFrqSum> itFrq(qcSatSum->_qcFrqSum);
|
---|
| 788 | while (itFrq.hasNext()) {
|
---|
| 789 | itFrq.next();
|
---|
[6309] | 790 | QString frqType = itFrq.key(); if (frqType.length() < 2) frqType += ' ';
|
---|
[6305] | 791 | const t_qcFrqSum& qcFrqSum = itFrq.value();
|
---|
[6306] | 792 | frqMap[frqType].push_back(&qcFrqSum);
|
---|
[6305] | 793 | }
|
---|
| 794 | }
|
---|
[6309] | 795 | *_log << endl
|
---|
| 796 | << prefixSys << "Satellites : " << qcSatVec.size() << endl
|
---|
| 797 | << prefixSys << "Tracking Modes: " << frqMap.size() << " ";
|
---|
[6307] | 798 | QMapIterator<QString, QVector<const t_qcFrqSum*> > itFrq(frqMap);
|
---|
| 799 | while (itFrq.hasNext()) {
|
---|
| 800 | itFrq.next();
|
---|
[6309] | 801 | QString frqType = itFrq.key(); if (frqType.length() < 2) frqType += ' ';
|
---|
[6308] | 802 | *_log << ' ' << frqType;
|
---|
| 803 | }
|
---|
| 804 | *_log << endl;
|
---|
| 805 | itFrq.toFront();
|
---|
| 806 | while (itFrq.hasNext()) {
|
---|
| 807 | itFrq.next();
|
---|
[6309] | 808 | QString frqType = itFrq.key(); if (frqType.length() < 2) frqType += ' ';
|
---|
[6307] | 809 | const QVector<const t_qcFrqSum*> qcFrqVec = itFrq.value();
|
---|
| 810 | QString prefixFrq = QString(" ") + frqType + QString(": ");
|
---|
[6308] | 811 |
|
---|
| 812 | int numObs = 0;
|
---|
| 813 | int numSlipsFlagged = 0;
|
---|
| 814 | int numSlipsFound = 0;
|
---|
| 815 | int numGaps = 0;
|
---|
| 816 | for (int ii = 0; ii < qcFrqVec.size(); ii++) {
|
---|
| 817 | const t_qcFrqSum* qcFrqSum = qcFrqVec[ii];
|
---|
| 818 | numObs += qcFrqSum->_numObs ;
|
---|
| 819 | numSlipsFlagged += qcFrqSum->_numSlipsFlagged;
|
---|
| 820 | numSlipsFound += qcFrqSum->_numSlipsFound ;
|
---|
| 821 | numGaps += qcFrqSum->_numGaps ;
|
---|
| 822 | }
|
---|
[6309] | 823 | *_log << endl
|
---|
| 824 | << prefixSys << prefixFrq << "Observations : " << numObs << endl
|
---|
[6308] | 825 | << prefixSys << prefixFrq << "Slips (file+found) : " << numSlipsFlagged << " + " << numSlipsFound << endl
|
---|
| 826 | << prefixSys << prefixFrq << "Gaps : " << numGaps << endl;
|
---|
[6307] | 827 | }
|
---|
[6304] | 828 | }
|
---|
| 829 |
|
---|
[6300] | 830 | // Epoch-Specific Output
|
---|
| 831 | // ---------------------
|
---|
| 832 | bncSettings settings;
|
---|
| 833 | if (Qt::CheckState(settings.value("reqcLogSummaryOnly").toInt()) == Qt::Checked) {
|
---|
| 834 | return;
|
---|
| 835 | }
|
---|
[6309] | 836 | *_log << endl;
|
---|
[6289] | 837 | for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) {
|
---|
| 838 | const t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo];
|
---|
| 839 |
|
---|
| 840 | unsigned year, month, day, hour, min;
|
---|
| 841 | double sec;
|
---|
| 842 | qcEpo._epoTime.civil_date(year, month, day);
|
---|
| 843 | qcEpo._epoTime.civil_time(hour, min, sec);
|
---|
| 844 |
|
---|
| 845 | QString dateStr;
|
---|
| 846 | QTextStream(&dateStr) << QString("> %1 %2 %3 %4 %5%6")
|
---|
| 847 | .arg(year, 4)
|
---|
| 848 | .arg(month, 2, 10, QChar('0'))
|
---|
| 849 | .arg(day, 2, 10, QChar('0'))
|
---|
| 850 | .arg(hour, 2, 10, QChar('0'))
|
---|
| 851 | .arg(min, 2, 10, QChar('0'))
|
---|
| 852 | .arg(sec, 11, 'f', 7);
|
---|
| 853 |
|
---|
[6290] | 854 | *_log << dateStr << QString(" %1").arg(qcEpo._qcSat.size(), 2)
|
---|
| 855 | << QString(" %1").arg(qcEpo._PDOP, 4, 'f', 1)
|
---|
| 856 | << endl;
|
---|
[6289] | 857 |
|
---|
| 858 | QMapIterator<t_prn, t_qcSat> itSat(qcEpo._qcSat);
|
---|
| 859 | while (itSat.hasNext()) {
|
---|
| 860 | itSat.next();
|
---|
| 861 | const t_prn& prn = itSat.key();
|
---|
| 862 | const t_qcSat& qcSat = itSat.value();
|
---|
| 863 |
|
---|
[6290] | 864 | *_log << prn.toString().c_str()
|
---|
[6295] | 865 | << QString(" %1 %2").arg(qcSat._eleDeg, 6, 'f', 2).arg(qcSat._azDeg, 7, 'f', 2);
|
---|
| 866 |
|
---|
| 867 | int numObsTypes = 0;
|
---|
[6290] | 868 | for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) {
|
---|
| 869 | const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq];
|
---|
[6294] | 870 | if (qcFrq._phaseValid) {
|
---|
[6295] | 871 | numObsTypes += 1;
|
---|
[6294] | 872 | }
|
---|
| 873 | if (qcFrq._codeValid) {
|
---|
[6295] | 874 | numObsTypes += 1;
|
---|
[6294] | 875 | }
|
---|
[6295] | 876 | }
|
---|
[6298] | 877 | *_log << QString(" %1").arg(numObsTypes, 2);
|
---|
[6295] | 878 |
|
---|
| 879 | for (int iFrq = 0; iFrq < qcSat._qcFrq.size(); iFrq++) {
|
---|
| 880 | const t_qcFrq& qcFrq = qcSat._qcFrq[iFrq];
|
---|
| 881 | if (qcFrq._phaseValid) {
|
---|
| 882 | *_log << " L" << qcFrq._rnxType2ch << ' ';
|
---|
| 883 | if (qcFrq._slip) {
|
---|
| 884 | *_log << 's';
|
---|
| 885 | }
|
---|
| 886 | else {
|
---|
| 887 | *_log << '.';
|
---|
| 888 | }
|
---|
| 889 | if (qcFrq._gap) {
|
---|
| 890 | *_log << 'g';
|
---|
| 891 | }
|
---|
| 892 | else {
|
---|
| 893 | *_log << '.';
|
---|
| 894 | }
|
---|
| 895 | *_log << QString(" %1").arg(qcFrq._SNR, 4, 'f', 1);
|
---|
[6294] | 896 | }
|
---|
[6295] | 897 | if (qcFrq._codeValid) {
|
---|
| 898 | *_log << " C" << qcFrq._rnxType2ch << ' ';
|
---|
| 899 | if (qcFrq._gap) {
|
---|
[6298] | 900 | *_log << " g";
|
---|
[6295] | 901 | }
|
---|
| 902 | else {
|
---|
[6298] | 903 | *_log << " .";
|
---|
[6295] | 904 | }
|
---|
| 905 | *_log << QString(" %1").arg(qcFrq._stdMP, 3, 'f', 2);
|
---|
[6290] | 906 | }
|
---|
| 907 | }
|
---|
| 908 | *_log << endl;
|
---|
[6289] | 909 | }
|
---|
| 910 | }
|
---|
[4689] | 911 | _log->flush();
|
---|
| 912 | }
|
---|