source: ntrip/trunk/BNC/combination/bnccomb.cpp@ 3472

Last change on this file since 3472 was 3472, checked in by mervart, 13 years ago
File size: 21.1 KB
Line 
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 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include <newmatio.h>
18#include <iomanip>
19#include <sstream>
20
21#include "bnccomb.h"
22#include "bncapp.h"
23#include "upload/bncrtnetdecoder.h"
24#include "bncsettings.h"
25#include "bncmodel.h"
26#include "bncutils.h"
27#include "bncpppclient.h"
28#include "bncsp3.h"
29#include "bncantex.h"
30#include "bnctides.h"
31
32const int moduloTime = 10;
33
34const double sig0_offAC = 1000.0;
35const double sig0_offACSat = 100.0;
36const double sigP_offACSat = 0.01;
37const double sig0_clkSat = 100.0;
38
39const double sigObs = 0.05;
40
41const int MAXPRN_GPS = 32;
42
43using namespace std;
44
45// Constructor
46////////////////////////////////////////////////////////////////////////////
47cmbParam::cmbParam(parType type_, int index_,
48 const QString& ac_, const QString& prn_) {
49
50 type = type_;
51 index = index_;
52 AC = ac_;
53 prn = prn_;
54 xx = 0.0;
55 eph = 0;
56
57 if (type == offAC) {
58 epoSpec = true;
59 sig0 = sig0_offAC;
60 sigP = sig0;
61 }
62 else if (type == offACSat) {
63 epoSpec = false;
64 sig0 = sig0_offACSat;
65 sigP = sigP_offACSat;
66 }
67 else if (type == clkSat) {
68 epoSpec = true;
69 sig0 = sig0_clkSat;
70 sigP = sig0;
71 }
72}
73
74// Destructor
75////////////////////////////////////////////////////////////////////////////
76cmbParam::~cmbParam() {
77}
78
79// Partial
80////////////////////////////////////////////////////////////////////////////
81double cmbParam::partial(const QString& AC_, const QString& prn_) {
82
83 if (type == offAC) {
84 if (AC == AC_) {
85 return 1.0;
86 }
87 }
88 else if (type == offACSat) {
89 if (AC == AC_ && prn == prn_) {
90 return 1.0;
91 }
92 }
93 else if (type == clkSat) {
94 if (prn == prn_) {
95 return 1.0;
96 }
97 }
98
99 return 0.0;
100}
101
102//
103////////////////////////////////////////////////////////////////////////////
104QString cmbParam::toString() const {
105
106 QString outStr;
107
108 if (type == offAC) {
109 outStr = "AC offset " + AC;
110 }
111 else if (type == offACSat) {
112 outStr = "Sat Offset " + AC + " " + prn;
113 }
114 else if (type == clkSat) {
115 outStr = "Clk Corr " + prn;
116 }
117
118 return outStr;
119}
120
121// Constructor
122////////////////////////////////////////////////////////////////////////////
123bncComb::bncComb() {
124
125 bncSettings settings;
126
127 QStringList combineStreams = settings.value("combineStreams").toStringList();
128
129 _masterMissingEpochs = 0;
130
131 if (combineStreams.size() >= 1 && !combineStreams[0].isEmpty()) {
132 QListIterator<QString> it(combineStreams);
133 while (it.hasNext()) {
134 QStringList hlp = it.next().split(" ");
135 cmbAC* newAC = new cmbAC();
136 newAC->mountPoint = hlp[0];
137 newAC->name = hlp[1];
138 newAC->weight = hlp[2].toDouble();
139 if (_masterOrbitAC.isEmpty()) {
140 _masterOrbitAC = newAC->name;
141 }
142 _ACs.append(newAC);
143 }
144 }
145
146 _rtnetDecoder = 0;
147
148 connect(this, SIGNAL(newMessage(QByteArray,bool)),
149 ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
150
151 // Combination Method
152 // ------------------
153 if (settings.value("cmbMethod").toString() == "Filter") {
154 _method = filter;
155 }
156 else {
157 _method = singleEpoch;
158 }
159
160 // Initialize Parameters (model: Clk_Corr = AC_Offset + Sat_Offset + Clk)
161 // ----------------------------------------------------------------------
162 if (_method == filter) {
163 int nextPar = 0;
164 QListIterator<cmbAC*> it(_ACs);
165 while (it.hasNext()) {
166 cmbAC* AC = it.next();
167 _params.push_back(new cmbParam(cmbParam::offAC, ++nextPar, AC->name, ""));
168 for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
169 QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
170 _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar,
171 AC->name, prn));
172 }
173 }
174 for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
175 QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
176 _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
177 }
178
179 // Initialize Variance-Covariance Matrix
180 // -------------------------------------
181 _QQ.ReSize(_params.size());
182 _QQ = 0.0;
183 for (int iPar = 1; iPar <= _params.size(); iPar++) {
184 cmbParam* pp = _params[iPar-1];
185 _QQ(iPar,iPar) = pp->sig0 * pp->sig0;
186 }
187 }
188
189 // ANTEX File
190 // ----------
191 _antex = 0;
192 QString antexFileName = settings.value("pppAntex").toString();
193 if (!antexFileName.isEmpty()) {
194 _antex = new bncAntex();
195 if (_antex->readFile(antexFileName) != success) {
196 emit newMessage("wrong ANTEX file", true);
197 delete _antex;
198 _antex = 0;
199 }
200 }
201
202 // Maximal Residuum
203 // ----------------
204 _MAXRES = settings.value("cmbMaxres").toDouble();
205 if (_MAXRES <= 0.0) {
206 _MAXRES = 999.0;
207 }
208}
209
210// Destructor
211////////////////////////////////////////////////////////////////////////////
212bncComb::~bncComb() {
213 QListIterator<cmbAC*> icAC(_ACs);
214 while (icAC.hasNext()) {
215 delete icAC.next();
216 }
217 delete _rtnetDecoder;
218 delete _antex;
219 for (int iPar = 1; iPar <= _params.size(); iPar++) {
220 delete _params[iPar-1];
221 }
222 QVectorIterator<cmbCorr*> itCorr(corrs());
223 while (itCorr.hasNext()) {
224 delete itCorr.next();
225 }
226}
227
228// Read and store one correction line
229////////////////////////////////////////////////////////////////////////////
230void bncComb::processCorrLine(const QString& staID, const QString& line) {
231 QMutexLocker locker(&_mutex);
232
233 // Find the AC Name
234 // ----------------
235 QString acName;
236 QListIterator<cmbAC*> icAC(_ACs);
237 while (icAC.hasNext()) {
238 cmbAC* AC = icAC.next();
239 if (AC->mountPoint == staID) {
240 acName = AC->name;
241 break;
242 }
243 }
244 if (acName.isEmpty()) {
245 return;
246 }
247
248 // Read the Correction
249 // -------------------
250 cmbCorr* newCorr = new cmbCorr();
251 newCorr->acName = acName;
252 if (!newCorr->readLine(line) == success) {
253 delete newCorr;
254 return;
255 }
256
257 // Check Modulo Time
258 // -----------------
259 if (int(newCorr->tt.gpssec()) % moduloTime != 0.0) {
260 delete newCorr;
261 return;
262 }
263
264 // Delete old corrections
265 // ----------------------
266 if (_resTime.valid() && newCorr->tt <= _resTime) {
267 delete newCorr;
268 return;
269 }
270
271 // Check the Ephemeris
272 //--------------------
273 if (_eph.find(newCorr->prn) == _eph.end()) {
274 delete newCorr;
275 return;
276 }
277 else {
278 t_eph* lastEph = _eph[newCorr->prn]->last;
279 t_eph* prevEph = _eph[newCorr->prn]->prev;
280 if (lastEph && lastEph->IOD() == newCorr->iod) {
281 newCorr->eph = lastEph;
282 }
283 else if (prevEph && prevEph->IOD() == newCorr->iod) {
284 newCorr->eph = prevEph;
285 switchToLastEph(lastEph, newCorr);
286 }
287 else {
288 delete newCorr;
289 return;
290 }
291 }
292
293 // Process previous Epoch(s)
294 // -------------------------
295 QListIterator<bncTime> itTime(_buffer.keys());
296 while (itTime.hasNext()) {
297 bncTime epoTime = itTime.next();
298 if (epoTime < newCorr->tt - moduloTime) {
299 _resTime = epoTime;
300 processEpoch();
301 }
302 }
303
304 // Merge or add the correction
305 // ---------------------------
306 QVector<cmbCorr*>& corrs = _buffer[newCorr->tt].corrs;
307 cmbCorr* existingCorr = 0;
308 QVectorIterator<cmbCorr*> itCorr(corrs);
309 while (itCorr.hasNext()) {
310 cmbCorr* hlp = itCorr.next();
311 if (hlp->prn == newCorr->prn && hlp->acName == newCorr->prn) {
312 existingCorr = hlp;
313 break;
314 }
315 }
316 if (existingCorr) {
317 delete newCorr;
318 existingCorr->readLine(line); // merge (multiple messages)
319 }
320 else {
321 corrs.append(newCorr);
322 }
323}
324
325// Change the correction so that it refers to last received ephemeris
326////////////////////////////////////////////////////////////////////////////
327void bncComb::switchToLastEph(const t_eph* lastEph, t_corr* corr) {
328
329 if (corr->eph == lastEph) {
330 return;
331 }
332
333 ColumnVector oldXC(4);
334 ColumnVector oldVV(3);
335 corr->eph->position(corr->tt.gpsw(), corr->tt.gpssec(),
336 oldXC.data(), oldVV.data());
337
338 ColumnVector newXC(4);
339 ColumnVector newVV(3);
340 lastEph->position(corr->tt.gpsw(), corr->tt.gpssec(),
341 newXC.data(), newVV.data());
342
343 ColumnVector dX = newXC.Rows(1,3) - oldXC.Rows(1,3);
344 ColumnVector dV = newVV - oldVV;
345 double dC = newXC(4) - oldXC(4);
346
347 ColumnVector dRAO(3);
348 XYZ_to_RSW(newXC.Rows(1,3), newVV, dX, dRAO);
349
350 ColumnVector dDotRAO(3);
351 XYZ_to_RSW(newXC.Rows(1,3), newVV, dV, dDotRAO);
352
353 QString msg = "switch corr " + corr->prn
354 + QString(" %1 -> %2 %3").arg(corr->iod,3)
355 .arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4);
356
357 emit newMessage(msg.toAscii(), false);
358
359 corr->iod = lastEph->IOD();
360 corr->eph = lastEph;
361 corr->rao += dRAO;
362 corr->dotRao += dDotRAO;
363 corr->dClk -= dC;
364}
365
366// Process Epoch
367////////////////////////////////////////////////////////////////////////////
368void bncComb::processEpoch() {
369
370 _log.clear();
371
372 QTextStream out(&_log, QIODevice::WriteOnly);
373
374 out << endl << "Combination:" << endl
375 << "------------------------------" << endl;
376
377 // Observation Statistics
378 // ----------------------
379 bool masterPresent = false;
380 QListIterator<cmbAC*> icAC(_ACs);
381 while (icAC.hasNext()) {
382 cmbAC* AC = icAC.next();
383 AC->numObs = 0;
384 QVectorIterator<cmbCorr*> itCorr(corrs());
385 while (itCorr.hasNext()) {
386 cmbCorr* corr = itCorr.next();
387 if (corr->acName == AC->name) {
388 AC->numObs += 1;
389 if (AC->name == _masterOrbitAC) {
390 masterPresent = true;
391 }
392 }
393 }
394 out << AC->name.toAscii().data() << ": " << AC->numObs << endl;
395 }
396
397 // If Master not present, switch to another one
398 // --------------------------------------------
399 if (masterPresent) {
400 _masterMissingEpochs = 0;
401 }
402 else {
403 ++_masterMissingEpochs;
404 if (_masterMissingEpochs < 10) {
405 out << "Missing Master, Epoch skipped" << endl;
406 _buffer.remove(_resTime);
407 emit newMessage(_log, false);
408 return;
409 }
410 else {
411 _masterMissingEpochs = 0;
412 QListIterator<cmbAC*> icAC(_ACs);
413 while (icAC.hasNext()) {
414 cmbAC* AC = icAC.next();
415 if (AC->numObs > 0) {
416 out << "Switching Master AC "
417 << _masterOrbitAC.toAscii().data() << " --> "
418 << AC->name.toAscii().data() << " "
419 << _resTime.datestr().c_str() << " "
420 << _resTime.timestr().c_str() << endl;
421 _masterOrbitAC = AC->name;
422 break;
423 }
424 }
425 }
426 }
427
428 QMap<QString, t_corr*> resCorr;
429
430 // Perform the actual Combination using selected Method
431 // ----------------------------------------------------
432 t_irc irc;
433 if (_method == filter) {
434 irc = processEpoch_filter(out, resCorr);
435 }
436 else {
437 irc = processEpoch_singleEpoch(out, resCorr);
438 }
439
440 // Print Results
441 // -------------
442 if (irc == success) {
443 printResults(out, resCorr);
444 dumpResults(resCorr);
445 }
446
447 // Delete Data, emit Message
448 // -------------------------
449 _buffer.remove(_resTime);
450 emit newMessage(_log, false);
451}
452
453// Process Epoch - Filter Method
454////////////////////////////////////////////////////////////////////////////
455t_irc bncComb::processEpoch_filter(QTextStream& out,
456 QMap<QString, t_corr*>& resCorr) {
457
458 // Prediction Step
459 // ---------------
460 int nPar = _params.size();
461 ColumnVector x0(nPar);
462 for (int iPar = 1; iPar <= _params.size(); iPar++) {
463 cmbParam* pp = _params[iPar-1];
464 if (pp->epoSpec) {
465 pp->xx = 0.0;
466 _QQ.Row(iPar) = 0.0;
467 _QQ.Column(iPar) = 0.0;
468 _QQ(iPar,iPar) = pp->sig0 * pp->sig0;
469 }
470 else {
471 _QQ(iPar,iPar) += pp->sigP * pp->sigP;
472 }
473 x0(iPar) = pp->xx;
474 }
475
476 SymmetricMatrix QQ_sav = _QQ;
477
478 ColumnVector dx;
479
480 // Update and outlier detection loop
481 // ---------------------------------
482 while (true) {
483
484 Matrix AA;
485 ColumnVector ll;
486 DiagonalMatrix PP;
487
488 if (createAmat(AA, ll, PP, x0, resCorr) != success) {
489 return failure;
490 }
491
492 bncModel::kalman(AA, ll, PP, _QQ, dx);
493 ColumnVector vv = ll - AA * dx;
494
495 int maxResIndex;
496 double maxRes = vv.maximum_absolute_value1(maxResIndex);
497 out.setRealNumberNotation(QTextStream::FixedNotation);
498 out.setRealNumberPrecision(3);
499 out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
500 << " Maximum Residuum " << maxRes << ' '
501 << corrs()[maxResIndex-1]->acName << ' ' << corrs()[maxResIndex-1]->prn;
502
503 if (maxRes > _MAXRES) {
504 for (int iPar = 1; iPar <= _params.size(); iPar++) {
505 cmbParam* pp = _params[iPar-1];
506 if (pp->type == cmbParam::offACSat &&
507 pp->AC == corrs()[maxResIndex-1]->acName &&
508 pp->prn == corrs()[maxResIndex-1]->prn) {
509 QQ_sav.Row(iPar) = 0.0;
510 QQ_sav.Column(iPar) = 0.0;
511 QQ_sav(iPar,iPar) = pp->sig0 * pp->sig0;
512 }
513 }
514
515 out << " Outlier" << endl;
516 _QQ = QQ_sav;
517 corrs().remove(maxResIndex-1);
518 }
519 else {
520 out << " OK" << endl;
521 break;
522 }
523 }
524
525 // Update Parameter Values
526 // -----------------------
527 for (int iPar = 1; iPar <= _params.size(); iPar++) {
528 cmbParam* pp = _params[iPar-1];
529 pp->xx += dx(iPar);
530 if (pp->type == cmbParam::clkSat) {
531 if (resCorr.find(pp->prn) != resCorr.end()) {
532 resCorr[pp->prn]->dClk = pp->xx / t_CST::c;
533 }
534 }
535 out << _resTime.datestr().c_str() << " "
536 << _resTime.timestr().c_str() << " ";
537 out.setRealNumberNotation(QTextStream::FixedNotation);
538 out.setFieldWidth(8);
539 out.setRealNumberPrecision(4);
540 out << pp->toString() << " "
541 << pp->xx << " +- " << sqrt(_QQ(pp->index,pp->index)) << endl;
542 out.setFieldWidth(0);
543 }
544
545 return success;
546}
547
548// Print results
549////////////////////////////////////////////////////////////////////////////
550void bncComb::printResults(QTextStream& out,
551 const QMap<QString, t_corr*>& resCorr) {
552
553 QMapIterator<QString, t_corr*> it(resCorr);
554 while (it.hasNext()) {
555 it.next();
556 t_corr* corr = it.value();
557 const t_eph* eph = corr->eph;
558 if (eph) {
559 double xx, yy, zz, cc;
560 eph->position(_resTime.gpsw(), _resTime.gpssec(), xx, yy, zz, cc);
561
562 out << _resTime.datestr().c_str() << " "
563 << _resTime.timestr().c_str() << " ";
564 out.setFieldWidth(3);
565 out << "Full Clock " << corr->prn << " " << corr->iod << " ";
566 out.setFieldWidth(14);
567 out << (cc + corr->dClk) * t_CST::c << endl;
568 out.setFieldWidth(0);
569 }
570 else {
571 out << "bncComb::printResuls bug" << endl;
572 }
573 }
574}
575
576// Send results to RTNet Decoder and directly to PPP Client
577////////////////////////////////////////////////////////////////////////////
578void bncComb::dumpResults(const QMap<QString, t_corr*>& resCorr) {
579
580 ostringstream out; out.setf(std::ios::fixed);
581 QStringList corrLines;
582
583 unsigned year, month, day, hour, minute;
584 double sec;
585 _resTime.civil_date(year, month, day);
586 _resTime.civil_time(hour, minute, sec);
587
588 out << "* "
589 << setw(4) << year << " "
590 << setw(2) << month << " "
591 << setw(2) << day << " "
592 << setw(2) << hour << " "
593 << setw(2) << minute << " "
594 << setw(12) << setprecision(8) << sec << " "
595 << endl;
596
597 QMapIterator<QString, t_corr*> it(resCorr);
598 while (it.hasNext()) {
599 it.next();
600 t_corr* corr = it.value();
601
602 double dT = 60.0;
603
604 for (int iTime = 1; iTime <= 2; iTime++) {
605
606 bncTime time12 = (iTime == 1) ? _resTime : _resTime + dT;
607
608 ColumnVector xc(4);
609 ColumnVector vv(3);
610 corr->eph->position(time12.gpsw(), time12.gpssec(),
611 xc.data(), vv.data());
612 bncPPPclient::applyCorr(time12, corr, xc, vv);
613
614 // Relativistic Correction
615 // -----------------------
616 double relCorr = - 2.0 * DotProduct(xc.Rows(1,3),vv) / t_CST::c / t_CST::c;
617 xc(4) -= relCorr;
618
619 // Code Biases
620 // -----------
621 double dcbP1C1 = 0.0;
622 double dcbP1P2 = 0.0;
623
624 // Correction Phase Center --> CoM
625 // -------------------------------
626 ColumnVector dx(3); dx = 0.0;
627 if (_antex) {
628 double Mjd = time12.mjd() + time12.daysec()/86400.0;
629 if (_antex->satCoMcorrection(corr->prn, Mjd, xc.Rows(1,3), dx) == success) {
630 xc(1) -= dx(1);
631 xc(2) -= dx(2);
632 xc(3) -= dx(3);
633 }
634 else {
635 cout << "antenna not found" << endl;
636 }
637 }
638
639 if (iTime == 1) {
640 out << 'P' << corr->prn.toAscii().data()
641 << setw(14) << setprecision(6) << xc(1) / 1000.0
642 << setw(14) << setprecision(6) << xc(2) / 1000.0
643 << setw(14) << setprecision(6) << xc(3) / 1000.0
644 << setw(14) << setprecision(6) << xc(4) * 1e6
645 << setw(14) << setprecision(6) << relCorr * 1e6
646 << setw(8) << setprecision(3) << dx(1)
647 << setw(8) << setprecision(3) << dx(2)
648 << setw(8) << setprecision(3) << dx(3)
649 << setw(8) << setprecision(3) << dcbP1C1
650 << setw(8) << setprecision(3) << dcbP1P2
651 << setw(6) << setprecision(1) << dT;
652
653 QString line;
654 int messageType = COTYPE_GPSCOMBINED;
655 int updateInt = 0;
656 line.sprintf("%d %d %d %.1f %s"
657 " %3d"
658 " %8.3f %8.3f %8.3f %8.3f"
659 " %10.5f %10.5f %10.5f %10.5f"
660 " %10.5f %10.5f %10.5f %10.5f INTERNAL",
661 messageType, updateInt, time12.gpsw(), time12.gpssec(),
662 corr->prn.toAscii().data(),
663 corr->iod,
664 corr->dClk * t_CST::c,
665 corr->rao[0],
666 corr->rao[1],
667 corr->rao[2],
668 corr->dotDClk * t_CST::c,
669 corr->dotRao[0],
670 corr->dotRao[1],
671 corr->dotRao[2],
672 corr->dotDotDClk * t_CST::c,
673 corr->dotDotRao[0],
674 corr->dotDotRao[1],
675 corr->dotDotRao[2]);
676 corrLines << line;
677 }
678 else {
679 out << setw(14) << setprecision(6) << xc(1) / 1000.0
680 << setw(14) << setprecision(6) << xc(2) / 1000.0
681 << setw(14) << setprecision(6) << xc(3) / 1000.0 << endl;
682 }
683 }
684
685 delete corr;
686 }
687 out << "EOE" << endl; // End Of Epoch flag
688
689 if (!_rtnetDecoder) {
690 _rtnetDecoder = new bncRtnetDecoder();
691 }
692
693 vector<string> errmsg;
694 _rtnetDecoder->Decode((char*) out.str().data(), out.str().size(), errmsg);
695
696 // Optionally send new Corrections to PPP
697 // --------------------------------------
698 bncApp* app = (bncApp*) qApp;
699 if (app->_bncPPPclient) {
700 app->_bncPPPclient->slotNewCorrections(corrLines);
701 }
702}
703
704// Create First Design Matrix and Vector of Measurements
705////////////////////////////////////////////////////////////////////////////
706t_irc bncComb::createAmat(Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP,
707 const ColumnVector& x0,
708 QMap<QString, t_corr*>& resCorr) {
709
710 unsigned nPar = _params.size();
711 unsigned nObs = corrs().size();
712
713 if (nObs == 0) {
714 return failure;
715 }
716
717 const int nCon = 1 + MAXPRN_GPS;
718
719 AA.ReSize(nObs+nCon, nPar); AA = 0.0;
720 ll.ReSize(nObs+nCon); ll = 0.0;
721 PP.ReSize(nObs+nCon); PP = 1.0 / (sigObs * sigObs);
722
723 int iObs = 0;
724
725 QVectorIterator<cmbCorr*> itCorr(corrs());
726 while (itCorr.hasNext()) {
727 cmbCorr* corr = itCorr.next();
728 QString prn = corr->prn;
729 switchToLastEph(_eph[prn]->last, corr);
730 ++iObs;
731
732 if (corr->acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {
733 resCorr[prn] = new t_corr(*corr);
734 }
735
736 for (int iPar = 1; iPar <= _params.size(); iPar++) {
737 cmbParam* pp = _params[iPar-1];
738 AA(iObs, iPar) = pp->partial(corr->acName, prn);
739 }
740
741 ll(iObs) = corr->dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
742 }
743
744 // Regularization
745 // --------------
746 const double Ph = 1.e6;
747 PP(nObs+1) = Ph;
748 for (int iPar = 1; iPar <= _params.size(); iPar++) {
749 cmbParam* pp = _params[iPar-1];
750 if ( AA.Column(iPar).maximum_absolute_value() > 0.0 &&
751 pp->type == cmbParam::clkSat ) {
752 AA(nObs+1, iPar) = 1.0;
753 }
754 }
755 int iCond = 1;
756 for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
757 QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
758 ++iCond;
759 PP(nObs+iCond) = Ph;
760 for (int iPar = 1; iPar <= _params.size(); iPar++) {
761 cmbParam* pp = _params[iPar-1];
762 if ( AA.Column(iPar).maximum_absolute_value() > 0.0 &&
763 pp->type == cmbParam::offACSat &&
764 pp->prn == prn) {
765 AA(nObs+iCond, iPar) = 1.0;
766 }
767 }
768 }
769
770 return success;
771}
772
773// Process Epoch - Single-Epoch Method
774////////////////////////////////////////////////////////////////////////////
775t_irc bncComb::processEpoch_singleEpoch(QTextStream& out,
776 QMap<QString, t_corr*>& resCorr) {
777
778 return failure;
779}
Note: See TracBrowser for help on using the repository browser.