source: ntrip/trunk/BNC/bncmodel.cpp@ 3308

Last change on this file since 3308 was 3308, checked in by mervart, 13 years ago
File size: 39.6 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: bncParam, bncModel
30 *
31 * Purpose: Model for PPP
32 *
33 * Author: L. Mervart
34 *
35 * Created: 01-Dec-2009
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <iomanip>
42#include <cmath>
43#include <newmatio.h>
44#include <sstream>
45
46#include "bncmodel.h"
47#include "bncapp.h"
48#include "bncpppclient.h"
49#include "bancroft.h"
50#include "bncutils.h"
51#include "bncsettings.h"
52#include "bnctides.h"
53#include "bncantex.h"
54
55using namespace std;
56
57const unsigned MINOBS = 4;
58const double MINELE_GPS = 10.0 * M_PI / 180.0;
59const double MINELE_GLO = 10.0 * M_PI / 180.0;
60const double MINELE_GAL = 10.0 * M_PI / 180.0;
61const double MAXRES_CODE_GPS = 10.0;
62const double MAXRES_PHASE_GPS = 0.10;
63const double MAXRES_PHASE_GLO = 0.05;
64const double MAXRES_CODE_GAL = 10.0;
65const double MAXRES_PHASE_GAL = 0.10;
66
67// Constructor
68////////////////////////////////////////////////////////////////////////////
69bncParam::bncParam(bncParam::parType typeIn, int indexIn,
70 const QString& prnIn) {
71 type = typeIn;
72 index = indexIn;
73 prn = prnIn;
74 index_old = 0;
75 xx = 0.0;
76
77}
78
79// Destructor
80////////////////////////////////////////////////////////////////////////////
81bncParam::~bncParam() {
82}
83
84// Partial
85////////////////////////////////////////////////////////////////////////////
86double bncParam::partial(t_satData* satData, bool phase) {
87
88 // Coordinates
89 // -----------
90 if (type == CRD_X) {
91 return (xx - satData->xx(1)) / satData->rho;
92 }
93 else if (type == CRD_Y) {
94 return (xx - satData->xx(2)) / satData->rho;
95 }
96 else if (type == CRD_Z) {
97 return (xx - satData->xx(3)) / satData->rho;
98 }
99
100 // Receiver Clocks
101 // ---------------
102 else if (type == RECCLK) {
103 return 1.0;
104 }
105
106 // Troposphere
107 // -----------
108 else if (type == TROPO) {
109 return 1.0 / sin(satData->eleSat);
110 }
111
112 // Galileo Offset
113 // --------------
114 else if (type == GALILEO_OFFSET) {
115 if (satData->prn[0] == 'E') {
116 return 1.0;
117 }
118 else {
119 return 0.0;
120 }
121 }
122
123 // Ambiguities
124 // -----------
125 else if (type == AMB_L3) {
126 if (phase && satData->prn == prn) {
127 return 1.0;
128 }
129 else {
130 return 0.0;
131 }
132 }
133
134 // Default return
135 // --------------
136 return 0.0;
137}
138
139// Constructor
140////////////////////////////////////////////////////////////////////////////
141bncModel::bncModel(QByteArray staID) {
142
143 _staID = staID;
144
145 connect(this, SIGNAL(newMessage(QByteArray,bool)),
146 ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
147
148 bncSettings settings;
149
150 // Observation Sigmas
151 // ------------------
152 _sigP3 = 5.0;
153 if (!settings.value("pppSigmaCode").toString().isEmpty()) {
154 _sigP3 = settings.value("pppSigmaCode").toDouble();
155 }
156 _sigL3 = 0.02;
157 if (!settings.value("pppSigmaPhase").toString().isEmpty()) {
158 _sigL3 = settings.value("pppSigmaPhase").toDouble();
159 }
160
161 // Parameter Sigmas
162 // ----------------
163 _sigCrd0 = 100.0;
164 if (!settings.value("pppSigCrd0").toString().isEmpty()) {
165 _sigCrd0 = settings.value("pppSigCrd0").toDouble();
166 }
167 _sigCrdP = 100.0;
168 if (!settings.value("pppSigCrdP").toString().isEmpty()) {
169 _sigCrdP = settings.value("pppSigCrdP").toDouble();
170 }
171 _sigTrp0 = 0.1;
172 if (!settings.value("pppSigTrp0").toString().isEmpty()) {
173 _sigTrp0 = settings.value("pppSigTrp0").toDouble();
174 }
175 _sigTrpP = 1e-6;
176 if (!settings.value("pppSigTrpP").toString().isEmpty()) {
177 _sigTrpP = settings.value("pppSigTrpP").toDouble();
178 }
179 _sigClk0 = 1000.0;
180 _sigAmb0 = 1000.0;
181 _sigGalileoOffset0 = 1000.0;
182 _sigGalileoOffsetP = 0.0;
183
184 // Quick-Start Mode
185 // ----------------
186 _quickStart = 0;
187 if (settings.value("pppRefCrdX").toString() != "" &&
188 settings.value("pppRefCrdY").toString() != "" &&
189 settings.value("pppRefCrdZ").toString() != "" &&
190 !settings.value("pppQuickStart").toString().isEmpty()) {
191 _quickStart = settings.value("pppQuickStart").toDouble();
192 }
193
194 // Several options
195 // ---------------
196 _usePhase = false;
197 if ( Qt::CheckState(settings.value("pppUsePhase").toInt()) == Qt::Checked) {
198 _usePhase = true;
199 }
200
201 _estTropo = false;
202 if ( Qt::CheckState(settings.value("pppEstTropo").toInt()) == Qt::Checked) {
203 _estTropo = true;
204 }
205
206 _useGalileo = false;
207 if ( Qt::CheckState(settings.value("pppGalileo").toInt()) == Qt::Checked) {
208 _useGalileo = true;
209 }
210
211 // NMEA Output
212 // -----------
213 QString nmeaFileName = settings.value("nmeaFile").toString();
214 if (nmeaFileName.isEmpty()) {
215 _nmeaFile = 0;
216 _nmeaStream = 0;
217 }
218 else {
219 expandEnvVar(nmeaFileName);
220 _nmeaFile = new QFile(nmeaFileName);
221 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
222 _nmeaFile->open(QIODevice::WriteOnly | QIODevice::Append);
223 }
224 else {
225 _nmeaFile->open(QIODevice::WriteOnly);
226 }
227 _nmeaStream = new QTextStream();
228 _nmeaStream->setDevice(_nmeaFile);
229 }
230
231 // Antenna Name, ANTEX File
232 // ------------------------
233 _antex = 0;
234 QString antexFileName = settings.value("pppAntex").toString();
235 if (!antexFileName.isEmpty()) {
236 _antex = new bncAntex();
237 if (_antex->readFile(antexFileName) != success) {
238 emit newMessage("wrong ANTEX file", true);
239 delete _antex;
240 _antex = 0;
241 }
242 else {
243 _antennaName = settings.value("pppAntenna").toString();
244 }
245 }
246
247 // Antenna Eccentricities
248 // ----------------------
249 _dN = settings.value("pppRefdN").toDouble();
250 _dE = settings.value("pppRefdE").toDouble();
251 _dU = settings.value("pppRefdU").toDouble();
252
253 // Bancroft Coordinates
254 // --------------------
255 _xcBanc.ReSize(4); _xcBanc = 0.0;
256 _ellBanc.ReSize(3); _ellBanc = 0.0;
257}
258
259// Destructor
260////////////////////////////////////////////////////////////////////////////
261bncModel::~bncModel() {
262 delete _nmeaStream;
263 delete _nmeaFile;
264 for (int ii = 0; ii < _posAverage.size(); ++ii) {
265 delete _posAverage[ii];
266 }
267 delete _antex;
268 for (int iPar = 1; iPar <= _params.size(); iPar++) {
269 delete _params[iPar-1];
270 }
271}
272
273// Reset Parameters and Variance-Covariance Matrix
274////////////////////////////////////////////////////////////////////////////
275void bncModel::reset() {
276
277 for (int iPar = 1; iPar <= _params.size(); iPar++) {
278 delete _params[iPar-1];
279 }
280 _params.clear();
281
282 int nextPar = 0;
283 _params.push_back(new bncParam(bncParam::CRD_X, ++nextPar, ""));
284 _params.push_back(new bncParam(bncParam::CRD_Y, ++nextPar, ""));
285 _params.push_back(new bncParam(bncParam::CRD_Z, ++nextPar, ""));
286 _params.push_back(new bncParam(bncParam::RECCLK, ++nextPar, ""));
287 if (_estTropo) {
288 _params.push_back(new bncParam(bncParam::TROPO, ++nextPar, ""));
289 }
290 if (_useGalileo) {
291 _params.push_back(new bncParam(bncParam::GALILEO_OFFSET, ++nextPar, ""));
292 }
293
294 _QQ.ReSize(_params.size());
295 _QQ = 0.0;
296 for (int iPar = 1; iPar <= _params.size(); iPar++) {
297 bncParam* pp = _params[iPar-1];
298 pp->xx = 0.0;
299 if (pp->isCrd()) {
300 _QQ(iPar,iPar) = _sigCrd0 * _sigCrd0;
301 }
302 else if (pp->type == bncParam::RECCLK) {
303 _QQ(iPar,iPar) = _sigClk0 * _sigClk0;
304 }
305 else if (pp->type == bncParam::TROPO) {
306 _QQ(iPar,iPar) = _sigTrp0 * _sigTrp0;
307 }
308 else if (pp->type == bncParam::GALILEO_OFFSET) {
309 _QQ(iPar,iPar) = _sigGalileoOffset0 * _sigGalileoOffset0;
310 }
311 }
312}
313
314// Bancroft Solution
315////////////////////////////////////////////////////////////////////////////
316t_irc bncModel::cmpBancroft(t_epoData* epoData) {
317
318 if (epoData->sizeGPS() < MINOBS) {
319 _log += "bncModel::cmpBancroft: not enough data\n";
320 return failure;
321 }
322
323 Matrix BB(epoData->sizeGPS(), 4);
324
325 QMapIterator<QString, t_satData*> it(epoData->satDataGPS);
326 int iObsBanc = 0;
327 while (it.hasNext()) {
328 ++iObsBanc;
329 it.next();
330 QString prn = it.key();
331 t_satData* satData = it.value();
332 BB(iObsBanc, 1) = satData->xx(1);
333 BB(iObsBanc, 2) = satData->xx(2);
334 BB(iObsBanc, 3) = satData->xx(3);
335 BB(iObsBanc, 4) = satData->P3 + satData->clk;
336 }
337
338 bancroft(BB, _xcBanc);
339
340 // Ellipsoidal Coordinates
341 // ------------------------
342 xyz2ell(_xcBanc.data(), _ellBanc.data());
343
344 // Compute Satellite Elevations
345 // ----------------------------
346 QMutableMapIterator<QString, t_satData*> iGPS(epoData->satDataGPS);
347 while (iGPS.hasNext()) {
348 iGPS.next();
349 t_satData* satData = iGPS.value();
350 cmpEle(satData);
351 if (satData->eleSat < MINELE_GPS) {
352 delete satData;
353 iGPS.remove();
354 }
355 }
356
357 QMutableMapIterator<QString, t_satData*> iGlo(epoData->satDataGlo);
358 while (iGlo.hasNext()) {
359 iGlo.next();
360 t_satData* satData = iGlo.value();
361 cmpEle(satData);
362 if (satData->eleSat < MINELE_GLO) {
363 delete satData;
364 iGlo.remove();
365 }
366 }
367
368 QMutableMapIterator<QString, t_satData*> iGal(epoData->satDataGal);
369 while (iGal.hasNext()) {
370 iGal.next();
371 t_satData* satData = iGal.value();
372 cmpEle(satData);
373 if (satData->eleSat < MINELE_GAL) {
374 delete satData;
375 iGal.remove();
376 }
377 }
378
379 return success;
380}
381
382// Computed Value
383////////////////////////////////////////////////////////////////////////////
384double bncModel::cmpValue(t_satData* satData, bool phase) {
385
386 ColumnVector xRec(3);
387 xRec(1) = x();
388 xRec(2) = y();
389 xRec(3) = z();
390
391 double rho0 = (satData->xx - xRec).norm_Frobenius();
392 double dPhi = t_CST::omega * rho0 / t_CST::c;
393
394 xRec(1) = x() * cos(dPhi) - y() * sin(dPhi);
395 xRec(2) = y() * cos(dPhi) + x() * sin(dPhi);
396 xRec(3) = z();
397
398 tides(_time, xRec);
399
400 satData->rho = (satData->xx - xRec).norm_Frobenius();
401
402 double tropDelay = delay_saast(satData->eleSat) +
403 trp() / sin(satData->eleSat);
404
405 double wind = 0.0;
406 if (phase) {
407 wind = windUp(satData->prn, satData->xx, xRec) * satData->lambda3;
408 }
409
410 double offset = 0.0;
411 if (satData->prn[0] == 'E') {
412 offset = Galileo_offset();
413 }
414
415 double phaseCenter = 0.0;
416 if (_antex) {
417 bool found;
418 phaseCenter = _antex->pco(_antennaName, satData->eleSat, found);
419 if (!found) {
420 emit newMessage("ANTEX: antenna >"
421 + _antennaName.toAscii() + "< not found", true);
422 }
423 }
424
425 double antennaOffset = 0.0;
426 if (_dN != 0.0 || _dE != 0.0 || _dU != 0.0) {
427 double cosa = cos(satData->azSat);
428 double sina = sin(satData->azSat);
429 double cose = cos(satData->eleSat);
430 double sine = sin(satData->eleSat);
431 antennaOffset = -_dN * cosa*cose - _dE * sina*cose - _dU * sine;
432 }
433
434 return satData->rho + phaseCenter + antennaOffset + clk()
435 + offset - satData->clk + tropDelay + wind;
436}
437
438// Tropospheric Model (Saastamoinen)
439////////////////////////////////////////////////////////////////////////////
440double bncModel::delay_saast(double Ele) {
441
442 double xyz[3];
443 xyz[0] = x();
444 xyz[1] = y();
445 xyz[2] = z();
446 double ell[3];
447 xyz2ell(xyz, ell);
448 double height = ell[2];
449
450 double pp = 1013.25 * pow(1.0 - 2.26e-5 * height, 5.225);
451 double TT = 18.0 - height * 0.0065 + 273.15;
452 double hh = 50.0 * exp(-6.396e-4 * height);
453 double ee = hh / 100.0 * exp(-37.2465 + 0.213166*TT - 0.000256908*TT*TT);
454
455 double h_km = height / 1000.0;
456
457 if (h_km < 0.0) h_km = 0.0;
458 if (h_km > 5.0) h_km = 5.0;
459 int ii = int(h_km + 1);
460 double href = ii - 1;
461
462 double bCor[6];
463 bCor[0] = 1.156;
464 bCor[1] = 1.006;
465 bCor[2] = 0.874;
466 bCor[3] = 0.757;
467 bCor[4] = 0.654;
468 bCor[5] = 0.563;
469
470 double BB = bCor[ii-1] + (bCor[ii]-bCor[ii-1]) * (h_km - href);
471
472 double zen = M_PI/2.0 - Ele;
473
474 return (0.002277/cos(zen)) * (pp + ((1255.0/TT)+0.05)*ee - BB*(tan(zen)*tan(zen)));
475}
476
477// Prediction Step of the Filter
478////////////////////////////////////////////////////////////////////////////
479void bncModel::predict(t_epoData* epoData) {
480
481 bncSettings settings;
482
483 _time = epoData->tt; // current epoch time
484
485 _maxSolGap = settings.value("pppMaxSolGap").toDouble();
486
487 bool firstCrd = false;
488 if (!_lastTimeOK.valid() || (_maxSolGap > 0 && _time - _lastTimeOK > _maxSolGap)) {
489 firstCrd = true;
490 _startTime = epoData->tt;
491 reset();
492 }
493
494 // Use different white noise for Quick-Start mode
495 // ----------------------------------------------
496 double sigCrdP_used = _sigCrdP;
497 if ( _quickStart > 0.0 && _quickStart > (epoData->tt - _startTime) ) {
498 sigCrdP_used = 0.0;
499 }
500
501 // Predict Parameter values, add white noise
502 // -----------------------------------------
503 for (int iPar = 1; iPar <= _params.size(); iPar++) {
504 bncParam* pp = _params[iPar-1];
505
506 // Coordinates
507 // -----------
508 if (pp->type == bncParam::CRD_X) {
509 if (firstCrd) {
510 if (settings.value("pppRefCrdX").toString() != "" &&
511 settings.value("pppRefCrdY").toString() != "" &&
512 settings.value("pppRefCrdZ").toString() != "") {
513 pp->xx = settings.value("pppRefCrdX").toDouble();
514 }
515 else {
516 pp->xx = _xcBanc(1);
517 }
518 }
519 _QQ(iPar,iPar) += sigCrdP_used * sigCrdP_used;
520 }
521 else if (pp->type == bncParam::CRD_Y) {
522 if (firstCrd) {
523 if (settings.value("pppRefCrdX").toString() != "" &&
524 settings.value("pppRefCrdY").toString() != "" &&
525 settings.value("pppRefCrdZ").toString() != "") {
526 pp->xx = settings.value("pppRefCrdY").toDouble();
527 }
528 else {
529 pp->xx = _xcBanc(2);
530 }
531 }
532 _QQ(iPar,iPar) += sigCrdP_used * sigCrdP_used;
533 }
534 else if (pp->type == bncParam::CRD_Z) {
535 if (firstCrd) {
536 if (settings.value("pppRefCrdX").toString() != "" &&
537 settings.value("pppRefCrdY").toString() != "" &&
538 settings.value("pppRefCrdZ").toString() != "") {
539 pp->xx = settings.value("pppRefCrdZ").toDouble();
540 }
541 else {
542 pp->xx = _xcBanc(3);
543 }
544 }
545 _QQ(iPar,iPar) += sigCrdP_used * sigCrdP_used;
546 }
547
548 // Receiver Clocks
549 // ---------------
550 else if (pp->type == bncParam::RECCLK) {
551 pp->xx = _xcBanc(4);
552 for (int jj = 1; jj <= _params.size(); jj++) {
553 _QQ(iPar, jj) = 0.0;
554 }
555 _QQ(iPar,iPar) = _sigClk0 * _sigClk0;
556 }
557
558 // Tropospheric Delay
559 // ------------------
560 else if (pp->type == bncParam::TROPO) {
561 _QQ(iPar,iPar) += _sigTrpP * _sigTrpP;
562 }
563
564 // Galileo Offset
565 // --------------
566 else if (pp->type == bncParam::GALILEO_OFFSET) {
567 _QQ(iPar,iPar) += _sigGalileoOffsetP * _sigGalileoOffsetP;
568 }
569 }
570
571 // Add New Ambiguities if necessary
572 // --------------------------------
573 if (_usePhase) {
574
575 // Make a copy of QQ and xx, set parameter indices
576 // -----------------------------------------------
577 SymmetricMatrix QQ_old = _QQ;
578
579 for (int iPar = 1; iPar <= _params.size(); iPar++) {
580 _params[iPar-1]->index_old = _params[iPar-1]->index;
581 _params[iPar-1]->index = 0;
582 }
583
584 // Remove Ambiguity Parameters without observations
585 // ------------------------------------------------
586 int iPar = 0;
587 QMutableVectorIterator<bncParam*> it(_params);
588 while (it.hasNext()) {
589 bncParam* par = it.next();
590 bool removed = false;
591 if (par->type == bncParam::AMB_L3) {
592 if (epoData->satDataGPS.find(par->prn) == epoData->satDataGPS.end() &&
593 epoData->satDataGlo.find(par->prn) == epoData->satDataGlo.end() &&
594 epoData->satDataGal.find(par->prn) == epoData->satDataGal.end() ) {
595 removed = true;
596 delete par;
597 it.remove();
598 }
599 }
600 if (! removed) {
601 ++iPar;
602 par->index = iPar;
603 }
604 }
605
606 // Add new ambiguity parameters
607 // ----------------------------
608 QMapIterator<QString, t_satData*> iGPS(epoData->satDataGPS);
609 while (iGPS.hasNext()) {
610 iGPS.next();
611 t_satData* satData = iGPS.value();
612 addAmb(satData);
613 }
614
615 QMapIterator<QString, t_satData*> iGlo(epoData->satDataGlo);
616 while (iGlo.hasNext()) {
617 iGlo.next();
618 t_satData* satData = iGlo.value();
619 addAmb(satData);
620 }
621
622 QMapIterator<QString, t_satData*> iGal(epoData->satDataGal);
623 while (iGal.hasNext()) {
624 iGal.next();
625 t_satData* satData = iGal.value();
626 addAmb(satData);
627 }
628
629 int nPar = _params.size();
630 _QQ.ReSize(nPar); _QQ = 0.0;
631 for (int i1 = 1; i1 <= nPar; i1++) {
632 bncParam* p1 = _params[i1-1];
633 if (p1->index_old != 0) {
634 _QQ(p1->index, p1->index) = QQ_old(p1->index_old, p1->index_old);
635 for (int i2 = 1; i2 <= nPar; i2++) {
636 bncParam* p2 = _params[i2-1];
637 if (p2->index_old != 0) {
638 _QQ(p1->index, p2->index) = QQ_old(p1->index_old, p2->index_old);
639 }
640 }
641 }
642 }
643
644 for (int ii = 1; ii <= nPar; ii++) {
645 bncParam* par = _params[ii-1];
646 if (par->index_old == 0) {
647 _QQ(par->index, par->index) = _sigAmb0 * _sigAmb0;
648 }
649 par->index_old = par->index;
650 }
651 }
652}
653
654// Update Step of the Filter (currently just a single-epoch solution)
655////////////////////////////////////////////////////////////////////////////
656t_irc bncModel::update(t_epoData* epoData) {
657
658 bncSettings settings;
659
660 _log.clear();
661
662 if (settings.value("pppSPP").toString() == "PPP") {
663 _log += "Precise Point Positioning of Epoch "
664 + QByteArray(_time.timestr(1).c_str()) +
665 "\n---------------------------------------------------------------\n";
666 }
667 else {
668 _log += "Single Point Positioning of Epoch "
669 + QByteArray(_time.timestr(1).c_str()) +
670 "\n--------------------------------------------------------------\n";
671 }
672
673 // Outlier Detection Loop
674 // ----------------------
675 ColumnVector dx;
676 if (update_p(epoData, dx) != success) {
677 return failure;
678 }
679
680 // Remember the Epoch-specific Results for the computation of means
681 // ----------------------------------------------------------------
682 pppPos* newPos = new pppPos;
683 newPos->time = epoData->tt;
684
685 // Set Solution Vector
686 // -------------------
687 ostringstream strB;
688 strB.setf(ios::fixed);
689 QVectorIterator<bncParam*> itPar(_params);
690 while (itPar.hasNext()) {
691 bncParam* par = itPar.next();
692 par->xx += dx(par->index);
693
694 if (par->type == bncParam::RECCLK) {
695 strB << "\n clk = " << setw(10) << setprecision(3) << par->xx
696 << " +- " << setw(6) << setprecision(3)
697 << sqrt(_QQ(par->index,par->index));
698 }
699 else if (par->type == bncParam::AMB_L3) {
700 strB << "\n amb " << par->prn.toAscii().data() << " = "
701 << setw(10) << setprecision(3) << par->xx
702 << " +- " << setw(6) << setprecision(3)
703 << sqrt(_QQ(par->index,par->index));
704 }
705 else if (par->type == bncParam::TROPO) {
706 double aprTrp = delay_saast(M_PI/2.0);
707 strB << "\n trp = " << par->prn.toAscii().data()
708 << setw(7) << setprecision(3) << aprTrp << " "
709 << setw(6) << setprecision(3) << showpos << par->xx << noshowpos
710 << " +- " << setw(6) << setprecision(3)
711 << sqrt(_QQ(par->index,par->index));
712 newPos->xnt[6] = aprTrp + par->xx;
713 }
714 else if (par->type == bncParam::GALILEO_OFFSET) {
715 strB << "\n offset = " << setw(10) << setprecision(3) << par->xx
716 << " +- " << setw(6) << setprecision(3)
717 << sqrt(_QQ(par->index,par->index));
718 }
719 }
720 strB << '\n';
721 _log += strB.str().c_str();
722 emit newMessage(_log, false);
723
724 // Final Message (both log file and screen)
725 // ----------------------------------------
726 ostringstream strC;
727 strC.setf(ios::fixed);
728 strC << _staID.data() << " PPP "
729 << epoData->tt.timestr(1) << " " << epoData->sizeAll() << " "
730 << setw(14) << setprecision(3) << x() << " +- "
731 << setw(6) << setprecision(3) << sqrt(_QQ(1,1)) << " "
732 << setw(14) << setprecision(3) << y() << " +- "
733 << setw(6) << setprecision(3) << sqrt(_QQ(2,2)) << " "
734 << setw(14) << setprecision(3) << z() << " +- "
735 << setw(6) << setprecision(3) << sqrt(_QQ(3,3));
736
737 // NEU Output
738 // ----------
739 double xyzRef[3];
740
741 if (settings.value("pppRefCrdX").toString() != "" &&
742 settings.value("pppRefCrdY").toString() != "" &&
743 settings.value("pppRefCrdZ").toString() != "") {
744
745 xyzRef[0] = settings.value("pppRefCrdX").toDouble();
746 xyzRef[1] = settings.value("pppRefCrdY").toDouble();
747 xyzRef[2] = settings.value("pppRefCrdZ").toDouble();
748
749 newPos->xnt[0] = x() - xyzRef[0];
750 newPos->xnt[1] = y() - xyzRef[1];
751 newPos->xnt[2] = z() - xyzRef[2];
752
753 double ellRef[3];
754 xyz2ell(xyzRef, ellRef);
755 xyz2neu(ellRef, newPos->xnt, &newPos->xnt[3]);
756
757 strC << " NEU "
758 << setw(8) << setprecision(3) << newPos->xnt[3] << " "
759 << setw(8) << setprecision(3) << newPos->xnt[4] << " "
760 << setw(8) << setprecision(3) << newPos->xnt[5] << endl;
761
762 }
763
764 emit newMessage(QByteArray(strC.str().c_str()), true);
765
766 if (settings.value("pppAverage").toString() == "") {
767 delete newPos;
768 }
769 else {
770
771 _posAverage.push_back(newPos);
772
773 // Time Span for Average Computation
774 // ---------------------------------
775 double tRangeAverage = settings.value("pppAverage").toDouble() * 60.;
776 if (tRangeAverage < 0) {
777 tRangeAverage = 0;
778 }
779 if (tRangeAverage > 86400) {
780 tRangeAverage = 86400;
781 }
782
783 // Compute the Mean
784 // ----------------
785 ColumnVector mean(7); mean = 0.0;
786
787 QMutableVectorIterator<pppPos*> it(_posAverage);
788 while (it.hasNext()) {
789 pppPos* pp = it.next();
790 if ( (epoData->tt - pp->time) >= tRangeAverage ) {
791 delete pp;
792 it.remove();
793 }
794 else {
795 for (int ii = 0; ii < 7; ++ii) {
796 mean[ii] += pp->xnt[ii];
797 }
798 }
799 }
800
801 int nn = _posAverage.size();
802
803 if (nn > 0) {
804
805 mean /= nn;
806
807 // Compute the Deviation
808 // ---------------------
809 ColumnVector std(7); std = 0.0;
810 QVectorIterator<pppPos*> it2(_posAverage);
811 while (it2.hasNext()) {
812 pppPos* pp = it2.next();
813 for (int ii = 0; ii < 7; ++ii) {
814 std[ii] += (pp->xnt[ii] - mean[ii]) * (pp->xnt[ii] - mean[ii]);
815 }
816 }
817 for (int ii = 0; ii < 7; ++ii) {
818 std[ii] = sqrt(std[ii] / nn);
819 }
820
821 if (settings.value("pppRefCrdX").toString() != "" &&
822 settings.value("pppRefCrdY").toString() != "" &&
823 settings.value("pppRefCrdZ").toString() != "") {
824
825 ostringstream strD; strD.setf(ios::fixed);
826 strD << _staID.data() << " AVE-XYZ "
827 << epoData->tt.timestr(1) << " "
828 << setw(13) << setprecision(3) << mean[0] + xyzRef[0] << " +- "
829 << setw(6) << setprecision(3) << std[0] << " "
830 << setw(14) << setprecision(3) << mean[1] + xyzRef[1] << " +- "
831 << setw(6) << setprecision(3) << std[1] << " "
832 << setw(14) << setprecision(3) << mean[2] + xyzRef[2] << " +- "
833 << setw(6) << setprecision(3) << std[2];
834 emit newMessage(QByteArray(strD.str().c_str()), true);
835
836 ostringstream strE; strE.setf(ios::fixed);
837 strE << _staID.data() << " AVE-NEU "
838 << epoData->tt.timestr(1) << " "
839 << setw(13) << setprecision(3) << mean[3] << " +- "
840 << setw(6) << setprecision(3) << std[3] << " "
841 << setw(14) << setprecision(3) << mean[4] << " +- "
842 << setw(6) << setprecision(3) << std[4] << " "
843 << setw(14) << setprecision(3) << mean[5] << " +- "
844 << setw(6) << setprecision(3) << std[5];
845 emit newMessage(QByteArray(strE.str().c_str()), true);
846
847 if ( Qt::CheckState(settings.value("pppEstTropo").toInt()) == Qt::Checked) {
848 ostringstream strF; strF.setf(ios::fixed);
849 strF << _staID.data() << " AVE-TRP "
850 << epoData->tt.timestr(1) << " "
851 << setw(13) << setprecision(3) << mean[6] << " +- "
852 << setw(6) << setprecision(3) << std[6] << endl;
853 emit newMessage(QByteArray(strF.str().c_str()), true);
854 }
855 }
856 }
857 }
858
859 // NMEA Output
860 // -----------
861 double xyz[3];
862 xyz[0] = x();
863 xyz[1] = y();
864 xyz[2] = z();
865 double ell[3];
866 xyz2ell(xyz, ell);
867 double phiDeg = ell[0] * 180 / M_PI;
868 double lamDeg = ell[1] * 180 / M_PI;
869
870 char phiCh = 'N';
871 if (phiDeg < 0) {
872 phiDeg = -phiDeg;
873 phiCh = 'S';
874 }
875 char lamCh = 'E';
876 if (lamDeg < 0) {
877 lamDeg = -lamDeg;
878 lamCh = 'W';
879 }
880
881 string datestr = epoData->tt.datestr(0); // yyyymmdd
882 ostringstream strRMC;
883 strRMC.setf(ios::fixed);
884 strRMC << "GPRMC,"
885 << epoData->tt.timestr(0,0) << ",A,"
886 << setw(2) << setfill('0') << int(phiDeg)
887 << setw(6) << setprecision(3) << setfill('0')
888 << fmod(60*phiDeg,60) << ',' << phiCh << ','
889 << setw(3) << setfill('0') << int(lamDeg)
890 << setw(6) << setprecision(3) << setfill('0')
891 << fmod(60*lamDeg,60) << ',' << lamCh << ",,,"
892 << datestr[6] << datestr[7] << datestr[4] << datestr[5]
893 << datestr[2] << datestr[3] << ",,";
894
895 writeNMEAstr(QString(strRMC.str().c_str()));
896
897 double dop = 2.0; // TODO
898
899 ostringstream strGGA;
900 strGGA.setf(ios::fixed);
901 strGGA << "GPGGA,"
902 << epoData->tt.timestr(0,0) << ','
903 << setw(2) << setfill('0') << int(phiDeg)
904 << setw(10) << setprecision(7) << setfill('0')
905 << fmod(60*phiDeg,60) << ',' << phiCh << ','
906 << setw(3) << setfill('0') << int(lamDeg)
907 << setw(10) << setprecision(7) << setfill('0')
908 << fmod(60*lamDeg,60) << ',' << lamCh
909 << ",1," << setw(2) << setfill('0') << epoData->sizeAll() << ','
910 << setw(3) << setprecision(1) << dop << ','
911 << setprecision(3) << ell[2] << ",M,0.0,M,,";
912
913 writeNMEAstr(QString(strGGA.str().c_str()));
914
915 _lastTimeOK = _time; // remember time of last successful update
916 return success;
917}
918
919// Outlier Detection
920////////////////////////////////////////////////////////////////////////////
921int bncModel::outlierDetection(int phase, const SymmetricMatrix& QQsav,
922 const ColumnVector& vv,
923 QMap<QString, t_satData*>& satDataGPS,
924 QMap<QString, t_satData*>& satDataGlo,
925 QMap<QString, t_satData*>& satDataGal) {
926
927 QString prnCode;
928 QString prnPhase;
929 double maxResCode = 0.0;
930 double maxResPhase = 0.0;
931
932 QString prnRemoved;
933 double maxRes;
934
935 int irc = 0;
936
937 if (phase == 0) {
938
939 // Check GPS Code
940 // --------------
941 if (irc == 0) {
942 findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
943 if (maxResCode > MAXRES_CODE_GPS) {
944 satDataGPS.remove(prnCode);
945 prnRemoved = prnCode;
946 maxRes = maxResCode;
947 irc = 1;
948 }
949 }
950
951 // Check Galileo Code
952 // ------------------
953 if (irc == 0) {
954 findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
955 if (maxResCode > MAXRES_CODE_GAL) {
956 satDataGal.remove(prnCode);
957 prnRemoved = prnCode;
958 maxRes = maxResCode;
959 irc = 1;
960 }
961 }
962 }
963
964 else {
965 // Check Glonass Phase
966 // -------------------
967 if (irc == 0) {
968 findMaxRes(vv,satDataGlo, prnCode, maxResCode, prnPhase, maxResPhase);
969 if (maxResPhase > MAXRES_PHASE_GLO) {
970 satDataGlo.remove(prnPhase);
971 prnRemoved = prnPhase;
972 maxRes = maxResPhase;
973 irc = 1;
974 }
975 }
976
977 // Check Galileo Phase
978 // -------------------
979 if (irc == 0) {
980 findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
981 if (maxResPhase > MAXRES_PHASE_GAL) {
982 satDataGal.remove(prnPhase);
983 prnRemoved = prnPhase;
984 maxRes = maxResPhase;
985 irc = 1;
986 }
987 }
988
989 // Check GPS Phase
990 // ---------------
991 if (irc == 0) {
992 findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
993 if (maxResPhase > MAXRES_PHASE_GPS) {
994 satDataGPS.remove(prnPhase);
995 prnRemoved = prnPhase;
996 maxRes = maxResPhase;
997 irc = 1;
998 }
999 }
1000 }
1001
1002 if (irc != 0) {
1003 _log += "Outlier " + prnRemoved.toAscii() + " "
1004 + QByteArray::number(maxRes, 'f', 3) + "\n";
1005 _QQ = QQsav;
1006 }
1007
1008 return irc;
1009}
1010
1011//
1012////////////////////////////////////////////////////////////////////////////
1013void bncModel::writeNMEAstr(const QString& nmStr) {
1014
1015 unsigned char XOR = 0;
1016 for (int ii = 0; ii < nmStr.length(); ii++) {
1017 XOR ^= (unsigned char) nmStr[ii].toAscii();
1018 }
1019
1020 QString outStr = '$' + nmStr
1021 + QString("*%1\n").arg(int(XOR), 0, 16).toUpper();
1022
1023 if (_nmeaStream) {
1024 *_nmeaStream << outStr;
1025 _nmeaStream->flush();
1026 }
1027
1028 emit newNMEAstr(outStr.toAscii());
1029}
1030
1031////
1032//////////////////////////////////////////////////////////////////////////////
1033void bncModel::kalman(const Matrix& AA, const ColumnVector& ll,
1034 const DiagonalMatrix& PP,
1035 SymmetricMatrix& QQ, ColumnVector& dx) {
1036
1037 int nObs = AA.Nrows();
1038 int nPar = AA.Ncols();
1039
1040 UpperTriangularMatrix SS = Cholesky(QQ).t();
1041
1042 Matrix SA = SS*AA.t();
1043 Matrix SRF(nObs+nPar, nObs+nPar); SRF = 0;
1044 for (int ii = 1; ii <= nObs; ++ii) {
1045 SRF(ii,ii) = 1.0 / sqrt(PP(ii,ii));
1046 }
1047
1048 SRF.SubMatrix (nObs+1, nObs+nPar, 1, nObs) = SA;
1049 SRF.SymSubMatrix(nObs+1, nObs+nPar) = SS;
1050
1051 UpperTriangularMatrix UU;
1052 QRZ(SRF, UU);
1053
1054 SS = UU.SymSubMatrix(nObs+1, nObs+nPar);
1055 UpperTriangularMatrix SH_rt = UU.SymSubMatrix(1, nObs);
1056 Matrix YY = UU.SubMatrix(1, nObs, nObs+1, nObs+nPar);
1057
1058 UpperTriangularMatrix SHi = SH_rt.i();
1059
1060 Matrix KT = SHi * YY;
1061 SymmetricMatrix Hi; Hi << SHi * SHi.t();
1062
1063 dx = KT.t() * ll;
1064 QQ << (SS.t() * SS);
1065}
1066
1067// Phase Wind-Up Correction
1068///////////////////////////////////////////////////////////////////////////
1069double bncModel::windUp(const QString& prn, const ColumnVector& rSat,
1070 const ColumnVector& rRec) {
1071
1072 double Mjd = _time.mjd() + _time.daysec() / 86400.0;
1073
1074 // First time - initialize to zero
1075 // -------------------------------
1076 if (!_windUpTime.contains(prn)) {
1077 _windUpSum[prn] = 0.0;
1078 }
1079
1080 // Compute the correction for new time
1081 // -----------------------------------
1082 if (!_windUpTime.contains(prn) || _windUpTime[prn] != Mjd) {
1083 _windUpTime[prn] = Mjd;
1084
1085 // Unit Vector GPS Satellite --> Receiver
1086 // --------------------------------------
1087 ColumnVector rho = rRec - rSat;
1088 rho /= rho.norm_Frobenius();
1089
1090 // GPS Satellite unit Vectors sz, sy, sx
1091 // -------------------------------------
1092 ColumnVector sz = -rSat / rSat.norm_Frobenius();
1093
1094 ColumnVector xSun = Sun(Mjd);
1095 xSun /= xSun.norm_Frobenius();
1096
1097 ColumnVector sy = crossproduct(sz, xSun);
1098 ColumnVector sx = crossproduct(sy, sz);
1099
1100 // Effective Dipole of the GPS Satellite Antenna
1101 // ---------------------------------------------
1102 ColumnVector dipSat = sx - rho * DotProduct(rho,sx)
1103 - crossproduct(rho, sy);
1104
1105 // Receiver unit Vectors rx, ry
1106 // ----------------------------
1107 ColumnVector rx(3);
1108 ColumnVector ry(3);
1109
1110 double recEll[3]; xyz2ell(rRec.data(), recEll) ;
1111 double neu[3];
1112
1113 neu[0] = 1.0;
1114 neu[1] = 0.0;
1115 neu[2] = 0.0;
1116 neu2xyz(recEll, neu, rx.data());
1117
1118 neu[0] = 0.0;
1119 neu[1] = -1.0;
1120 neu[2] = 0.0;
1121 neu2xyz(recEll, neu, ry.data());
1122
1123 // Effective Dipole of the Receiver Antenna
1124 // ----------------------------------------
1125 ColumnVector dipRec = rx - rho * DotProduct(rho,rx)
1126 + crossproduct(rho, ry);
1127
1128 // Resulting Effect
1129 // ----------------
1130 double alpha = DotProduct(dipSat,dipRec) /
1131 (dipSat.norm_Frobenius() * dipRec.norm_Frobenius());
1132
1133 if (alpha > 1.0) alpha = 1.0;
1134 if (alpha < -1.0) alpha = -1.0;
1135
1136 double dphi = acos(alpha) / 2.0 / M_PI; // in cycles
1137
1138 if ( DotProduct(rho, crossproduct(dipSat, dipRec)) < 0.0 ) {
1139 dphi = -dphi;
1140 }
1141
1142 _windUpSum[prn] = floor(_windUpSum[prn] - dphi + 0.5) + dphi;
1143 }
1144
1145 return _windUpSum[prn];
1146}
1147
1148//
1149///////////////////////////////////////////////////////////////////////////
1150void bncModel::cmpEle(t_satData* satData) {
1151 ColumnVector rr = satData->xx - _xcBanc.Rows(1,3);
1152 double rho = rr.norm_Frobenius();
1153
1154 double neu[3];
1155 xyz2neu(_ellBanc.data(), rr.data(), neu);
1156
1157 satData->eleSat = acos( sqrt(neu[0]*neu[0] + neu[1]*neu[1]) / rho );
1158 if (neu[2] < 0) {
1159 satData->eleSat *= -1.0;
1160 }
1161 satData->azSat = atan2(neu[1], neu[0]);
1162}
1163
1164//
1165///////////////////////////////////////////////////////////////////////////
1166void bncModel::addAmb(t_satData* satData) {
1167 bool found = false;
1168 for (int iPar = 1; iPar <= _params.size(); iPar++) {
1169 if (_params[iPar-1]->type == bncParam::AMB_L3 &&
1170 _params[iPar-1]->prn == satData->prn) {
1171 found = true;
1172 break;
1173 }
1174 }
1175 if (!found) {
1176 bncParam* par = new bncParam(bncParam::AMB_L3,
1177 _params.size()+1, satData->prn);
1178 _params.push_back(par);
1179 par->xx = satData->L3 - cmpValue(satData, true);
1180 }
1181}
1182
1183//
1184///////////////////////////////////////////////////////////////////////////
1185void bncModel::addObs(int phase, unsigned& iObs, t_satData* satData,
1186 Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP) {
1187
1188 // Phase Observations
1189 // ------------------
1190 if (phase == 1) {
1191 ++iObs;
1192 ll(iObs) = satData->L3 - cmpValue(satData, true);
1193 PP(iObs,iObs) = 1.0 / (_sigL3 * _sigL3);
1194 for (int iPar = 1; iPar <= _params.size(); iPar++) {
1195 if (_params[iPar-1]->type == bncParam::AMB_L3 &&
1196 _params[iPar-1]->prn == satData->prn) {
1197 ll(iObs) -= _params[iPar-1]->xx;
1198 }
1199 AA(iObs, iPar) = _params[iPar-1]->partial(satData, true);
1200 }
1201 satData->indexPhase = iObs;
1202 }
1203
1204 // Code Observations
1205 // -----------------
1206 else {
1207 ++iObs;
1208 ll(iObs) = satData->P3 - cmpValue(satData, false);
1209 PP(iObs,iObs) = 1.0 / (_sigP3 * _sigP3);
1210 for (int iPar = 1; iPar <= _params.size(); iPar++) {
1211 AA(iObs, iPar) = _params[iPar-1]->partial(satData, false);
1212 }
1213 satData->indexCode = iObs;
1214 }
1215}
1216
1217//
1218///////////////////////////////////////////////////////////////////////////
1219void bncModel::printRes(int phase, const ColumnVector& vv,
1220 ostringstream& str, t_satData* satData) {
1221 if (phase) {
1222 str << _time.timestr(1)
1223 << " RES " << satData->prn.toAscii().data() << " L3 "
1224 << setw(9) << setprecision(4) << vv(satData->indexPhase) << endl;
1225 }
1226 else {
1227 str << _time.timestr(1)
1228 << " RES " << satData->prn.toAscii().data() << " P3 "
1229 << setw(9) << setprecision(4) << vv(satData->indexCode) << endl;
1230 }
1231}
1232
1233//
1234///////////////////////////////////////////////////////////////////////////
1235void bncModel::findMaxRes(const ColumnVector& vv,
1236 const QMap<QString, t_satData*>& satData,
1237 QString& prnCode, double& maxResCode,
1238 QString& prnPhase, double& maxResPhase) {
1239 maxResCode = 0.0;
1240 maxResPhase = 0.0;
1241
1242 QMapIterator<QString, t_satData*> it(satData);
1243 while (it.hasNext()) {
1244 it.next();
1245 t_satData* satData = it.value();
1246 if (satData->indexCode) {
1247 if (fabs(vv(satData->indexCode)) > maxResCode) {
1248 maxResCode = fabs(vv(satData->indexCode));
1249 prnCode = satData->prn;
1250 }
1251 }
1252 if (satData->indexPhase) {
1253 if (fabs(vv(satData->indexPhase)) > maxResPhase) {
1254 maxResPhase = fabs(vv(satData->indexPhase));
1255 prnPhase = satData->prn;
1256 }
1257 }
1258 }
1259}
1260
1261// Update Step (private - loop over outliers)
1262////////////////////////////////////////////////////////////////////////////
1263t_irc bncModel::update_p(t_epoData* epoData, ColumnVector& dx) {
1264
1265 SymmetricMatrix QQsav;
1266 ColumnVector vv;
1267
1268 for (int iPhase = 0; iPhase <= (_usePhase ? 1 : 0); iPhase++) {
1269
1270 do {
1271
1272 if (iPhase == 0) {
1273
1274 // Bancroft Solution
1275 // -----------------
1276 if (cmpBancroft(epoData) != success) {
1277 emit newMessage(_log, false);
1278 return failure;
1279 }
1280 }
1281
1282 // Status Prediction
1283 // -----------------
1284 predict(epoData);
1285
1286 // Create First-Design Matrix
1287 // --------------------------
1288 unsigned nPar = _params.size();
1289 unsigned nObs = 0;
1290 if (iPhase == 0) {
1291 nObs = epoData->sizeGPS() + epoData->sizeGal(); // Glonass code not used
1292 }
1293 else {
1294 nObs = epoData->sizeGPS() + epoData->sizeGal() + epoData->sizeGlo();
1295 }
1296
1297 Matrix AA(nObs, nPar); // first design matrix
1298 ColumnVector ll(nObs); // tems observed-computed
1299 DiagonalMatrix PP(nObs); PP = 0.0;
1300
1301 unsigned iObs = 0;
1302
1303 // GPS
1304 // ---
1305 QMapIterator<QString, t_satData*> itGPS(epoData->satDataGPS);
1306 while (itGPS.hasNext()) {
1307 itGPS.next();
1308 t_satData* satData = itGPS.value();
1309 addObs(iPhase, iObs, satData, AA, ll, PP);
1310 }
1311
1312 // Glonass
1313 // -------
1314 if (iPhase == 1) {
1315 QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo);
1316 while (itGlo.hasNext()) {
1317 itGlo.next();
1318 t_satData* satData = itGlo.value();
1319 addObs(iPhase, iObs, satData, AA, ll, PP);
1320 }
1321 }
1322
1323 // Galileo
1324 // -------
1325 QMapIterator<QString, t_satData*> itGal(epoData->satDataGal);
1326 while (itGal.hasNext()) {
1327 itGal.next();
1328 t_satData* satData = itGal.value();
1329 addObs(iPhase, iObs, satData, AA, ll, PP);
1330 }
1331
1332 // Compute Filter Update
1333 // ---------------------
1334 QQsav = _QQ;
1335
1336 kalman(AA, ll, PP, _QQ, dx);
1337
1338 vv = ll - AA * dx;
1339
1340 // Print Residuals
1341 // ---------------
1342 if (true) {
1343 ostringstream str;
1344 str.setf(ios::fixed);
1345
1346 QMapIterator<QString, t_satData*> itGPS(epoData->satDataGPS);
1347 while (itGPS.hasNext()) {
1348 itGPS.next();
1349 t_satData* satData = itGPS.value();
1350 printRes(iPhase, vv, str, satData);
1351 }
1352 if (iPhase == 1) {
1353 QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo);
1354 while (itGlo.hasNext()) {
1355 itGlo.next();
1356 t_satData* satData = itGlo.value();
1357 printRes(iPhase, vv, str, satData);
1358 }
1359 }
1360 QMapIterator<QString, t_satData*> itGal(epoData->satDataGal);
1361 while (itGal.hasNext()) {
1362 itGal.next();
1363 t_satData* satData = itGal.value();
1364 printRes(iPhase, vv, str, satData);
1365 }
1366 _log += str.str().c_str();
1367 }
1368
1369 } while (outlierDetection(iPhase, QQsav, vv, epoData->satDataGPS,
1370 epoData->satDataGlo, epoData->satDataGal) != 0);
1371 }
1372
1373 return success;
1374}
Note: See TracBrowser for help on using the repository browser.