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

Last change on this file since 3310 was 3310, checked in by mervart, 13 years ago
File size: 39.8 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(int iPhase, t_epoData* epoData) {
480
481 if (iPhase == 0) {
482
483 bncSettings settings;
484
485 _time = epoData->tt; // current epoch time
486
487 _maxSolGap = settings.value("pppMaxSolGap").toDouble();
488
489 bool firstCrd = false;
490 if (!_lastTimeOK.valid() || (_maxSolGap > 0 && _time - _lastTimeOK > _maxSolGap)) {
491 firstCrd = true;
492 _startTime = epoData->tt;
493 reset();
494 }
495
496 // Use different white noise for Quick-Start mode
497 // ----------------------------------------------
498 double sigCrdP_used = _sigCrdP;
499 if ( _quickStart > 0.0 && _quickStart > (epoData->tt - _startTime) ) {
500 sigCrdP_used = 0.0;
501 }
502
503 // Predict Parameter values, add white noise
504 // -----------------------------------------
505 for (int iPar = 1; iPar <= _params.size(); iPar++) {
506 bncParam* pp = _params[iPar-1];
507
508 // Coordinates
509 // -----------
510 if (pp->type == bncParam::CRD_X) {
511 if (firstCrd) {
512 if (settings.value("pppRefCrdX").toString() != "" &&
513 settings.value("pppRefCrdY").toString() != "" &&
514 settings.value("pppRefCrdZ").toString() != "") {
515 pp->xx = settings.value("pppRefCrdX").toDouble();
516 }
517 else {
518 pp->xx = _xcBanc(1);
519 }
520 }
521 _QQ(iPar,iPar) += sigCrdP_used * sigCrdP_used;
522 }
523 else if (pp->type == bncParam::CRD_Y) {
524 if (firstCrd) {
525 if (settings.value("pppRefCrdX").toString() != "" &&
526 settings.value("pppRefCrdY").toString() != "" &&
527 settings.value("pppRefCrdZ").toString() != "") {
528 pp->xx = settings.value("pppRefCrdY").toDouble();
529 }
530 else {
531 pp->xx = _xcBanc(2);
532 }
533 }
534 _QQ(iPar,iPar) += sigCrdP_used * sigCrdP_used;
535 }
536 else if (pp->type == bncParam::CRD_Z) {
537 if (firstCrd) {
538 if (settings.value("pppRefCrdX").toString() != "" &&
539 settings.value("pppRefCrdY").toString() != "" &&
540 settings.value("pppRefCrdZ").toString() != "") {
541 pp->xx = settings.value("pppRefCrdZ").toDouble();
542 }
543 else {
544 pp->xx = _xcBanc(3);
545 }
546 }
547 _QQ(iPar,iPar) += sigCrdP_used * sigCrdP_used;
548 }
549
550 // Receiver Clocks
551 // ---------------
552 else if (pp->type == bncParam::RECCLK) {
553 pp->xx = _xcBanc(4);
554 for (int jj = 1; jj <= _params.size(); jj++) {
555 _QQ(iPar, jj) = 0.0;
556 }
557 _QQ(iPar,iPar) = _sigClk0 * _sigClk0;
558 }
559
560 // Tropospheric Delay
561 // ------------------
562 else if (pp->type == bncParam::TROPO) {
563 _QQ(iPar,iPar) += _sigTrpP * _sigTrpP;
564 }
565
566 // Galileo Offset
567 // --------------
568 else if (pp->type == bncParam::GALILEO_OFFSET) {
569 _QQ(iPar,iPar) += _sigGalileoOffsetP * _sigGalileoOffsetP;
570 }
571 }
572 }
573
574 // Add New Ambiguities if necessary
575 // --------------------------------
576 if (_usePhase) {
577
578 // Make a copy of QQ and xx, set parameter indices
579 // -----------------------------------------------
580 SymmetricMatrix QQ_old = _QQ;
581
582 for (int iPar = 1; iPar <= _params.size(); iPar++) {
583 _params[iPar-1]->index_old = _params[iPar-1]->index;
584 _params[iPar-1]->index = 0;
585 }
586
587 // Remove Ambiguity Parameters without observations
588 // ------------------------------------------------
589 int iPar = 0;
590 QMutableVectorIterator<bncParam*> it(_params);
591 while (it.hasNext()) {
592 bncParam* par = it.next();
593 bool removed = false;
594 if (par->type == bncParam::AMB_L3) {
595 if (epoData->satDataGPS.find(par->prn) == epoData->satDataGPS.end() &&
596 epoData->satDataGlo.find(par->prn) == epoData->satDataGlo.end() &&
597 epoData->satDataGal.find(par->prn) == epoData->satDataGal.end() ) {
598 removed = true;
599 delete par;
600 it.remove();
601 }
602 }
603 if (! removed) {
604 ++iPar;
605 par->index = iPar;
606 }
607 }
608
609 // Add new ambiguity parameters
610 // ----------------------------
611 QMapIterator<QString, t_satData*> iGPS(epoData->satDataGPS);
612 while (iGPS.hasNext()) {
613 iGPS.next();
614 t_satData* satData = iGPS.value();
615 addAmb(satData);
616 }
617
618 QMapIterator<QString, t_satData*> iGlo(epoData->satDataGlo);
619 while (iGlo.hasNext()) {
620 iGlo.next();
621 t_satData* satData = iGlo.value();
622 addAmb(satData);
623 }
624
625 QMapIterator<QString, t_satData*> iGal(epoData->satDataGal);
626 while (iGal.hasNext()) {
627 iGal.next();
628 t_satData* satData = iGal.value();
629 addAmb(satData);
630 }
631
632 int nPar = _params.size();
633 _QQ.ReSize(nPar); _QQ = 0.0;
634 for (int i1 = 1; i1 <= nPar; i1++) {
635 bncParam* p1 = _params[i1-1];
636 if (p1->index_old != 0) {
637 _QQ(p1->index, p1->index) = QQ_old(p1->index_old, p1->index_old);
638 for (int i2 = 1; i2 <= nPar; i2++) {
639 bncParam* p2 = _params[i2-1];
640 if (p2->index_old != 0) {
641 _QQ(p1->index, p2->index) = QQ_old(p1->index_old, p2->index_old);
642 }
643 }
644 }
645 }
646
647 for (int ii = 1; ii <= nPar; ii++) {
648 bncParam* par = _params[ii-1];
649 if (par->index_old == 0) {
650 _QQ(par->index, par->index) = _sigAmb0 * _sigAmb0;
651 }
652 par->index_old = par->index;
653 }
654 }
655}
656
657// Update Step of the Filter (currently just a single-epoch solution)
658////////////////////////////////////////////////////////////////////////////
659t_irc bncModel::update(t_epoData* epoData) {
660
661 bncSettings settings;
662
663 _log.clear();
664
665 if (settings.value("pppSPP").toString() == "PPP") {
666 _log += "Precise Point Positioning of Epoch "
667 + QByteArray(_time.timestr(1).c_str()) +
668 "\n---------------------------------------------------------------\n";
669 }
670 else {
671 _log += "Single Point Positioning of Epoch "
672 + QByteArray(_time.timestr(1).c_str()) +
673 "\n--------------------------------------------------------------\n";
674 }
675
676 // Outlier Detection Loop
677 // ----------------------
678 ColumnVector dx;
679 if (update_p(epoData, dx) != success) {
680 return failure;
681 }
682
683 // Remember the Epoch-specific Results for the computation of means
684 // ----------------------------------------------------------------
685 pppPos* newPos = new pppPos;
686 newPos->time = epoData->tt;
687
688 // Set Solution Vector
689 // -------------------
690 ostringstream strB;
691 strB.setf(ios::fixed);
692 QVectorIterator<bncParam*> itPar(_params);
693 while (itPar.hasNext()) {
694 bncParam* par = itPar.next();
695 par->xx += dx(par->index);
696
697 if (par->type == bncParam::RECCLK) {
698 strB << "\n clk = " << setw(10) << setprecision(3) << par->xx
699 << " +- " << setw(6) << setprecision(3)
700 << sqrt(_QQ(par->index,par->index));
701 }
702 else if (par->type == bncParam::AMB_L3) {
703 strB << "\n amb " << par->prn.toAscii().data() << " = "
704 << setw(10) << setprecision(3) << par->xx
705 << " +- " << setw(6) << setprecision(3)
706 << sqrt(_QQ(par->index,par->index));
707 }
708 else if (par->type == bncParam::TROPO) {
709 double aprTrp = delay_saast(M_PI/2.0);
710 strB << "\n trp = " << par->prn.toAscii().data()
711 << setw(7) << setprecision(3) << aprTrp << " "
712 << setw(6) << setprecision(3) << showpos << par->xx << noshowpos
713 << " +- " << setw(6) << setprecision(3)
714 << sqrt(_QQ(par->index,par->index));
715 newPos->xnt[6] = aprTrp + par->xx;
716 }
717 else if (par->type == bncParam::GALILEO_OFFSET) {
718 strB << "\n offset = " << setw(10) << setprecision(3) << par->xx
719 << " +- " << setw(6) << setprecision(3)
720 << sqrt(_QQ(par->index,par->index));
721 }
722 }
723 strB << '\n';
724 _log += strB.str().c_str();
725 emit newMessage(_log, false);
726
727 // Final Message (both log file and screen)
728 // ----------------------------------------
729 ostringstream strC;
730 strC.setf(ios::fixed);
731 strC << _staID.data() << " PPP "
732 << epoData->tt.timestr(1) << " " << epoData->sizeAll() << " "
733 << setw(14) << setprecision(3) << x() << " +- "
734 << setw(6) << setprecision(3) << sqrt(_QQ(1,1)) << " "
735 << setw(14) << setprecision(3) << y() << " +- "
736 << setw(6) << setprecision(3) << sqrt(_QQ(2,2)) << " "
737 << setw(14) << setprecision(3) << z() << " +- "
738 << setw(6) << setprecision(3) << sqrt(_QQ(3,3));
739
740 // NEU Output
741 // ----------
742 double xyzRef[3];
743
744 if (settings.value("pppRefCrdX").toString() != "" &&
745 settings.value("pppRefCrdY").toString() != "" &&
746 settings.value("pppRefCrdZ").toString() != "") {
747
748 xyzRef[0] = settings.value("pppRefCrdX").toDouble();
749 xyzRef[1] = settings.value("pppRefCrdY").toDouble();
750 xyzRef[2] = settings.value("pppRefCrdZ").toDouble();
751
752 newPos->xnt[0] = x() - xyzRef[0];
753 newPos->xnt[1] = y() - xyzRef[1];
754 newPos->xnt[2] = z() - xyzRef[2];
755
756 double ellRef[3];
757 xyz2ell(xyzRef, ellRef);
758 xyz2neu(ellRef, newPos->xnt, &newPos->xnt[3]);
759
760 strC << " NEU "
761 << setw(8) << setprecision(3) << newPos->xnt[3] << " "
762 << setw(8) << setprecision(3) << newPos->xnt[4] << " "
763 << setw(8) << setprecision(3) << newPos->xnt[5] << endl;
764
765 }
766
767 emit newMessage(QByteArray(strC.str().c_str()), true);
768
769 if (settings.value("pppAverage").toString() == "") {
770 delete newPos;
771 }
772 else {
773
774 _posAverage.push_back(newPos);
775
776 // Time Span for Average Computation
777 // ---------------------------------
778 double tRangeAverage = settings.value("pppAverage").toDouble() * 60.;
779 if (tRangeAverage < 0) {
780 tRangeAverage = 0;
781 }
782 if (tRangeAverage > 86400) {
783 tRangeAverage = 86400;
784 }
785
786 // Compute the Mean
787 // ----------------
788 ColumnVector mean(7); mean = 0.0;
789
790 QMutableVectorIterator<pppPos*> it(_posAverage);
791 while (it.hasNext()) {
792 pppPos* pp = it.next();
793 if ( (epoData->tt - pp->time) >= tRangeAverage ) {
794 delete pp;
795 it.remove();
796 }
797 else {
798 for (int ii = 0; ii < 7; ++ii) {
799 mean[ii] += pp->xnt[ii];
800 }
801 }
802 }
803
804 int nn = _posAverage.size();
805
806 if (nn > 0) {
807
808 mean /= nn;
809
810 // Compute the Deviation
811 // ---------------------
812 ColumnVector std(7); std = 0.0;
813 QVectorIterator<pppPos*> it2(_posAverage);
814 while (it2.hasNext()) {
815 pppPos* pp = it2.next();
816 for (int ii = 0; ii < 7; ++ii) {
817 std[ii] += (pp->xnt[ii] - mean[ii]) * (pp->xnt[ii] - mean[ii]);
818 }
819 }
820 for (int ii = 0; ii < 7; ++ii) {
821 std[ii] = sqrt(std[ii] / nn);
822 }
823
824 if (settings.value("pppRefCrdX").toString() != "" &&
825 settings.value("pppRefCrdY").toString() != "" &&
826 settings.value("pppRefCrdZ").toString() != "") {
827
828 ostringstream strD; strD.setf(ios::fixed);
829 strD << _staID.data() << " AVE-XYZ "
830 << epoData->tt.timestr(1) << " "
831 << setw(13) << setprecision(3) << mean[0] + xyzRef[0] << " +- "
832 << setw(6) << setprecision(3) << std[0] << " "
833 << setw(14) << setprecision(3) << mean[1] + xyzRef[1] << " +- "
834 << setw(6) << setprecision(3) << std[1] << " "
835 << setw(14) << setprecision(3) << mean[2] + xyzRef[2] << " +- "
836 << setw(6) << setprecision(3) << std[2];
837 emit newMessage(QByteArray(strD.str().c_str()), true);
838
839 ostringstream strE; strE.setf(ios::fixed);
840 strE << _staID.data() << " AVE-NEU "
841 << epoData->tt.timestr(1) << " "
842 << setw(13) << setprecision(3) << mean[3] << " +- "
843 << setw(6) << setprecision(3) << std[3] << " "
844 << setw(14) << setprecision(3) << mean[4] << " +- "
845 << setw(6) << setprecision(3) << std[4] << " "
846 << setw(14) << setprecision(3) << mean[5] << " +- "
847 << setw(6) << setprecision(3) << std[5];
848 emit newMessage(QByteArray(strE.str().c_str()), true);
849
850 if ( Qt::CheckState(settings.value("pppEstTropo").toInt()) == Qt::Checked) {
851 ostringstream strF; strF.setf(ios::fixed);
852 strF << _staID.data() << " AVE-TRP "
853 << epoData->tt.timestr(1) << " "
854 << setw(13) << setprecision(3) << mean[6] << " +- "
855 << setw(6) << setprecision(3) << std[6] << endl;
856 emit newMessage(QByteArray(strF.str().c_str()), true);
857 }
858 }
859 }
860 }
861
862 // NMEA Output
863 // -----------
864 double xyz[3];
865 xyz[0] = x();
866 xyz[1] = y();
867 xyz[2] = z();
868 double ell[3];
869 xyz2ell(xyz, ell);
870 double phiDeg = ell[0] * 180 / M_PI;
871 double lamDeg = ell[1] * 180 / M_PI;
872
873 char phiCh = 'N';
874 if (phiDeg < 0) {
875 phiDeg = -phiDeg;
876 phiCh = 'S';
877 }
878 char lamCh = 'E';
879 if (lamDeg < 0) {
880 lamDeg = -lamDeg;
881 lamCh = 'W';
882 }
883
884 string datestr = epoData->tt.datestr(0); // yyyymmdd
885 ostringstream strRMC;
886 strRMC.setf(ios::fixed);
887 strRMC << "GPRMC,"
888 << epoData->tt.timestr(0,0) << ",A,"
889 << setw(2) << setfill('0') << int(phiDeg)
890 << setw(6) << setprecision(3) << setfill('0')
891 << fmod(60*phiDeg,60) << ',' << phiCh << ','
892 << setw(3) << setfill('0') << int(lamDeg)
893 << setw(6) << setprecision(3) << setfill('0')
894 << fmod(60*lamDeg,60) << ',' << lamCh << ",,,"
895 << datestr[6] << datestr[7] << datestr[4] << datestr[5]
896 << datestr[2] << datestr[3] << ",,";
897
898 writeNMEAstr(QString(strRMC.str().c_str()));
899
900 double dop = 2.0; // TODO
901
902 ostringstream strGGA;
903 strGGA.setf(ios::fixed);
904 strGGA << "GPGGA,"
905 << epoData->tt.timestr(0,0) << ','
906 << setw(2) << setfill('0') << int(phiDeg)
907 << setw(10) << setprecision(7) << setfill('0')
908 << fmod(60*phiDeg,60) << ',' << phiCh << ','
909 << setw(3) << setfill('0') << int(lamDeg)
910 << setw(10) << setprecision(7) << setfill('0')
911 << fmod(60*lamDeg,60) << ',' << lamCh
912 << ",1," << setw(2) << setfill('0') << epoData->sizeAll() << ','
913 << setw(3) << setprecision(1) << dop << ','
914 << setprecision(3) << ell[2] << ",M,0.0,M,,";
915
916 writeNMEAstr(QString(strGGA.str().c_str()));
917
918 _lastTimeOK = _time; // remember time of last successful update
919 return success;
920}
921
922// Outlier Detection
923////////////////////////////////////////////////////////////////////////////
924int bncModel::outlierDetection(int iPhase, const SymmetricMatrix& QQsav,
925 const ColumnVector& vv,
926 QMap<QString, t_satData*>& satDataGPS,
927 QMap<QString, t_satData*>& satDataGlo,
928 QMap<QString, t_satData*>& satDataGal) {
929
930 QString prnCode;
931 QString prnPhase;
932 double maxResCode = 0.0;
933 double maxResPhase = 0.0;
934
935 QString prnRemoved;
936 double maxRes;
937
938 int irc = 0;
939
940 if (iPhase == 0) {
941
942 // Check GPS Code
943 // --------------
944 if (irc == 0) {
945 findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
946 if (maxResCode > MAXRES_CODE_GPS) {
947 satDataGPS.remove(prnCode);
948 prnRemoved = prnCode;
949 maxRes = maxResCode;
950 irc = 1;
951 }
952 }
953
954 // Check Galileo Code
955 // ------------------
956 if (irc == 0) {
957 findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
958 if (maxResCode > MAXRES_CODE_GAL) {
959 satDataGal.remove(prnCode);
960 prnRemoved = prnCode;
961 maxRes = maxResCode;
962 irc = 1;
963 }
964 }
965 }
966
967 else {
968
969 // Check Glonass Phase
970 // -------------------
971 if (irc == 0) {
972 findMaxRes(vv,satDataGlo, prnCode, maxResCode, prnPhase, maxResPhase);
973 if (maxResPhase > MAXRES_PHASE_GLO) {
974 satDataGlo.remove(prnPhase);
975 prnRemoved = prnPhase;
976 maxRes = maxResPhase;
977 irc = 1;
978 }
979 }
980
981 // Check Galileo Phase
982 // -------------------
983 if (irc == 0) {
984 findMaxRes(vv,satDataGal, prnCode, maxResCode, prnPhase, maxResPhase);
985 if (maxResPhase > MAXRES_PHASE_GAL) {
986 satDataGal.remove(prnPhase);
987 prnRemoved = prnPhase;
988 maxRes = maxResPhase;
989 irc = 1;
990 }
991 }
992
993 // Check GPS Phase
994 // ---------------
995 if (irc == 0) {
996 findMaxRes(vv,satDataGPS, prnCode, maxResCode, prnPhase, maxResPhase);
997 if (maxResPhase > MAXRES_PHASE_GPS) {
998 satDataGPS.remove(prnPhase);
999 prnRemoved = prnPhase;
1000 maxRes = maxResPhase;
1001 irc = 1;
1002 }
1003 }
1004 }
1005
1006 if (irc != 0) {
1007 _log += "Outlier " + prnRemoved.toAscii() + " "
1008 + QByteArray::number(maxRes, 'f', 3) + "\n";
1009 _QQ = QQsav;
1010 }
1011
1012 return irc;
1013}
1014
1015//
1016////////////////////////////////////////////////////////////////////////////
1017void bncModel::writeNMEAstr(const QString& nmStr) {
1018
1019 unsigned char XOR = 0;
1020 for (int ii = 0; ii < nmStr.length(); ii++) {
1021 XOR ^= (unsigned char) nmStr[ii].toAscii();
1022 }
1023
1024 QString outStr = '$' + nmStr
1025 + QString("*%1\n").arg(int(XOR), 0, 16).toUpper();
1026
1027 if (_nmeaStream) {
1028 *_nmeaStream << outStr;
1029 _nmeaStream->flush();
1030 }
1031
1032 emit newNMEAstr(outStr.toAscii());
1033}
1034
1035////
1036//////////////////////////////////////////////////////////////////////////////
1037void bncModel::kalman(const Matrix& AA, const ColumnVector& ll,
1038 const DiagonalMatrix& PP,
1039 SymmetricMatrix& QQ, ColumnVector& dx) {
1040
1041 int nObs = AA.Nrows();
1042 int nPar = AA.Ncols();
1043
1044 UpperTriangularMatrix SS = Cholesky(QQ).t();
1045
1046 Matrix SA = SS*AA.t();
1047 Matrix SRF(nObs+nPar, nObs+nPar); SRF = 0;
1048 for (int ii = 1; ii <= nObs; ++ii) {
1049 SRF(ii,ii) = 1.0 / sqrt(PP(ii,ii));
1050 }
1051
1052 SRF.SubMatrix (nObs+1, nObs+nPar, 1, nObs) = SA;
1053 SRF.SymSubMatrix(nObs+1, nObs+nPar) = SS;
1054
1055 UpperTriangularMatrix UU;
1056 QRZ(SRF, UU);
1057
1058 SS = UU.SymSubMatrix(nObs+1, nObs+nPar);
1059 UpperTriangularMatrix SH_rt = UU.SymSubMatrix(1, nObs);
1060 Matrix YY = UU.SubMatrix(1, nObs, nObs+1, nObs+nPar);
1061
1062 UpperTriangularMatrix SHi = SH_rt.i();
1063
1064 Matrix KT = SHi * YY;
1065 SymmetricMatrix Hi; Hi << SHi * SHi.t();
1066
1067 dx = KT.t() * ll;
1068 QQ << (SS.t() * SS);
1069}
1070
1071// Phase Wind-Up Correction
1072///////////////////////////////////////////////////////////////////////////
1073double bncModel::windUp(const QString& prn, const ColumnVector& rSat,
1074 const ColumnVector& rRec) {
1075
1076 double Mjd = _time.mjd() + _time.daysec() / 86400.0;
1077
1078 // First time - initialize to zero
1079 // -------------------------------
1080 if (!_windUpTime.contains(prn)) {
1081 _windUpSum[prn] = 0.0;
1082 }
1083
1084 // Compute the correction for new time
1085 // -----------------------------------
1086 if (!_windUpTime.contains(prn) || _windUpTime[prn] != Mjd) {
1087 _windUpTime[prn] = Mjd;
1088
1089 // Unit Vector GPS Satellite --> Receiver
1090 // --------------------------------------
1091 ColumnVector rho = rRec - rSat;
1092 rho /= rho.norm_Frobenius();
1093
1094 // GPS Satellite unit Vectors sz, sy, sx
1095 // -------------------------------------
1096 ColumnVector sz = -rSat / rSat.norm_Frobenius();
1097
1098 ColumnVector xSun = Sun(Mjd);
1099 xSun /= xSun.norm_Frobenius();
1100
1101 ColumnVector sy = crossproduct(sz, xSun);
1102 ColumnVector sx = crossproduct(sy, sz);
1103
1104 // Effective Dipole of the GPS Satellite Antenna
1105 // ---------------------------------------------
1106 ColumnVector dipSat = sx - rho * DotProduct(rho,sx)
1107 - crossproduct(rho, sy);
1108
1109 // Receiver unit Vectors rx, ry
1110 // ----------------------------
1111 ColumnVector rx(3);
1112 ColumnVector ry(3);
1113
1114 double recEll[3]; xyz2ell(rRec.data(), recEll) ;
1115 double neu[3];
1116
1117 neu[0] = 1.0;
1118 neu[1] = 0.0;
1119 neu[2] = 0.0;
1120 neu2xyz(recEll, neu, rx.data());
1121
1122 neu[0] = 0.0;
1123 neu[1] = -1.0;
1124 neu[2] = 0.0;
1125 neu2xyz(recEll, neu, ry.data());
1126
1127 // Effective Dipole of the Receiver Antenna
1128 // ----------------------------------------
1129 ColumnVector dipRec = rx - rho * DotProduct(rho,rx)
1130 + crossproduct(rho, ry);
1131
1132 // Resulting Effect
1133 // ----------------
1134 double alpha = DotProduct(dipSat,dipRec) /
1135 (dipSat.norm_Frobenius() * dipRec.norm_Frobenius());
1136
1137 if (alpha > 1.0) alpha = 1.0;
1138 if (alpha < -1.0) alpha = -1.0;
1139
1140 double dphi = acos(alpha) / 2.0 / M_PI; // in cycles
1141
1142 if ( DotProduct(rho, crossproduct(dipSat, dipRec)) < 0.0 ) {
1143 dphi = -dphi;
1144 }
1145
1146 _windUpSum[prn] = floor(_windUpSum[prn] - dphi + 0.5) + dphi;
1147 }
1148
1149 return _windUpSum[prn];
1150}
1151
1152//
1153///////////////////////////////////////////////////////////////////////////
1154void bncModel::cmpEle(t_satData* satData) {
1155 ColumnVector rr = satData->xx - _xcBanc.Rows(1,3);
1156 double rho = rr.norm_Frobenius();
1157
1158 double neu[3];
1159 xyz2neu(_ellBanc.data(), rr.data(), neu);
1160
1161 satData->eleSat = acos( sqrt(neu[0]*neu[0] + neu[1]*neu[1]) / rho );
1162 if (neu[2] < 0) {
1163 satData->eleSat *= -1.0;
1164 }
1165 satData->azSat = atan2(neu[1], neu[0]);
1166}
1167
1168//
1169///////////////////////////////////////////////////////////////////////////
1170void bncModel::addAmb(t_satData* satData) {
1171 bool found = false;
1172 for (int iPar = 1; iPar <= _params.size(); iPar++) {
1173 if (_params[iPar-1]->type == bncParam::AMB_L3 &&
1174 _params[iPar-1]->prn == satData->prn) {
1175 found = true;
1176 break;
1177 }
1178 }
1179 if (!found) {
1180 bncParam* par = new bncParam(bncParam::AMB_L3,
1181 _params.size()+1, satData->prn);
1182 _params.push_back(par);
1183 par->xx = satData->L3 - cmpValue(satData, true);
1184 }
1185}
1186
1187//
1188///////////////////////////////////////////////////////////////////////////
1189void bncModel::addObs(int iPhase, unsigned& iObs, t_satData* satData,
1190 Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP) {
1191
1192 // Phase Observations
1193 // ------------------
1194 if (iPhase == 1) {
1195 ++iObs;
1196 ll(iObs) = satData->L3 - cmpValue(satData, true);
1197 PP(iObs,iObs) = 1.0 / (_sigL3 * _sigL3);
1198 for (int iPar = 1; iPar <= _params.size(); iPar++) {
1199 if (_params[iPar-1]->type == bncParam::AMB_L3 &&
1200 _params[iPar-1]->prn == satData->prn) {
1201 ll(iObs) -= _params[iPar-1]->xx;
1202 }
1203 AA(iObs, iPar) = _params[iPar-1]->partial(satData, true);
1204 }
1205 satData->indexPhase = iObs;
1206 }
1207
1208 // Code Observations
1209 // -----------------
1210 else {
1211 ++iObs;
1212 ll(iObs) = satData->P3 - cmpValue(satData, false);
1213 PP(iObs,iObs) = 1.0 / (_sigP3 * _sigP3);
1214 for (int iPar = 1; iPar <= _params.size(); iPar++) {
1215 AA(iObs, iPar) = _params[iPar-1]->partial(satData, false);
1216 }
1217 satData->indexCode = iObs;
1218 }
1219}
1220
1221//
1222///////////////////////////////////////////////////////////////////////////
1223void bncModel::printRes(int iPhase, const ColumnVector& vv,
1224 ostringstream& str, t_satData* satData) {
1225 if (iPhase == 1) {
1226 str << _time.timestr(1)
1227 << " RES " << satData->prn.toAscii().data() << " L3 "
1228 << setw(9) << setprecision(4) << vv(satData->indexPhase) << endl;
1229 }
1230 else {
1231 str << _time.timestr(1)
1232 << " RES " << satData->prn.toAscii().data() << " P3 "
1233 << setw(9) << setprecision(4) << vv(satData->indexCode) << endl;
1234 }
1235}
1236
1237//
1238///////////////////////////////////////////////////////////////////////////
1239void bncModel::findMaxRes(const ColumnVector& vv,
1240 const QMap<QString, t_satData*>& satData,
1241 QString& prnCode, double& maxResCode,
1242 QString& prnPhase, double& maxResPhase) {
1243 maxResCode = 0.0;
1244 maxResPhase = 0.0;
1245
1246 QMapIterator<QString, t_satData*> it(satData);
1247 while (it.hasNext()) {
1248 it.next();
1249 t_satData* satData = it.value();
1250 if (satData->indexCode) {
1251 if (fabs(vv(satData->indexCode)) > maxResCode) {
1252 maxResCode = fabs(vv(satData->indexCode));
1253 prnCode = satData->prn;
1254 }
1255 }
1256 if (satData->indexPhase) {
1257 if (fabs(vv(satData->indexPhase)) > maxResPhase) {
1258 maxResPhase = fabs(vv(satData->indexPhase));
1259 prnPhase = satData->prn;
1260 }
1261 }
1262 }
1263}
1264
1265// Update Step (private - loop over outliers)
1266////////////////////////////////////////////////////////////////////////////
1267t_irc bncModel::update_p(t_epoData* epoData, ColumnVector& dx) {
1268
1269 SymmetricMatrix QQsav;
1270 ColumnVector vv;
1271
1272 for (int iPhase = 0; iPhase <= (_usePhase ? 1 : 0); iPhase++) {
1273
1274 do {
1275
1276 // Bancroft Solution
1277 // -----------------
1278 if (iPhase == 0) {
1279 if (cmpBancroft(epoData) != success) {
1280 emit newMessage(_log, false);
1281 return failure;
1282 }
1283 }
1284
1285 // Status Prediction
1286 // -----------------
1287 predict(iPhase, epoData);
1288
1289 // Create First-Design Matrix
1290 // --------------------------
1291 unsigned nPar = _params.size();
1292 unsigned nObs = 0;
1293 if (iPhase == 0) {
1294 nObs = epoData->sizeGPS() + epoData->sizeGal(); // Glonass code not used
1295 }
1296 else {
1297 nObs = epoData->sizeGPS() + epoData->sizeGal() + epoData->sizeGlo();
1298 }
1299
1300 Matrix AA(nObs, nPar); // first design matrix
1301 ColumnVector ll(nObs); // tems observed-computed
1302 DiagonalMatrix PP(nObs); PP = 0.0;
1303
1304 unsigned iObs = 0;
1305
1306 // GPS
1307 // ---
1308 QMapIterator<QString, t_satData*> itGPS(epoData->satDataGPS);
1309 while (itGPS.hasNext()) {
1310 itGPS.next();
1311 t_satData* satData = itGPS.value();
1312 addObs(iPhase, iObs, satData, AA, ll, PP);
1313 }
1314
1315 // Glonass
1316 // -------
1317 if (iPhase == 1) {
1318 QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo);
1319 while (itGlo.hasNext()) {
1320 itGlo.next();
1321 t_satData* satData = itGlo.value();
1322 addObs(iPhase, iObs, satData, AA, ll, PP);
1323 }
1324 }
1325
1326 // Galileo
1327 // -------
1328 QMapIterator<QString, t_satData*> itGal(epoData->satDataGal);
1329 while (itGal.hasNext()) {
1330 itGal.next();
1331 t_satData* satData = itGal.value();
1332 addObs(iPhase, iObs, satData, AA, ll, PP);
1333 }
1334
1335 // Compute Filter Update
1336 // ---------------------
1337 QQsav = _QQ;
1338
1339 kalman(AA, ll, PP, _QQ, dx);
1340
1341 vv = ll - AA * dx;
1342
1343 // Print Residuals
1344 // ---------------
1345 if (true) {
1346 ostringstream str;
1347 str.setf(ios::fixed);
1348
1349 QMapIterator<QString, t_satData*> itGPS(epoData->satDataGPS);
1350 while (itGPS.hasNext()) {
1351 itGPS.next();
1352 t_satData* satData = itGPS.value();
1353 printRes(iPhase, vv, str, satData);
1354 }
1355 if (iPhase == 1) {
1356 QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo);
1357 while (itGlo.hasNext()) {
1358 itGlo.next();
1359 t_satData* satData = itGlo.value();
1360 printRes(iPhase, vv, str, satData);
1361 }
1362 }
1363 QMapIterator<QString, t_satData*> itGal(epoData->satDataGal);
1364 while (itGal.hasNext()) {
1365 itGal.next();
1366 t_satData* satData = itGal.value();
1367 printRes(iPhase, vv, str, satData);
1368 }
1369 _log += str.str().c_str();
1370 }
1371
1372 } while (outlierDetection(iPhase, QQsav, vv, epoData->satDataGPS,
1373 epoData->satDataGlo, epoData->satDataGal) != 0);
1374 }
1375
1376 return success;
1377}
Note: See TracBrowser for help on using the repository browser.