source: ntrip/trunk/BNC/src/combination/bnccomb.cpp@ 8204

Last change on this file since 8204 was 8204, checked in by wiese, 6 years ago

CHANGE: #105 toAscii deprecated

File size: 34.9 KB
RevLine 
[2898]1/* -------------------------------------------------------------------------
2 * BKG NTRIP Client
3 * -------------------------------------------------------------------------
4 *
5 * Class: bncComb
6 *
7 * Purpose: Combinations of Orbit/Clock Corrections
8 *
9 * Author: L. Mervart
10 *
11 * Created: 22-Jan-2011
12 *
[7297]13 * Changes:
[2898]14 *
15 * -----------------------------------------------------------------------*/
16
[2933]17#include <newmatio.h>
[2921]18#include <iomanip>
[3214]19#include <sstream>
[2898]20
21#include "bnccomb.h"
[5070]22#include "bnccore.h"
[3201]23#include "upload/bncrtnetdecoder.h"
[2910]24#include "bncsettings.h"
[2988]25#include "bncutils.h"
[3181]26#include "bncsp3.h"
[3052]27#include "bncantex.h"
[5742]28#include "t_prn.h"
[2898]29
[3455]30const double sig0_offAC = 1000.0;
31const double sig0_offACSat = 100.0;
[3468]32const double sigP_offACSat = 0.01;
[3455]33const double sig0_clkSat = 100.0;
34
35const double sigObs = 0.05;
36
37using namespace std;
38
[2898]39// Constructor
40////////////////////////////////////////////////////////////////////////////
[6155]41bncComb::cmbParam::cmbParam(parType type_, int index_, const QString& ac_, const QString& prn_) {
[3032]42
[3433]43 type = type_;
44 index = index_;
45 AC = ac_;
46 prn = prn_;
47 xx = 0.0;
[3455]48 eph = 0;
[3429]49
[3485]50 if (type == offACgps) {
[3455]51 epoSpec = true;
52 sig0 = sig0_offAC;
53 sigP = sig0;
[3429]54 }
[3485]55 else if (type == offACglo) {
56 epoSpec = true;
57 sig0 = sig0_offAC;
58 sigP = sig0;
59 }
[3429]60 else if (type == offACSat) {
[3455]61 epoSpec = false;
62 sig0 = sig0_offACSat;
63 sigP = sigP_offACSat;
[3429]64 }
65 else if (type == clkSat) {
[3455]66 epoSpec = true;
67 sig0 = sig0_clkSat;
68 sigP = sig0;
[3429]69 }
[2933]70}
71
72// Destructor
73////////////////////////////////////////////////////////////////////////////
[6155]74bncComb::cmbParam::~cmbParam() {
[2933]75}
76
77// Partial
78////////////////////////////////////////////////////////////////////////////
[6155]79double bncComb::cmbParam::partial(const QString& AC_, const QString& prn_) {
[7297]80
[3485]81 if (type == offACgps) {
82 if (AC == AC_ && prn_[0] == 'G') {
[2934]83 return 1.0;
84 }
85 }
[3485]86 else if (type == offACglo) {
87 if (AC == AC_ && prn_[0] == 'R') {
88 return 1.0;
89 }
90 }
[3429]91 else if (type == offACSat) {
92 if (AC == AC_ && prn == prn_) {
[2933]93 return 1.0;
94 }
95 }
[3429]96 else if (type == clkSat) {
97 if (prn == prn_) {
[2933]98 return 1.0;
99 }
100 }
101
102 return 0.0;
103}
104
[7297]105//
[2990]106////////////////////////////////////////////////////////////////////////////
[6155]107QString bncComb::cmbParam::toString() const {
[2933]108
[2990]109 QString outStr;
[7297]110
[3485]111 if (type == offACgps) {
112 outStr = "AC offset GPS " + AC;
[2990]113 }
[3485]114 else if (type == offACglo) {
115 outStr = "AC offset GLO " + AC;
116 }
[3429]117 else if (type == offACSat) {
[7008]118 outStr = "Sat Offset " + AC + " " + prn.mid(0,3);
[2990]119 }
[3429]120 else if (type == clkSat) {
[7008]121 outStr = "Clk Corr " + prn.mid(0,3);
[2990]122 }
[2933]123
[2990]124 return outStr;
125}
126
[7299]127// Singleton
128////////////////////////////////////////////////////////////////////////////
129bncComb* bncComb::instance() {
130 static bncComb _bncComb;
131 return &_bncComb;
132}
133
[2933]134// Constructor
135////////////////////////////////////////////////////////////////////////////
[6443]136bncComb::bncComb() : _ephUser(true) {
[2910]137
138 bncSettings settings;
139
[7297]140 QStringList cmbStreams = settings.value("cmbStreams").toStringList();
[2918]141
[4183]142 _cmbSampl = settings.value("cmbSampl").toInt();
143 if (_cmbSampl <= 0) {
144 _cmbSampl = 10;
145 }
146
[3455]147 _masterMissingEpochs = 0;
148
[7297]149 if (cmbStreams.size() >= 1 && !cmbStreams[0].isEmpty()) {
150 QListIterator<QString> it(cmbStreams);
[2910]151 while (it.hasNext()) {
152 QStringList hlp = it.next().split(" ");
[2918]153 cmbAC* newAC = new cmbAC();
154 newAC->mountPoint = hlp[0];
155 newAC->name = hlp[1];
156 newAC->weight = hlp[2].toDouble();
[3453]157 if (_masterOrbitAC.isEmpty()) {
158 _masterOrbitAC = newAC->name;
159 }
[3429]160 _ACs.append(newAC);
[2910]161 }
162 }
[2927]163
[3211]164 _rtnetDecoder = 0;
[3201]165
[7297]166 connect(this, SIGNAL(newMessage(QByteArray,bool)),
[5068]167 BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
[2933]168
[5583]169 connect(BNC_CORE, SIGNAL(providerIDChanged(QString)),
[6155]170 this, SLOT(slotProviderIDChanged(QString)));
[5583]171
[6155]172 connect(BNC_CORE, SIGNAL(newOrbCorrections(QList<t_orbCorr>)),
173 this, SLOT(slotNewOrbCorrections(QList<t_orbCorr>)));
174
175 connect(BNC_CORE, SIGNAL(newClkCorrections(QList<t_clkCorr>)),
176 this, SLOT(slotNewClkCorrections(QList<t_clkCorr>)));
177
[3470]178 // Combination Method
179 // ------------------
[3481]180 if (settings.value("cmbMethod").toString() == "Single-Epoch") {
181 _method = singleEpoch;
[3470]182 }
183 else {
[3481]184 _method = filter;
[3470]185 }
[3032]186
[3484]187 // Use Glonass
188 // -----------
[6174]189 if ( Qt::CheckState(settings.value("cmbUseGlonass").toInt()) == Qt::Checked) {
[3484]190 _useGlonass = true;
191 }
192 else {
193 _useGlonass = false;
194 }
195
[3032]196 // Initialize Parameters (model: Clk_Corr = AC_Offset + Sat_Offset + Clk)
197 // ----------------------------------------------------------------------
[3470]198 if (_method == filter) {
199 int nextPar = 0;
200 QListIterator<cmbAC*> it(_ACs);
201 while (it.hasNext()) {
202 cmbAC* AC = it.next();
[3485]203 _params.push_back(new cmbParam(cmbParam::offACgps, ++nextPar, AC->name, ""));
[5808]204 for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
[7008]205 QString prn = QString("G%1_0").arg(iGps, 2, 10, QChar('0'));
[7297]206 _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar,
[3470]207 AC->name, prn));
208 }
[3483]209 if (_useGlonass) {
[3485]210 _params.push_back(new cmbParam(cmbParam::offACglo, ++nextPar, AC->name, ""));
[5808]211 for (unsigned iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
[7008]212 QString prn = QString("R%1_0").arg(iGlo, 2, 10, QChar('0'));
[7297]213 _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar,
[3483]214 AC->name, prn));
215 }
216 }
[3470]217 }
[5808]218 for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
[7008]219 QString prn = QString("G%1_0").arg(iGps, 2, 10, QChar('0'));
[3470]220 _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
[2991]221 }
[3483]222 if (_useGlonass) {
[5808]223 for (unsigned iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
[7008]224 QString prn = QString("R%1_0").arg(iGlo, 2, 10, QChar('0'));
[3483]225 _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
226 }
227 }
[7297]228
[3470]229 // Initialize Variance-Covariance Matrix
230 // -------------------------------------
231 _QQ.ReSize(_params.size());
232 _QQ = 0.0;
233 for (int iPar = 1; iPar <= _params.size(); iPar++) {
234 cmbParam* pp = _params[iPar-1];
235 _QQ(iPar,iPar) = pp->sig0 * pp->sig0;
236 }
[2991]237 }
[2933]238
[3052]239 // ANTEX File
240 // ----------
241 _antex = 0;
[6667]242 QString antexFileName = settings.value("uploadAntexFile").toString();
[3052]243 if (!antexFileName.isEmpty()) {
244 _antex = new bncAntex();
245 if (_antex->readFile(antexFileName) != success) {
246 emit newMessage("wrong ANTEX file", true);
247 delete _antex;
248 _antex = 0;
249 }
250 }
[3138]251
[3329]252 // Maximal Residuum
253 // ----------------
254 _MAXRES = settings.value("cmbMaxres").toDouble();
255 if (_MAXRES <= 0.0) {
256 _MAXRES = 999.0;
257 }
[2898]258}
259
260// Destructor
261////////////////////////////////////////////////////////////////////////////
262bncComb::~bncComb() {
[3429]263 QListIterator<cmbAC*> icAC(_ACs);
264 while (icAC.hasNext()) {
265 delete icAC.next();
[2918]266 }
[3201]267 delete _rtnetDecoder;
[3052]268 delete _antex;
[3296]269 for (int iPar = 1; iPar <= _params.size(); iPar++) {
270 delete _params[iPar-1];
271 }
[3556]272 QListIterator<bncTime> itTime(_buffer.keys());
[3551]273 while (itTime.hasNext()) {
[3556]274 bncTime epoTime = itTime.next();
275 _buffer.remove(epoTime);
[3429]276 }
[2898]277}
278
[6155]279// Remember orbit corrections
[2898]280////////////////////////////////////////////////////////////////////////////
[6155]281void bncComb::slotNewOrbCorrections(QList<t_orbCorr> orbCorrections) {
[2906]282 QMutexLocker locker(&_mutex);
[2913]283
[6155]284 for (int ii = 0; ii < orbCorrections.size(); ii++) {
285 t_orbCorr& orbCorr = orbCorrections[ii];
286 QString staID(orbCorr._staID.c_str());
[7008]287 QString prn(orbCorr._prn.toInternalString().c_str());
[6155]288
289 // Find/Check the AC Name
290 // ----------------------
291 QString acName;
292 QListIterator<cmbAC*> icAC(_ACs);
293 while (icAC.hasNext()) {
294 cmbAC* AC = icAC.next();
295 if (AC->mountPoint == staID) {
296 acName = AC->name;
297 break;
298 }
[3431]299 }
[6155]300 if (acName.isEmpty()) {
301 continue;
302 }
[3431]303
[6155]304 // Store the correction
305 // --------------------
306 QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName];
307 storage[orbCorr._prn] = orbCorr;
[2913]308 }
[6155]309}
[2913]310
[6155]311// Process clock corrections
312////////////////////////////////////////////////////////////////////////////
313void bncComb::slotNewClkCorrections(QList<t_clkCorr> clkCorrections) {
314 QMutexLocker locker(&_mutex);
315
316 bncTime lastTime;
317
318 for (int ii = 0; ii < clkCorrections.size(); ii++) {
319 t_clkCorr& clkCorr = clkCorrections[ii];
320 QString staID(clkCorr._staID.c_str());
[6961]321 QString prn(clkCorr._prn.toInternalString().c_str());
[6155]322
323 // Set the last time
324 // -----------------
325 if (lastTime.undef() || clkCorr._time > lastTime) {
326 lastTime = clkCorr._time;
[3483]327 }
328
[6155]329 // Find/Check the AC Name
330 // ----------------------
331 QString acName;
332 QListIterator<cmbAC*> icAC(_ACs);
333 while (icAC.hasNext()) {
334 cmbAC* AC = icAC.next();
335 if (AC->mountPoint == staID) {
336 acName = AC->name;
337 break;
338 }
[3588]339 }
[6155]340 if (acName.isEmpty()) {
341 continue;
342 }
[3588]343
[6155]344 // Check GLONASS
345 // -------------
346 if (!_useGlonass && clkCorr._prn.system() == 'R') {
347 continue;
[3590]348 }
349
[8175]350 if (
351 clkCorr._prn.system() == 'E' ||
352 clkCorr._prn.system() == 'C' ||
353 clkCorr._prn.system() == 'J' ||
354 clkCorr._prn.system() == 'I' ||
355 clkCorr._prn.system() == 'S' ) {
356 continue;
357 }
358
[6155]359 // Check Modulo Time
360 // -----------------
361 if (int(clkCorr._time.gpssec()) % _cmbSampl != 0.0) {
362 continue;
363 }
[3274]364
[6155]365 // Check Correction Age
366 // --------------------
367 if (_resTime.valid() && clkCorr._time <= _resTime) {
[8204]368 emit newMessage("bncComb: old correction: " + acName.toLatin1() + " " + prn.mid(0,3).toLatin1(), true);
[6155]369 continue;
370 }
[7297]371
[6155]372 // Create new correction
373 // ---------------------
374 cmbCorr* newCorr = new cmbCorr();
[6157]375 newCorr->_prn = prn;
[6155]376 newCorr->_time = clkCorr._time;
377 newCorr->_iod = clkCorr._iod;
378 newCorr->_acName = acName;
[6159]379 newCorr->_clkCorr = clkCorr;
[6155]380
[6156]381 // Check orbit correction
382 // ----------------------
383 if (!_orbCorrections.contains(acName)) {
384 delete newCorr;
385 continue;
386 }
387 else {
388 QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName];
389 if (!storage.contains(clkCorr._prn) || storage[clkCorr._prn]._iod != newCorr->_iod) {
390 delete newCorr;
391 continue;
392 }
393 else {
[6159]394 newCorr->_orbCorr = storage[clkCorr._prn];
[6156]395 }
396 }
397
[6155]398 // Check the Ephemeris
399 //--------------------
[7012]400 t_eph* ephLast = _ephUser.ephLast(prn);
401 t_eph* ephPrev = _ephUser.ephPrev(prn);
[6443]402 if (ephLast == 0) {
[8204]403 emit newMessage("bncComb: eph not found " + prn.mid(0,3).toLatin1(), true);
[6155]404 delete newCorr;
405 continue;
[2986]406 }
[3029]407 else {
[6443]408 if (ephLast->IOD() == newCorr->_iod) {
409 newCorr->_eph = ephLast;
[6155]410 }
[6443]411 else if (ephPrev && ephPrev->IOD() == newCorr->_iod) {
412 newCorr->_eph = ephPrev;
413 switchToLastEph(ephLast, newCorr);
[6155]414 }
415 else {
[8204]416 emit newMessage("bncComb: eph not found " + prn.mid(0,3).toLatin1() +
417 QString(" %1").arg(newCorr->_iod).toLatin1(), true);
[6155]418 delete newCorr;
419 continue;
420 }
[2986]421 }
[6155]422
423 // Store correction into the buffer
424 // --------------------------------
425 QVector<cmbCorr*>& corrs = _buffer[newCorr->_time].corrs;
426 corrs.push_back(newCorr);
[2986]427 }
428
[3435]429 // Process previous Epoch(s)
430 // -------------------------
[7392]431 const double outWait = 1.0 * _cmbSampl;
[3556]432 QListIterator<bncTime> itTime(_buffer.keys());
[3435]433 while (itTime.hasNext()) {
[3556]434 bncTime epoTime = itTime.next();
[7392]435 if (epoTime < lastTime - outWait) {
[3556]436 _resTime = epoTime;
[3435]437 processEpoch();
438 }
[2927]439 }
[2898]440}
441
[7297]442// Change the correction so that it refers to last received ephemeris
[2986]443////////////////////////////////////////////////////////////////////////////
[7012]444void bncComb::switchToLastEph(t_eph* lastEph, cmbCorr* corr) {
[3028]445
[6155]446 if (corr->_eph == lastEph) {
[3429]447 return;
448 }
449
[2987]450 ColumnVector oldXC(4);
451 ColumnVector oldVV(3);
[6155]452 corr->_eph->getCrd(corr->_time, oldXC, oldVV, false);
[2988]453
[2987]454 ColumnVector newXC(4);
455 ColumnVector newVV(3);
[6155]456 lastEph->getCrd(corr->_time, newXC, newVV, false);
[2988]457
458 ColumnVector dX = newXC.Rows(1,3) - oldXC.Rows(1,3);
[2989]459 ColumnVector dV = newVV - oldVV;
460 double dC = newXC(4) - oldXC(4);
461
[2988]462 ColumnVector dRAO(3);
463 XYZ_to_RSW(newXC.Rows(1,3), newVV, dX, dRAO);
[2989]464
465 ColumnVector dDotRAO(3);
466 XYZ_to_RSW(newXC.Rows(1,3), newVV, dV, dDotRAO);
467
[6963]468 QString msg = "switch corr " + corr->_prn.mid(0,3)
[6155]469 + QString(" %1 -> %2 %3").arg(corr->_iod,3).arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4);
[3013]470
[8204]471 emit newMessage(msg.toLatin1(), false);
[3028]472
[6155]473 corr->_iod = lastEph->IOD();
474 corr->_eph = lastEph;
475
[6159]476 corr->_orbCorr._xr += dRAO;
477 corr->_orbCorr._dotXr += dDotRAO;
478 corr->_clkCorr._dClk -= dC;
[2986]479}
480
[3429]481// Process Epoch
[2928]482////////////////////////////////////////////////////////////////////////////
[3429]483void bncComb::processEpoch() {
[2918]484
[2990]485 _log.clear();
486
487 QTextStream out(&_log, QIODevice::WriteOnly);
488
[7297]489 out << endl << "Combination:" << endl
[3472]490 << "------------------------------" << endl;
[2990]491
[3433]492 // Observation Statistics
493 // ----------------------
[3455]494 bool masterPresent = false;
[3433]495 QListIterator<cmbAC*> icAC(_ACs);
496 while (icAC.hasNext()) {
497 cmbAC* AC = icAC.next();
498 AC->numObs = 0;
[3434]499 QVectorIterator<cmbCorr*> itCorr(corrs());
[3433]500 while (itCorr.hasNext()) {
501 cmbCorr* corr = itCorr.next();
[6157]502 if (corr->_acName == AC->name) {
[3433]503 AC->numObs += 1;
[3453]504 if (AC->name == _masterOrbitAC) {
505 masterPresent = true;
506 }
[3433]507 }
508 }
[8204]509 out << AC->name.toLatin1().data() << ": " << AC->numObs << endl;
[3433]510 }
511
[3453]512 // If Master not present, switch to another one
513 // --------------------------------------------
[4889]514 const unsigned switchMasterAfterGap = 1;
[3456]515 if (masterPresent) {
516 _masterMissingEpochs = 0;
517 }
518 else {
[3455]519 ++_masterMissingEpochs;
[4889]520 if (_masterMissingEpochs < switchMasterAfterGap) {
[3457]521 out << "Missing Master, Epoch skipped" << endl;
[3556]522 _buffer.remove(_resTime);
[3455]523 emit newMessage(_log, false);
524 return;
[3453]525 }
[3455]526 else {
527 _masterMissingEpochs = 0;
528 QListIterator<cmbAC*> icAC(_ACs);
529 while (icAC.hasNext()) {
530 cmbAC* AC = icAC.next();
531 if (AC->numObs > 0) {
532 out << "Switching Master AC "
[8204]533 << _masterOrbitAC.toLatin1().data() << " --> "
534 << AC->name.toLatin1().data() << " "
[7297]535 << _resTime.datestr().c_str() << " "
[3455]536 << _resTime.timestr().c_str() << endl;
537 _masterOrbitAC = AC->name;
538 break;
539 }
[3452]540 }
541 }
542 }
543
[6157]544 QMap<QString, cmbCorr*> resCorr;
[3472]545
546 // Perform the actual Combination using selected Method
547 // ----------------------------------------------------
548 t_irc irc;
[3475]549 ColumnVector dx;
[3472]550 if (_method == filter) {
[3475]551 irc = processEpoch_filter(out, resCorr, dx);
[3472]552 }
553 else {
[3475]554 irc = processEpoch_singleEpoch(out, resCorr, dx);
[3472]555 }
556
[3475]557 // Update Parameter Values, Print Results
558 // --------------------------------------
[3472]559 if (irc == success) {
[3475]560 for (int iPar = 1; iPar <= _params.size(); iPar++) {
561 cmbParam* pp = _params[iPar-1];
562 pp->xx += dx(iPar);
563 if (pp->type == cmbParam::clkSat) {
564 if (resCorr.find(pp->prn) != resCorr.end()) {
[6160]565 resCorr[pp->prn]->_dClkResult = pp->xx / t_CST::c;
[3475]566 }
567 }
[7297]568 out << _resTime.datestr().c_str() << " "
[3475]569 << _resTime.timestr().c_str() << " ";
570 out.setRealNumberNotation(QTextStream::FixedNotation);
571 out.setFieldWidth(8);
572 out.setRealNumberPrecision(4);
573 out << pp->toString() << " "
574 << pp->xx << " +- " << sqrt(_QQ(pp->index,pp->index)) << endl;
575 out.setFieldWidth(0);
576 }
[3472]577 printResults(out, resCorr);
578 dumpResults(resCorr);
579 }
580
581 // Delete Data, emit Message
582 // -------------------------
[3556]583 _buffer.remove(_resTime);
[3472]584 emit newMessage(_log, false);
585}
586
587// Process Epoch - Filter Method
588////////////////////////////////////////////////////////////////////////////
589t_irc bncComb::processEpoch_filter(QTextStream& out,
[6157]590 QMap<QString, cmbCorr*>& resCorr,
[3475]591 ColumnVector& dx) {
[3472]592
[3429]593 // Prediction Step
594 // ---------------
[3472]595 int nPar = _params.size();
[2933]596 ColumnVector x0(nPar);
597 for (int iPar = 1; iPar <= _params.size(); iPar++) {
[3455]598 cmbParam* pp = _params[iPar-1];
599 if (pp->epoSpec) {
[3451]600 pp->xx = 0.0;
[3455]601 _QQ.Row(iPar) = 0.0;
602 _QQ.Column(iPar) = 0.0;
603 _QQ(iPar,iPar) = pp->sig0 * pp->sig0;
[3451]604 }
[3455]605 else {
606 _QQ(iPar,iPar) += pp->sigP * pp->sigP;
607 }
[2933]608 x0(iPar) = pp->xx;
609 }
610
[3487]611 // Check Satellite Positions for Outliers
612 // --------------------------------------
[3497]613 if (checkOrbits(out) != success) {
[3487]614 return failure;
615 }
[3441]616
[3455]617 // Update and outlier detection loop
618 // ---------------------------------
[3487]619 SymmetricMatrix QQ_sav = _QQ;
[3455]620 while (true) {
[3135]621
[3455]622 Matrix AA;
623 ColumnVector ll;
624 DiagonalMatrix PP;
[3429]625
[3455]626 if (createAmat(AA, ll, PP, x0, resCorr) != success) {
[3472]627 return failure;
[3441]628 }
[2933]629
[6169]630 dx.ReSize(nPar); dx = 0.0;
[5808]631 kalman(AA, ll, PP, _QQ, dx);
[6164]632
[3429]633 ColumnVector vv = ll - AA * dx;
[3080]634
[3429]635 int maxResIndex;
[7297]636 double maxRes = vv.maximum_absolute_value1(maxResIndex);
[3429]637 out.setRealNumberNotation(QTextStream::FixedNotation);
[7297]638 out.setRealNumberPrecision(3);
[3429]639 out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
[3432]640 << " Maximum Residuum " << maxRes << ' '
[6962]641 << corrs()[maxResIndex-1]->_acName << ' ' << corrs()[maxResIndex-1]->_prn.mid(0,3);
[3432]642 if (maxRes > _MAXRES) {
643 for (int iPar = 1; iPar <= _params.size(); iPar++) {
644 cmbParam* pp = _params[iPar-1];
[7297]645 if (pp->type == cmbParam::offACSat &&
[6157]646 pp->AC == corrs()[maxResIndex-1]->_acName &&
[6962]647 pp->prn == corrs()[maxResIndex-1]->_prn.mid(0,3)) {
[3432]648 QQ_sav.Row(iPar) = 0.0;
649 QQ_sav.Column(iPar) = 0.0;
[3455]650 QQ_sav(iPar,iPar) = pp->sig0 * pp->sig0;
[3432]651 }
652 }
653
654 out << " Outlier" << endl;
655 _QQ = QQ_sav;
[3455]656 corrs().remove(maxResIndex-1);
[3432]657 }
658 else {
659 out << " OK" << endl;
[6330]660 out.setRealNumberNotation(QTextStream::FixedNotation);
661 out.setRealNumberPrecision(4);
662 for (int ii = 0; ii < corrs().size(); ii++) {
[8065]663 const cmbCorr* corr = corrs()[ii];
[6330]664 out << _resTime.datestr().c_str() << ' '
665 << _resTime.timestr().c_str() << " "
[6962]666 << corr->_acName << ' ' << corr->_prn.mid(0,3);
[6330]667 out.setFieldWidth(10);
668 out << " res = " << vv[ii] << endl;
669 out.setFieldWidth(0);
670 }
[3432]671 break;
672 }
673 }
674
[3472]675 return success;
[2918]676}
[3011]677
[3201]678// Print results
[3011]679////////////////////////////////////////////////////////////////////////////
[3429]680void bncComb::printResults(QTextStream& out,
[6157]681 const QMap<QString, cmbCorr*>& resCorr) {
[3011]682
[6157]683 QMapIterator<QString, cmbCorr*> it(resCorr);
[3011]684 while (it.hasNext()) {
685 it.next();
[6157]686 cmbCorr* corr = it.value();
687 const t_eph* eph = corr->_eph;
[3015]688 if (eph) {
[6109]689 ColumnVector xc(4);
690 ColumnVector vv(3);
691 eph->getCrd(_resTime, xc, vv, false);
[3015]692
[7297]693 out << _resTime.datestr().c_str() << " "
[3429]694 << _resTime.timestr().c_str() << " ";
[3015]695 out.setFieldWidth(3);
[6962]696 out << "Full Clock " << corr->_prn.mid(0,3) << " " << corr->_iod << " ";
[3015]697 out.setFieldWidth(14);
[6160]698 out << (xc(4) + corr->_dClkResult) * t_CST::c << endl;
[3370]699 out.setFieldWidth(0);
[3015]700 }
701 else {
702 out << "bncComb::printResuls bug" << endl;
703 }
[3011]704 }
705}
[3202]706
707// Send results to RTNet Decoder and directly to PPP Client
708////////////////////////////////////////////////////////////////////////////
[6157]709void bncComb::dumpResults(const QMap<QString, cmbCorr*>& resCorr) {
[3202]710
[6161]711 QList<t_orbCorr> orbCorrections;
712 QList<t_clkCorr> clkCorrections;
713
[5337]714 QString outLines;
715 QStringList corrLines;
[3214]716
717 unsigned year, month, day, hour, minute;
718 double sec;
[3429]719 _resTime.civil_date(year, month, day);
720 _resTime.civil_time(hour, minute, sec);
[3214]721
[7297]722 outLines.sprintf("* %4d %2d %2d %d %d %12.8f\n",
[5337]723 year, month, day, hour, minute, sec);
[3214]724
[6157]725 QMapIterator<QString, cmbCorr*> it(resCorr);
[3202]726 while (it.hasNext()) {
727 it.next();
[6157]728 cmbCorr* corr = it.value();
[3202]729
[7013]730 t_orbCorr orbCorr(corr->_orbCorr);
731 orbCorr._staID = "INTERNAL";
732 orbCorrections.push_back(orbCorr);
733
734 t_clkCorr clkCorr(corr->_clkCorr);
735 clkCorr._staID = "INTERNAL";
736 clkCorr._dClk = corr->_dClkResult;
737 clkCorr._dotDClk = 0.0;
738 clkCorr._dotDotDClk = 0.0;
739 clkCorrections.push_back(clkCorr);
740
[4978]741 ColumnVector xc(4);
742 ColumnVector vv(3);
[7013]743 corr->_eph->setClkCorr(dynamic_cast<const t_clkCorr*>(&clkCorr));
744 corr->_eph->setOrbCorr(dynamic_cast<const t_orbCorr*>(&orbCorr));
[7012]745 corr->_eph->getCrd(_resTime, xc, vv, true);
746
[4978]747 // Correction Phase Center --> CoM
748 // -------------------------------
749 ColumnVector dx(3); dx = 0.0;
750 if (_antex) {
751 double Mjd = _resTime.mjd() + _resTime.daysec()/86400.0;
[6157]752 if (_antex->satCoMcorrection(corr->_prn, Mjd, xc.Rows(1,3), dx) != success) {
[4992]753 dx = 0;
[8204]754 _log += "antenna not found " + corr->_prn.mid(0,3).toLatin1() + '\n';
[3214]755 }
756 }
[7012]757
758 outLines += corr->_prn.mid(0,3);
[5337]759 QString hlp;
760 hlp.sprintf(" APC 3 %15.4f %15.4f %15.4f"
761 " Clk 1 %15.4f"
762 " Vel 3 %15.4f %15.4f %15.4f"
763 " CoM 3 %15.4f %15.4f %15.4f\n",
[7012]764 xc(1), xc(2), xc(3),
765 xc(4) * t_CST::c,
[5337]766 vv(1), vv(2), vv(3),
767 xc(1)-dx(1), xc(2)-dx(2), xc(3)-dx(3));
768 outLines += hlp;
769
[4978]770 QString line;
[5564]771 int messageType = COTYPE_GPSCOMBINED;
772 int updateInt = 0;
[4978]773 line.sprintf("%d %d %d %.1f %s"
[7055]774 " %lu"
[4978]775 " %8.3f %8.3f %8.3f %8.3f"
776 " %10.5f %10.5f %10.5f %10.5f"
[5576]777 " %10.5f INTERNAL",
[4978]778 messageType, updateInt, _resTime.gpsw(), _resTime.gpssec(),
[8204]779 corr->_prn.mid(0,3).toLatin1().data(),
[6157]780 corr->_iod,
[6160]781 corr->_dClkResult * t_CST::c,
[6159]782 corr->_orbCorr._xr[0],
783 corr->_orbCorr._xr[1],
784 corr->_orbCorr._xr[2],
[6157]785 0.0,
[6159]786 corr->_orbCorr._dotXr[0],
787 corr->_orbCorr._dotXr[1],
788 corr->_orbCorr._dotXr[2],
[6157]789 0.0);
[4978]790 corrLines << line;
791
[3214]792 delete corr;
793 }
794
[5337]795 outLines += "EOE\n"; // End Of Epoch flag
796
[3215]797 if (!_rtnetDecoder) {
798 _rtnetDecoder = new bncRtnetDecoder();
799 }
[3221]800
[3215]801 vector<string> errmsg;
[8204]802 _rtnetDecoder->Decode(outLines.toLatin1().data(), outLines.length(), errmsg);
[3215]803
[5861]804 // Send new Corrections to PPP etc.
805 // --------------------------------
[6161]806 if (orbCorrections.size() > 0 && clkCorrections.size() > 0) {
807 emit newOrbCorrections(orbCorrections);
808 emit newClkCorrections(clkCorrections);
809 }
[3202]810}
[3455]811
812// Create First Design Matrix and Vector of Measurements
813////////////////////////////////////////////////////////////////////////////
814t_irc bncComb::createAmat(Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP,
[7297]815 const ColumnVector& x0,
[6157]816 QMap<QString, cmbCorr*>& resCorr) {
[3455]817
818 unsigned nPar = _params.size();
[7297]819 unsigned nObs = corrs().size();
[3455]820
821 if (nObs == 0) {
822 return failure;
823 }
824
[5742]825 int maxSat = t_prn::MAXPRN_GPS;
[3486]826// if (_useGlonass) {
[5742]827// maxSat = t_prn::MAXPRN_GPS + t_prn::MAXPRN_GLONASS;
[3486]828// }
[3455]829
[5742]830 const int nCon = (_method == filter) ? 1 + maxSat : 0;
[3483]831
[3455]832 AA.ReSize(nObs+nCon, nPar); AA = 0.0;
833 ll.ReSize(nObs+nCon); ll = 0.0;
834 PP.ReSize(nObs+nCon); PP = 1.0 / (sigObs * sigObs);
835
836 int iObs = 0;
837 QVectorIterator<cmbCorr*> itCorr(corrs());
838 while (itCorr.hasNext()) {
839 cmbCorr* corr = itCorr.next();
[6157]840 QString prn = corr->_prn;
[3487]841
[3455]842 ++iObs;
843
[6157]844 if (corr->_acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {
845 resCorr[prn] = new cmbCorr(*corr);
[3455]846 }
847
848 for (int iPar = 1; iPar <= _params.size(); iPar++) {
849 cmbParam* pp = _params[iPar-1];
[6157]850 AA(iObs, iPar) = pp->partial(corr->_acName, prn);
[3455]851 }
852
[6160]853 ll(iObs) = corr->_clkCorr._dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
[3455]854 }
855
856 // Regularization
857 // --------------
[3474]858 if (_method == filter) {
859 const double Ph = 1.e6;
860 PP(nObs+1) = Ph;
[3461]861 for (int iPar = 1; iPar <= _params.size(); iPar++) {
862 cmbParam* pp = _params[iPar-1];
[3465]863 if ( AA.Column(iPar).maximum_absolute_value() > 0.0 &&
[3474]864 pp->type == cmbParam::clkSat ) {
865 AA(nObs+1, iPar) = 1.0;
[3455]866 }
867 }
[3474]868 int iCond = 1;
[5808]869 for (unsigned iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
[7132]870 QString prn = QString("G%1_0").arg(iGps, 2, 10, QChar('0'));
[3474]871 ++iCond;
872 PP(nObs+iCond) = Ph;
873 for (int iPar = 1; iPar <= _params.size(); iPar++) {
874 cmbParam* pp = _params[iPar-1];
[7299]875 if ( pp &&
876 AA.Column(iPar).maximum_absolute_value() > 0.0 &&
[7297]877 pp->type == cmbParam::offACSat &&
[3474]878 pp->prn == prn) {
879 AA(nObs+iCond, iPar) = 1.0;
880 }
881 }
882 }
[3486]883// if (_useGlonass) {
[5742]884// for (int iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
[7132]885// QString prn = QString("R%1_0").arg(iGlo, 2, 10, QChar('0'));
[3486]886// ++iCond;
887// PP(nObs+iCond) = Ph;
888// for (int iPar = 1; iPar <= _params.size(); iPar++) {
889// cmbParam* pp = _params[iPar-1];
[7299]890// if ( pp &&
891// AA.Column(iPar).maximum_absolute_value() > 0.0 &&
[7297]892// pp->type == cmbParam::offACSat &&
[3486]893// pp->prn == prn) {
894// AA(nObs+iCond, iPar) = 1.0;
895// }
896// }
897// }
898// }
[3455]899 }
900
901 return success;
902}
[3470]903
904// Process Epoch - Single-Epoch Method
905////////////////////////////////////////////////////////////////////////////
[3472]906t_irc bncComb::processEpoch_singleEpoch(QTextStream& out,
[6157]907 QMap<QString, cmbCorr*>& resCorr,
[3475]908 ColumnVector& dx) {
[3470]909
[3487]910 // Check Satellite Positions for Outliers
911 // --------------------------------------
[3497]912 if (checkOrbits(out) != success) {
[3487]913 return failure;
914 }
915
[3482]916 // Outlier Detection Loop
917 // ----------------------
918 while (true) {
[7297]919
[3482]920 // Remove Satellites that are not in Master
921 // ----------------------------------------
922 QMutableVectorIterator<cmbCorr*> it(corrs());
923 while (it.hasNext()) {
924 cmbCorr* corr = it.next();
[6157]925 QString prn = corr->_prn;
[3482]926 bool foundMaster = false;
927 QVectorIterator<cmbCorr*> itHlp(corrs());
928 while (itHlp.hasNext()) {
929 cmbCorr* corrHlp = itHlp.next();
[6157]930 QString prnHlp = corrHlp->_prn;
931 QString ACHlp = corrHlp->_acName;
[3482]932 if (ACHlp == _masterOrbitAC && prn == prnHlp) {
933 foundMaster = true;
934 break;
935 }
[3476]936 }
[3482]937 if (!foundMaster) {
[3556]938 delete corr;
[3482]939 it.remove();
940 }
[3473]941 }
[7297]942
[3482]943 // Count Number of Observations per Satellite and per AC
944 // -----------------------------------------------------
945 QMap<QString, int> numObsPrn;
946 QMap<QString, int> numObsAC;
947 QVectorIterator<cmbCorr*> itCorr(corrs());
948 while (itCorr.hasNext()) {
949 cmbCorr* corr = itCorr.next();
[6157]950 QString prn = corr->_prn;
951 QString AC = corr->_acName;
[3482]952 if (numObsPrn.find(prn) == numObsPrn.end()) {
953 numObsPrn[prn] = 1;
954 }
955 else {
956 numObsPrn[prn] += 1;
957 }
958 if (numObsAC.find(AC) == numObsAC.end()) {
959 numObsAC[AC] = 1;
960 }
961 else {
962 numObsAC[AC] += 1;
963 }
[3476]964 }
[7297]965
[3482]966 // Clean-Up the Paramters
967 // ----------------------
968 for (int iPar = 1; iPar <= _params.size(); iPar++) {
969 delete _params[iPar-1];
[3474]970 }
[3482]971 _params.clear();
[7297]972
[3482]973 // Set new Parameters
974 // ------------------
975 int nextPar = 0;
[7297]976
[3482]977 QMapIterator<QString, int> itAC(numObsAC);
978 while (itAC.hasNext()) {
979 itAC.next();
980 const QString& AC = itAC.key();
981 int numObs = itAC.value();
982 if (AC != _masterOrbitAC && numObs > 0) {
[3485]983 _params.push_back(new cmbParam(cmbParam::offACgps, ++nextPar, AC, ""));
984 if (_useGlonass) {
985 _params.push_back(new cmbParam(cmbParam::offACglo, ++nextPar, AC, ""));
986 }
[3482]987 }
[7297]988 }
989
[3482]990 QMapIterator<QString, int> itPrn(numObsPrn);
991 while (itPrn.hasNext()) {
992 itPrn.next();
993 const QString& prn = itPrn.key();
994 int numObs = itPrn.value();
995 if (numObs > 0) {
996 _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
997 }
[7297]998 }
999
[3482]1000 int nPar = _params.size();
[7297]1001 ColumnVector x0(nPar);
[3482]1002 x0 = 0.0;
[7297]1003
[3482]1004 // Create First-Design Matrix
1005 // --------------------------
1006 Matrix AA;
1007 ColumnVector ll;
1008 DiagonalMatrix PP;
1009 if (createAmat(AA, ll, PP, x0, resCorr) != success) {
1010 return failure;
[3476]1011 }
[7297]1012
[3482]1013 ColumnVector vv;
1014 try {
1015 Matrix ATP = AA.t() * PP;
1016 SymmetricMatrix NN; NN << ATP * AA;
1017 ColumnVector bb = ATP * ll;
1018 _QQ = NN.i();
1019 dx = _QQ * bb;
1020 vv = ll - AA * dx;
[3476]1021 }
[3482]1022 catch (Exception& exc) {
1023 out << exc.what() << endl;
1024 return failure;
[3476]1025 }
[3474]1026
[3482]1027 int maxResIndex;
[7297]1028 double maxRes = vv.maximum_absolute_value1(maxResIndex);
[3482]1029 out.setRealNumberNotation(QTextStream::FixedNotation);
[7297]1030 out.setRealNumberPrecision(3);
[3482]1031 out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
1032 << " Maximum Residuum " << maxRes << ' '
[7715]1033 << corrs()[maxResIndex-1]->_acName << ' ' << corrs()[maxResIndex-1]->_prn.mid(0,3);
[3474]1034
[3482]1035 if (maxRes > _MAXRES) {
1036 out << " Outlier" << endl;
[3556]1037 delete corrs()[maxResIndex-1];
[3482]1038 corrs().remove(maxResIndex-1);
[3474]1039 }
[3482]1040 else {
1041 out << " OK" << endl;
1042 out.setRealNumberNotation(QTextStream::FixedNotation);
[7297]1043 out.setRealNumberPrecision(3);
[3482]1044 for (int ii = 0; ii < vv.Nrows(); ii++) {
1045 const cmbCorr* corr = corrs()[ii];
[7297]1046 out << _resTime.datestr().c_str() << ' '
[3482]1047 << _resTime.timestr().c_str() << " "
[6962]1048 << corr->_acName << ' ' << corr->_prn.mid(0,3);
[3482]1049 out.setFieldWidth(6);
[6330]1050 out << " res = " << vv[ii] << endl;
[3482]1051 out.setFieldWidth(0);
1052 }
1053 return success;
[3474]1054 }
1055
[3473]1056 }
[3474]1057
[3482]1058 return failure;
[3470]1059}
[3487]1060
1061// Check Satellite Positions for Outliers
1062////////////////////////////////////////////////////////////////////////////
[3497]1063t_irc bncComb::checkOrbits(QTextStream& out) {
[3487]1064
[3489]1065 const double MAX_DISPLACEMENT = 0.20;
[3488]1066
[3502]1067 // Switch to last ephemeris (if possible)
1068 // --------------------------------------
[3501]1069 QMutableVectorIterator<cmbCorr*> im(corrs());
1070 while (im.hasNext()) {
1071 cmbCorr* corr = im.next();
[6157]1072 QString prn = corr->_prn;
[6443]1073
[7012]1074 t_eph* ephLast = _ephUser.ephLast(prn);
1075 t_eph* ephPrev = _ephUser.ephPrev(prn);
[6443]1076
1077 if (ephLast == 0) {
[6962]1078 out << "checkOrbit: missing eph (not found) " << corr->_prn.mid(0,3) << endl;
[3556]1079 delete corr;
[3501]1080 im.remove();
1081 }
[6157]1082 else if (corr->_eph == 0) {
[6962]1083 out << "checkOrbit: missing eph (zero) " << corr->_prn.mid(0,3) << endl;
[3556]1084 delete corr;
[3503]1085 im.remove();
1086 }
[3502]1087 else {
[6443]1088 if ( corr->_eph == ephLast || corr->_eph == ephPrev ) {
1089 switchToLastEph(ephLast, corr);
[3502]1090 }
1091 else {
[6962]1092 out << "checkOrbit: missing eph (deleted) " << corr->_prn.mid(0,3) << endl;
[3556]1093 delete corr;
[3502]1094 im.remove();
1095 }
1096 }
[3501]1097 }
1098
[3488]1099 while (true) {
1100
1101 // Compute Mean Corrections for all Satellites
1102 // -------------------------------------------
[3489]1103 QMap<QString, int> numCorr;
[3488]1104 QMap<QString, ColumnVector> meanRao;
1105 QVectorIterator<cmbCorr*> it(corrs());
1106 while (it.hasNext()) {
1107 cmbCorr* corr = it.next();
[6157]1108 QString prn = corr->_prn;
[3488]1109 if (meanRao.find(prn) == meanRao.end()) {
1110 meanRao[prn].ReSize(4);
[6159]1111 meanRao[prn].Rows(1,3) = corr->_orbCorr._xr;
[7297]1112 meanRao[prn](4) = 1;
[3488]1113 }
1114 else {
[6159]1115 meanRao[prn].Rows(1,3) += corr->_orbCorr._xr;
[7297]1116 meanRao[prn](4) += 1;
[3488]1117 }
[3489]1118 if (numCorr.find(prn) == numCorr.end()) {
1119 numCorr[prn] = 1;
1120 }
1121 else {
1122 numCorr[prn] += 1;
1123 }
[3487]1124 }
[7297]1125
[3488]1126 // Compute Differences wrt Mean, find Maximum
1127 // ------------------------------------------
1128 QMap<QString, cmbCorr*> maxDiff;
1129 it.toFront();
1130 while (it.hasNext()) {
1131 cmbCorr* corr = it.next();
[6157]1132 QString prn = corr->_prn;
[3488]1133 if (meanRao[prn](4) != 0) {
1134 meanRao[prn] /= meanRao[prn](4);
1135 meanRao[prn](4) = 0;
1136 }
[6159]1137 corr->_diffRao = corr->_orbCorr._xr - meanRao[prn].Rows(1,3);
[3488]1138 if (maxDiff.find(prn) == maxDiff.end()) {
1139 maxDiff[prn] = corr;
1140 }
1141 else {
[6157]1142 double normMax = maxDiff[prn]->_diffRao.norm_Frobenius();
1143 double norm = corr->_diffRao.norm_Frobenius();
[3488]1144 if (norm > normMax) {
1145 maxDiff[prn] = corr;
1146 }
[7297]1147 }
[3487]1148 }
[7297]1149
[3655]1150 if (_ACs.size() == 1) {
1151 break;
1152 }
1153
[3488]1154 // Remove Outliers
1155 // ---------------
1156 bool removed = false;
1157 QMutableVectorIterator<cmbCorr*> im(corrs());
1158 while (im.hasNext()) {
1159 cmbCorr* corr = im.next();
[6157]1160 QString prn = corr->_prn;
[3489]1161 if (numCorr[prn] < 2) {
[3556]1162 delete corr;
[3489]1163 im.remove();
1164 }
1165 else if (corr == maxDiff[prn]) {
[6157]1166 double norm = corr->_diffRao.norm_Frobenius();
[3488]1167 if (norm > MAX_DISPLACEMENT) {
[3497]1168 out << _resTime.datestr().c_str() << " "
1169 << _resTime.timestr().c_str() << " "
[7297]1170 << "Orbit Outlier: "
[8204]1171 << corr->_acName.toLatin1().data() << " "
1172 << prn.mid(0,3).toLatin1().data() << " "
[7297]1173 << corr->_iod << " "
[6157]1174 << norm << endl;
[3556]1175 delete corr;
[3488]1176 im.remove();
1177 removed = true;
1178 }
1179 }
[3487]1180 }
[7297]1181
[3488]1182 if (!removed) {
1183 break;
1184 }
[3487]1185 }
1186
1187 return success;
1188}
[3588]1189
[7297]1190//
[3588]1191////////////////////////////////////////////////////////////////////////////
[5583]1192void bncComb::slotProviderIDChanged(QString mountPoint) {
1193 QMutexLocker locker(&_mutex);
1194
[8065]1195 QTextStream out(&_log, QIODevice::WriteOnly);
1196
[5583]1197 // Find the AC Name
1198 // ----------------
1199 QString acName;
1200 QListIterator<cmbAC*> icAC(_ACs);
1201 while (icAC.hasNext()) {
1202 cmbAC* AC = icAC.next();
1203 if (AC->mountPoint == mountPoint) {
1204 acName = AC->name;
[8204]1205 out << "Provider ID changed: AC " << AC->name.toLatin1().data() << " "
[8065]1206 << _resTime.datestr().c_str() << " "
1207 << _resTime.timestr().c_str() << endl;
[5583]1208 break;
1209 }
1210 }
1211 if (acName.isEmpty()) {
1212 return;
1213 }
1214
1215 // Remove all corrections of the corresponding AC
1216 // ----------------------------------------------
1217 QListIterator<bncTime> itTime(_buffer.keys());
1218 while (itTime.hasNext()) {
1219 bncTime epoTime = itTime.next();
1220 QVector<cmbCorr*>& corrVec = _buffer[epoTime].corrs;
[5584]1221 QMutableVectorIterator<cmbCorr*> it(corrVec);
[5583]1222 while (it.hasNext()) {
1223 cmbCorr* corr = it.next();
[6157]1224 if (acName == corr->_acName) {
[5584]1225 delete corr;
1226 it.remove();
[5583]1227 }
1228 }
1229 }
[5585]1230
1231 // Reset Satellite Offsets
1232 // -----------------------
1233 if (_method == filter) {
1234 for (int iPar = 1; iPar <= _params.size(); iPar++) {
1235 cmbParam* pp = _params[iPar-1];
1236 if (pp->AC == acName && pp->type == cmbParam::offACSat) {
1237 pp->xx = 0.0;
1238 _QQ.Row(iPar) = 0.0;
1239 _QQ.Column(iPar) = 0.0;
1240 _QQ(iPar,iPar) = pp->sig0 * pp->sig0;
1241 }
1242 }
1243 }
[5583]1244}
Note: See TracBrowser for help on using the repository browser.