Changeset 8956 in ntrip for trunk/BNC/src/PPP
- Timestamp:
- Jun 23, 2020, 11:58:46 AM (4 years ago)
- Location:
- trunk/BNC/src/PPP
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppClient.cpp
r8912 r8956 160 160 // ------- 161 161 epoTime.reset(); 162 clearObs(); 162 163 163 164 // Create vector of valid observations … … 174 175 } 175 176 } 176 }177 178 // (re)set reference satellites per system if required179 // ---------------------------------------------------180 if (_opt->_refSatRequired) {181 // reference satellite definition per system182 for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) {183 char system = _opt->systems()[iSys];184 bool refSatDefined = false;185 t_pppRefSat* refSat = _obsPool->getRefSatMapElement(system);186 for (unsigned ii = 0; ii < obsVector.size(); ii++) {187 const t_pppSatObs* satObs = obsVector.at(ii);188 // reference satellite is unchanged189 if (!_obsPool->refSatChangeRequired() && refSat->prn() == satObs->prn()) {190 refSatDefined = true;191 obsVector[ii]->setAsReference();192 refSat->setStatus(t_pppRefSat::unchanged);193 }194 // reference satellite has changed195 else if ( _obsPool->refSatChangeRequired() && refSat->prn() != satObs->prn()) {196 if (satObs->prn().system() == system) {197 refSatDefined = true;198 obsVector[ii]->setAsReference();199 refSat->setStatus(t_pppRefSat::changed);200 refSat->setPrn(satObs->prn());201 }202 }203 if (refSatDefined) {204 break;205 }206 }207 // reference satellite has to be initialized208 if (!refSatDefined) {209 for (unsigned ii = 0; ii < obsVector.size(); ii++) {210 const t_pppSatObs* satObs = obsVector.at(ii);211 if (satObs->prn().system() == system) {212 obsVector[ii]->setAsReference();213 refSat->setStatus(t_pppRefSat::initialized);214 refSat->setPrn(satObs->prn());215 }216 }217 }218 }219 _obsPool->setRefSatChangeRequired(false);220 177 } 221 178 … … 497 454 satObs->eleSat() >= _opt->_minEle && 498 455 modelSetup == success) { 499 if (satObs->isReference() && _opt->_pseudoObsIono) {500 char system = satObs->prn().system();501 t_pppRefSat* refSat = _obsPool->getRefSatMapElement(system);502 refSat->setStecValue(satObs->getIonoCodeDelay(t_frequency::G1));503 }504 456 ++it; 505 457 } … … 517 469 void t_pppClient::processEpoch(const vector<t_satObs*>& satObs, t_output* output) { 518 470 471 _historicalRefSats.clear(); 519 472 try { 520 473 initOutput(output); … … 524 477 do { 525 478 num++; 479 if (num == 1) { 480 LOG << "\nPPP of Epoch "; 481 if (!_epoTimeRover.undef()) LOG << string(_epoTimeRover); 482 LOG << "\n---------------------------------------------------------------\n"; 483 } 526 484 527 485 // Prepare Observations of the Rover … … 530 488 return finish(failure); 531 489 } 532 533 LOG << "\nPPP of Epoch ";534 if (!_epoTimeRover.undef()) LOG << string(_epoTimeRover);535 LOG << "\n---------------------------------------------------------------\n";536 490 537 491 for (int iter = 1; iter <= 2; iter++) { … … 548 502 _offGG = cmpOffGG(_obsRover); 549 503 550 // Prepare Pseudo Observations of the Rover551 // ----------------------------------------552 _pseudoObsIono = preparePseudoObs(_obsRover);553 if (int(_obsRover.size()) < _opt->_minObs) {554 LOG << "t_pppClient::processEpoch not enough observations" << endl;555 return finish(failure);556 }557 558 504 if (_opt->_refSatRequired) { 505 setRefSatellites(_obsRover); 559 506 LOG.setf(ios::fixed); 560 507 QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap()); … … 563 510 char sys = it.key(); 564 511 string prn = it.value()->prn().toString(); 512 if (num == 1) { 513 LOG << "set "; 514 } 515 else { 516 LOG << "reset "; 517 } 565 518 LOG << string(_epoTimeRover) << " REFSAT " << sys << ": " << prn << endl; 566 519 } 567 520 } 521 522 523 // Prepare Pseudo Observations of the Rover 524 // ---------------------------------------- 525 _pseudoObsIono = preparePseudoObs(_obsRover); 526 527 if (int(_obsRover.size()) < _opt->_minObs) { 528 LOG << "t_pppClient::processEpoch not enough observations" << endl; 529 return finish(failure); 530 } 531 568 532 569 533 // Store last epoch of data 570 534 // ------------------------ 571 //_obsRover.resize(2);572 535 _obsPool->putEpoch(_epoTimeRover, _obsRover, _pseudoObsIono); 536 _obsPool->setHistoricalRefSatList(_historicalRefSats); 573 537 574 538 // Process Epoch in Filter … … 582 546 if (_obsPool->refSatChangeRequired()) { 583 547 epochReProcessing = true; 548 _obsPool->deleteLastEpoch(); 549 QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap()); 550 while (it.hasNext()) { 551 it.next(); 552 _historicalRefSats.append(it.value()->prn()); 553 } 584 554 } 585 555 else { 586 556 epochReProcessing = false; 587 } 588 // Datum transformation required? 589 // ------------------------------ 590 if (num > 1 && epochReProcessing) { 591 _filter->datumTransformation(); 592 } 593 557 558 } 594 559 } while (epochReProcessing); 595 560 } … … 694 659 // 695 660 ////////////////////////////////////////////////////////////////////////////// 661 void t_pppClient::setRefSatellites(std::vector<t_pppSatObs*>& obsVector) { 662 663 // reference satellite definition per system 664 for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) { 665 char system = _opt->systems()[iSys]; 666 bool refSatDefined = false; 667 t_pppRefSat* refSat = _obsPool->getRefSatMapElement(system); 668 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 669 t_pppSatObs* satObs = obsVector.at(ii); 670 if (satObs->eleSat() < _opt->_minEle) {continue;} 671 // reference satellite is unchanged 672 if (!_obsPool->refSatChangeRequired() && refSat->prn() == satObs->prn()) { 673 refSatDefined = true; 674 obsVector[ii]->setAsReference(); 675 } 676 // reference satellite has changed 677 else if ( _obsPool->refSatChangeRequired() && refSat->prn() != satObs->prn() && !_historicalRefSats.contains(satObs->prn())) { 678 if (satObs->prn().system() == system) { 679 refSatDefined = true; 680 obsVector[ii]->setAsReference(); 681 refSat->setPrn(satObs->prn()); 682 } 683 } 684 if (refSatDefined) { 685 if (OPT->_pseudoObsIono) { 686 refSat->setStecValue(satObs->getIonoCodeDelay(t_frequency::G1)); 687 } 688 break; 689 } 690 } 691 // reference satellite has to be initialized 692 if (!refSatDefined) { 693 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 694 t_pppSatObs* satObs = obsVector.at(ii); 695 if (satObs->eleSat() < _opt->_minEle) { 696 continue; 697 } 698 if (satObs->prn().system() == system) { 699 obsVector[ii]->setAsReference(); 700 refSat->setPrn(satObs->prn()); 701 if (OPT->_pseudoObsIono) { 702 refSat->setStecValue(satObs->getIonoCodeDelay(t_frequency::G1)); 703 } 704 refSatDefined = true; 705 break; 706 } 707 } 708 } 709 } 710 _obsPool->setRefSatChangeRequired(false); 711 712 } 713 714 // 715 ////////////////////////////////////////////////////////////////////////////// 696 716 void t_pppClient::reset() { 697 717 -
trunk/BNC/src/PPP/pppClient.h
r8911 r8956 60 60 ColumnVector& xyzc, bool print); 61 61 double cmpOffGG(std::vector<t_pppSatObs*>& obsVector); 62 void setRefSatellites(std::vector<t_pppSatObs*>& obsVector); 62 63 63 64 t_output* _output; … … 74 75 t_tides* _tides; 75 76 bool _pseudoObsIono; 77 QList<t_prn> _historicalRefSats; 76 78 }; 77 79 -
trunk/BNC/src/PPP/pppFilter.cpp
r8915 r8956 83 83 // Set Parameters 84 84 // -------------- 85 _parlist->set(_epoTime, allObs );85 _parlist->set(_epoTime, allObs, _obsPool->getRefSatMap()); 86 86 const vector<t_pppParam*>& params = _parlist->params(); 87 87 … … 90 90 ColumnVector xFltOld = _xFlt; 91 91 SymmetricMatrix QFltOld = _QFlt; 92 92 93 _QFlt.ReSize(_parlist->nPar()); _QFlt = 0.0; 93 94 _xFlt.ReSize(_parlist->nPar()); _xFlt = 0.0; … … 114 115 predictCovCrdPart(QFltOld); 115 116 117 // Init Datum Trafo 118 // ---------------------------------------- 119 if ((OPT->_obsModelType == OPT->DCMcodeBias || 120 OPT->_obsModelType == OPT->DCMphaseBias) && 121 (_numEpoProcessing == 1)) { 122 _numAllUsedLCs = 0; 123 for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) { 124 char system = OPT->systems()[iSys]; 125 _numAllUsedLCs += OPT->LCs(system).size(); 126 if (OPT->_pseudoObsIono && !epoch->pseudoObsIono()) { 127 _numAllUsedLCs -= 1; // GIM not used 128 } 129 } 130 int maxObs = allObs.size() * _numAllUsedLCs; 131 _datumTrafo->initAA(maxObs, _parlist->nPar()); 132 } 116 133 117 134 // Pre-Process Satellite Systems separately … … 121 138 OPT->_obsModelType == OPT->DCMphaseBias) { 122 139 preProcessing = true; 123 _numAllUsedLCs = 0;124 140 for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) { 141 (iSys) ? _datumTrafo->setFirstSystem(false) : _datumTrafo->setFirstSystem(true); 125 142 char system = OPT->systems()[iSys]; 126 _numAllUsedLCs += OPT->LCs(system).size();127 if (OPT->_pseudoObsIono && !epoch->pseudoObsIono()) {128 _numAllUsedLCs -= 1; // GIM not used129 }130 143 if (OPT->_refSatRequired) { 131 144 _refPrn = (_obsPool->getRefSatMapElement(system))->prn(); 145 if (_obsPool->hasHistoricalRefSat(_refPrn)) { 146 return failure; 147 } 132 148 } 133 149 vector<t_pppSatObs*> obsVector; … … 142 158 } 143 159 } 144 } 145 146 if (_numEpoProcessing == 1) { 147 int maxObs = allObs.size() * _numAllUsedLCs; 148 _datumTrafo->initAA(maxObs, _parlist->nPar()); 160 // refSat change required? 161 // ----------------------- 162 if (_obsPool->refSatChangeRequired()) { 163 _xFlt = xFltOld; 164 _QFlt = QFltOld; 165 return success; 166 } 167 else if (!_obsPool->refSatChangeRequired() && 168 _numEpoProcessing > 1) { 169 datumTransformation(xFltOld, QFltOld); 170 } 149 171 } 150 172 … … 154 176 for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) { 155 177 char system = OPT->systems()[iSys]; 156 (iSys) ? _datumTrafo->setFirstSystem(false) :157 _datumTrafo->setFirstSystem(true);158 178 if (OPT->_refSatRequired) { 159 179 _refPrn = (_obsPool->getRefSatMapElement(system))->prn(); … … 174 194 } 175 195 176 // refSat change required?177 // -----------------------178 if (_obsPool->refSatChangeRequired()) {179 _xFlt = xFltOld;180 _QFlt = QFltOld;181 }182 196 // close epoch processing 183 197 // ---------------------- 184 else { 185 cmpDOP(allObs); 186 _parlist->printResult(_epoTime, _QFlt, _xFlt); 187 _lastEpoTimeOK = _epoTime; // remember time of last successful epoch processing 188 } 198 cmpDOP(allObs); 199 _parlist->printResult(_epoTime, _QFlt, _xFlt); 200 _lastEpoTimeOK = _epoTime; // remember time of last successful epoch processing 189 201 190 202 return success; … … 198 210 bool pseudoObsIonoAvailable, 199 211 bool preProcessing) { 200 qDebug() << "======t_pppFilter::processSystem=======";201 212 LOG.setf(ios::fixed); 202 213 203 214 // Detect Cycle Slips 204 215 // ------------------ 216 205 217 if (detectCycleSlips(LCs, obsVector, refPrn, preProcessing) != success) { 206 218 return failure; … … 221 233 maxObs -= 1; 222 234 } 223 qDebug() << "par.size() : " << _parlist->nPar() << " LCs.size(): " << usedLCs;224 qDebug() << "obsVector.size(): " << obsVector.size() << " maxObs : " << maxObs;225 235 226 236 // Outlier Detection Loop 227 237 // ---------------------- 228 238 for (unsigned iOutlier = 0; iOutlier < maxObs; iOutlier++) { 229 qDebug() << "iOutlier: " << iOutlier;230 239 231 240 if (iOutlier > 0) { … … 236 245 // First-Design Matrix, Terms Observed-Computed, Weight Matrix 237 246 // ----------------------------------------------------------- 238 qDebug() << "A(" << maxObs << "," << _parlist->nPar() << ")";239 247 Matrix AA(maxObs, _parlist->nPar()); 240 248 ColumnVector ll(maxObs); 241 249 DiagonalMatrix PP(maxObs); PP = 0.0; 242 243 // TETSPLOT244 for (unsigned iPar = 0; iPar < params.size(); iPar++) {245 const t_pppParam* par = params[iPar];246 cout << " " << par->toString() <<endl;247 }248 cout << endl;249 //END TETSPLOT250 250 251 251 int iObs = -1; … … 253 253 vector<t_lc::type> usedTypes; 254 254 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 255 t_pppSatObs* obs = obsVector[ii]; qDebug() << "SATELLITE: " << obs->prn().toString().c_str() << "isRef: " << obs->isReference();255 t_pppSatObs* obs = obsVector[ii]; 256 256 if (!obs->outlier()) { 257 257 for (unsigned jj = 0; jj < usedLCs; jj++) { … … 263 263 for (unsigned iPar = 0; iPar < params.size(); iPar++) { 264 264 const t_pppParam* par = params[iPar]; 265 AA[iObs][iPar] = par->partial(_epoTime, obs, tLC); 266 cout << setw(10) << par->partial(_epoTime, obs, tLC); 267 } 268 cout << endl; 265 AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn); 266 } 269 267 ll[iObs] = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1)); 270 268 PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC)); 271 //qDebug() << "ll[iObs]: " << ll[iObs]; 272 //qDebug() << "PP[iObs]: " << PP[iObs]; 273 } 274 } 275 } 276 277 if ((!preProcessing) && 278 (OPT->_obsModelType == OPT->DCMcodeBias || 279 OPT->_obsModelType == OPT->DCMphaseBias)) { 269 } 270 } 271 } 272 273 if ((preProcessing && ! iOutlier) && 274 (OPT->_obsModelType == OPT->DCMcodeBias || OPT->_obsModelType == OPT->DCMphaseBias)) { 280 275 _datumTrafo->updateIndices(maxObs); 281 276 _datumTrafo->prepareAA(AA, _numEpoProcessing, _parlist->nPar()); 277 if (_obsPool->refSatChangeRequired()) { // from detectCycleSlips() 278 return success; 279 } 282 280 } 283 281 … … 331 329 } 332 330 } 333 if (par &&preProcessing) {334 if (par ->prn() == refPrn) {331 if (preProcessing) { 332 if (par && obs->prn() == refPrn) { 335 333 _obsPool->setRefSatChangeRequired(true); 336 } 337 } 338 else if (par && !preProcessing) { 339 if (par->ambResetCandidate()) { 340 resetAmb(par->prn(), obsVector, &QSav, &xSav); 334 break; 335 } 336 } 337 else { 338 if (par) { 339 if (par->ambResetCandidate() || _obsPool->hasHistoricalRefSat(par->prn())) { 340 resetAmb(par->prn(), obsVector, &QSav, &xSav); 341 } 342 else { 343 par->setAmbResetCandidate(); 344 obs->setOutlier(); 345 } 341 346 } 342 347 else { 343 par->setAmbResetCandidate();344 348 obs->setOutlier(); 345 349 } 346 350 } 347 else if (!par && !preProcessing){ 348 obs->setOutlier(); 349 } 350 } 351 351 } 352 352 // Print Residuals 353 353 // --------------- … … 381 381 const t_prn& refPrn, 382 382 bool preProcessing) { 383 384 const double SLIP = 20.0; // slip threshold 383 if (_obsPool->hasHistoricalRefSat(refPrn)) { 384 return success; 385 } 386 387 double SLIP = 20.0; // slip threshold 385 388 string epoTimeStr = string(_epoTime); 386 389 const vector<t_pppParam*>& params = _parlist->params(); 390 391 if (preProcessing) { 392 SLIP += 10.0; 393 } 387 394 388 395 for (unsigned ii = 0; ii < LCs.size(); ii++) { … … 391 398 for (unsigned iObs = 0; iObs < obsVector.size(); iObs++) { 392 399 const t_pppSatObs* obs = obsVector[iObs]; 400 401 if (preProcessing && obs->prn() != refPrn) {continue;} 393 402 394 403 // Check set Slips and Jump Counters … … 405 414 slip = true; 406 415 } 407 _slips[obs->prn()]._obsSlipCounter = obs->slipCounter(); 416 if (!preProcessing) { 417 _slips[obs->prn()]._obsSlipCounter = obs->slipCounter(); 418 } 408 419 409 420 if (_slips[obs->prn()]._biasJumpCounter != -1 && … … 412 423 slip = true; 413 424 } 414 425 if (!preProcessing) { 426 _slips[obs->prn()]._biasJumpCounter = obs->biasJumpCounter(); 427 } 415 428 // Slip Set 416 429 // -------- 417 430 if (slip) { 418 431 if (preProcessing) { 419 if (obs->prn() == refPrn) { 420 _obsPool->setRefSatChangeRequired(true); 421 } 432 _obsPool->setRefSatChangeRequired(true); 422 433 } 423 434 else { … … 431 442 for (unsigned iPar = 0; iPar < params.size(); iPar++) { 432 443 const t_pppParam* par = params[iPar]; 433 AA[iPar] = par->partial(_epoTime, obs, tLC); 434 } 444 AA[iPar] = par->partial(_epoTime, obs, tLC, refPrn); 445 } 446 435 447 double ll = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA); 436 448 double vv = DotProduct(AA, _xFlt) - ll; 437 449 if (fabs(vv) > SLIP) { 438 450 if (preProcessing) { 439 if (obs->prn() == refPrn) { 440 _obsPool->setRefSatChangeRequired(true); 441 } 451 _obsPool->setRefSatChangeRequired(true); 442 452 } 443 453 else { … … 451 461 } 452 462 } 453 454 463 return success; 455 464 } … … 459 468 t_irc t_pppFilter::resetAmb(t_prn prn, const vector<t_pppSatObs*>& obsVector, 460 469 SymmetricMatrix* QSav, ColumnVector* xSav) { 470 461 471 t_irc irc = failure; 462 472 vector<t_pppParam*>& params = _parlist->params(); … … 504 514 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 505 515 t_pppSatObs* obs = obsVector[ii]; 516 char system = obs->prn().system(); 517 t_prn refPrn = t_prn(); 518 if (OPT->_refSatRequired) { 519 refPrn = _obsPool->getRefSatMapElement(system)->prn(); 520 } 506 521 if (obs->isValid() && !obs->outlier()) { 507 522 ++_numSat; 508 523 for (unsigned iPar = 0; iPar < numPar; iPar++) { 509 524 const t_pppParam* par = _parlist->params()[iPar]; 510 AA[_numSat-1][iPar] = par->partial(_epoTime, obs, t_lc::c1 );525 AA[_numSat-1][iPar] = par->partial(_epoTime, obs, t_lc::c1, refPrn); 511 526 } 512 527 } … … 571 586 // Compute datum transformation 572 587 //////////////////////////////////////////////////////////////////////////// 573 void t_pppFilter::datumTransformation(void) { 574 _QFlt = _datumTrafo->varCov(Q()); 575 } 576 588 void t_pppFilter::datumTransformation(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld) { 589 590 Matrix D21 = _datumTrafo->computeTrafoMatrix(); 591 _QFlt << D21 * QFltOld * D21.t(); 592 _xFlt = D21 * xFltOld; 593 } 594 595 596 // Reset Ambiguity Parameter (cycle slip) 597 //////////////////////////////////////////////////////////////////////////// 598 t_irc t_pppFilter::addInfiniteNoise(t_pppParam::e_type para) { 599 t_irc irc = failure; 600 vector<t_pppParam*>& params = _parlist->params(); 601 for (unsigned iPar = 0; iPar < params.size(); iPar++) { 602 t_pppParam* par = params[iPar]; 603 if (par->type() == para) { 604 int ind = par->indexNew(); 605 if (ind < 0) { 606 return irc; 607 } 608 _QFlt(ind+1,ind+1) += par->sigma0() * par->sigma0(); 609 irc = success; 610 } 611 } 612 return irc; 613 } -
trunk/BNC/src/PPP/pppFilter.h
r8915 r8956 22 22 t_irc processEpoch(int num); 23 23 24 void datumTransformation( );24 void datumTransformation(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld); 25 25 26 26 const ColumnVector& x() const {return _xFlt;} … … 75 75 }; 76 76 77 class t_datumTrafo {77 class t_datumTrafo { 78 78 public: 79 79 t_datumTrafo () {initIndices();} … … 82 82 bool firstSystem() {return _firstSys;} 83 83 void updateIndices(int maxObs) { 84 if ( _firstSys) {84 if (firstSystem()) { 85 85 initIndices(); 86 86 } … … 94 94 _AA2.ReSize(maxObs, numPar); _AA2 = 0.0; 95 95 } 96 void prepareAA( Matrix& AA, int _numEpoProcessing, int nPar) {97 Matrix & Prep =_AA2;98 if ( _numEpoProcessing == 1) {99 Prep = _AA1;96 void prepareAA(const Matrix& AA, int numEpoProcessing, int nPar) { 97 Matrix* Prep = &_AA2; 98 if (numEpoProcessing == 1) { 99 Prep = &_AA1; 100 100 } 101 Prep .SubMatrix(_firstRow, _lastRow, 1, nPar) =AA;101 Prep->SubMatrix(_firstRow, _lastRow, 1, nPar) << AA; 102 102 } 103 Matrix varCov(const SymmetricMatrix& QFlt) { 103 104 Matrix computeTrafoMatrix() { 104 105 Matrix D21 = (_AA2.t() * _AA2).i() * _AA2.t() * _AA1; 105 return D21 * QFlt * D21.t(); 106 return D21; 107 } 108 109 static void printMatrix(const Matrix& X, int nRow, int nCol) { 110 for (int rr = 0; rr < nRow; rr++) { 111 for (int cc = 0; cc < nCol; cc++) { 112 cout << setw(7) << setprecision(4) << X[rr][cc] << " "; 113 } 114 cout << endl; } 115 cout << endl; 106 116 } 107 117 int _firstRow; … … 130 140 void predictCovCrdPart(const SymmetricMatrix& QFltOld); 131 141 142 t_irc addInfiniteNoise(t_pppParam::e_type para); 143 132 144 bncTime _epoTime; 133 145 t_pppParlist* _parlist; -
trunk/BNC/src/PPP/pppObsPool.cpp
r8911 r8956 100 100 const unsigned MAXSIZE = 2; 101 101 102 if (refSatChangeRequired()) { 103 delete _epochs.back(); 104 _epochs.pop_back(); 105 } 106 _epochs.push_back(new t_epoch(epoTime, obsVector,pseudoObsIono)); 102 _epochs.push_back(new t_epoch(epoTime, obsVector, pseudoObsIono)); 103 107 104 if (_epochs.size() > MAXSIZE) { 108 105 delete _epochs.front(); … … 110 107 } 111 108 } 109 110 // 111 ///////////////////////////////////////////////////////////////////////////// 112 void t_pppObsPool::deleteLastEpoch() { 113 114 if (!_epochs.empty()) { 115 delete _epochs.back(); 116 _epochs.pop_back(); 117 } 118 } -
trunk/BNC/src/PPP/pppObsPool.h
r8911 r8956 38 38 bool pseudoObs); 39 39 40 void deleteLastEpoch(); 41 40 42 const t_satCodeBias* satCodeBias(const t_prn& prn) const { 41 43 return _satCodeBiases[prn.toInt()]; … … 76 78 bool refSatChangeRequired() {return _refSatChangeRequired;} 77 79 80 void setHistoricalRefSatList(QList<t_prn>& historicalRefSats) {_historicalRefSats = historicalRefSats;} 81 82 bool hasHistoricalRefSat(t_prn prn) {return _historicalRefSats.contains(prn);} 83 78 84 private: 79 85 t_satCodeBias* _satCodeBiases[t_prn::MAXPRN+1]; … … 83 89 QMap<char, t_pppRefSat*> _refSatMap; 84 90 bool _refSatChangeRequired; 91 QList<t_prn> _historicalRefSats; 85 92 }; 86 93 -
trunk/BNC/src/PPP/pppParlist.cpp
r8905 r8956 123 123 //////////////////////////////////////////////////////////////////////////// 124 124 double t_pppParam::partial(const bncTime& /* epoTime */, const t_pppSatObs* obs, 125 const t_lc::type& tLC ) const {//qDebug() << "t_pppParam::partial: " << tLC;125 const t_lc::type& tLC, const t_prn refPrn) const { 126 126 127 127 // Special Case - Melbourne-Wuebbena … … 184 184 return 1.0 / sin(obs->eleSat()); 185 185 case ion: 186 // qDebug() << "refPrn: " << _refPrn.toString().c_str(); 186 187 187 if (obs->prn() == _prn) { 188 188 if (tLC == t_lc::c1) { … … 202 202 } 203 203 } 204 if (tLC == t_lc::GIM && _prn == _refPrn) {204 if (tLC == t_lc::GIM && _prn == refPrn) { 205 205 return 1.0; 206 206 } … … 296 296 //////////////////////////////////////////////////////////////////////////// 297 297 t_irc t_pppParlist::set(const bncTime& epoTime, 298 const std::vector<t_pppSatObs*>& obsVector) { 298 const std::vector<t_pppSatObs*>& obsVector, 299 const QMap<char, t_pppRefSat*>& refSatMap) { 299 300 300 301 // Remove some Parameters … … 310 311 } 311 312 312 else if (par->type() == t_pppParam::amb || 313 par->type() == t_pppParam::crdX || 313 else if (par->type() == t_pppParam::crdX || 314 314 par->type() == t_pppParam::crdY || 315 315 par->type() == t_pppParam::crdZ) { 316 316 if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 60.0)) { 317 remove = true; 318 } 319 } 320 else if (par->type() == t_pppParam::amb) { 321 char system = par->prn().system(); 322 t_prn refPrn = t_prn(); 323 if (OPT->_refSatRequired) { 324 refPrn = (refSatMap[system])->prn(); 325 } 326 if ((par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 60.0)) || 327 ( refPrn == par->prn())) { 317 328 remove = true; 318 329 } -
trunk/BNC/src/PPP/pppParlist.h
r8905 r8956 7 7 #include "t_prn.h" 8 8 #include "bnctime.h" 9 #include "pppRefSat.h" 9 10 10 11 namespace BNC_PPP { … … 23 24 e_type type() const {return _type;} 24 25 double x0() const {return _x0;} 25 double partial(const bncTime& epoTime, const t_pppSatObs* obs, const t_lc::type& tLC) const; 26 double partial(const bncTime& epoTime, const t_pppSatObs* obs, 27 const t_lc::type& tLC, const t_prn refPrn) const; 26 28 bool epoSpec() const {return _epoSpec;} 27 29 bool isEqual(const t_pppParam* par2) const { … … 51 53 unsigned ambNumEpo() const {return _ambInfo ? _ambInfo->_numEpo : 0;} 52 54 void stepAmbNumEpo() {if (_ambInfo) _ambInfo->_numEpo += 1;} 53 void setRefPrn(t_prn prn) {_refPrn = prn;}54 55 55 56 static bool sortFunction(const t_pppParam* p1, const t_pppParam* p2) { … … 81 82 e_type _type; 82 83 t_prn _prn; 83 t_prn _refPrn;84 84 t_lc::type _tLC; 85 85 double _x0; … … 99 99 ~t_pppParlist(); 100 100 101 t_irc set(const bncTime& epoTime, const std::vector<t_pppSatObs*>& obsVector); 101 t_irc set(const bncTime& epoTime, const std::vector<t_pppSatObs*>& obsVector, 102 const QMap<char, t_pppRefSat*>& refSatMap); 102 103 unsigned nPar() const {return _params.size();} 103 104 const std::vector<t_pppParam*>& params() const {return _params;} -
trunk/BNC/src/PPP/pppRefSat.cpp
r8905 r8956 14 14 //////////////////////////////////////////////////////////////////////////// 15 15 t_pppRefSat::t_pppRefSat() { 16 _status = undefined;17 16 _prn = t_prn(); 18 17 _stecValue = 0.0; -
trunk/BNC/src/PPP/pppRefSat.h
r8905 r8956 17 17 t_pppRefSat (); 18 18 ~t_pppRefSat(); 19 enum e_status {undefined, initialized, changed, unchanged};// ev. wieder löschen20 e_status status() const {return _status;}21 void setStatus(e_status status) {_status = status;}22 19 t_prn prn() {return _prn;} 23 20 void setPrn(t_prn prn) {_prn = prn;} … … 25 22 void setStecValue(double stecValue) {_stecValue = stecValue;} 26 23 private: 27 e_status _status;28 24 t_prn _prn; 29 25 double _stecValue; -
trunk/BNC/src/PPP/pppSatObs.cpp
r8905 r8956 342 342 } 343 343 if (tLC == t_lc::GIM) { 344 retVal = 3 * (OPT->_sigmaGIMdiff * OPT->_sigmaGIMdiff);344 retVal = 3.0 * OPT->_sigmaGIMdiff * OPT->_sigmaGIMdiff; 345 345 } 346 346 return sqrt(retVal); … … 495 495 _model._set = true; 496 496 497 printModel();497 //printModel(); 498 498 499 499 return success; … … 503 503 //////////////////////////////////////////////////////////////////////////// 504 504 void t_pppSatObs::printModel() const { 505 // TODO: cout should be LOG 506 cout.setf(ios::fixed); 507 cout << "\nMODEL for Satellite " << _prn.toString() << (isReference() ? " (Reference Satellite)" : "") << endl 508 << "======================= " << endl 509 << "PPP STRATEGY : " << OPT->_obsmodelTypeStr.at((int)OPT->_obsModelType).toLocal8Bit().constData() 510 << ((OPT->_pseudoObsIono) ? " with pseudo-observations for STEC" : "") << endl 505 506 LOG.setf(ios::fixed); 507 LOG << "\nMODEL for Satellite " << _prn.toString() << (isReference() ? " (Reference Satellite)" : "") 508 509 << "======================= " << endl 510 << "PPP STRATEGY : " << OPT->_obsmodelTypeStr.at((int)OPT->_obsModelType).toLocal8Bit().constData() 511 << ((OPT->_pseudoObsIono) ? " with pseudo-observations for STEC" : "") << endl 511 512 << "RHO : " << setw(12) << setprecision(3) << _model._rho << endl 512 513 << "ELE : " << setw(12) << setprecision(3) << _model._eleSat * RHO_DEG << endl … … 528 529 string frqStr = t_frequency::toString(t_frequency::type(iFreq)); 529 530 if (_prn.system() == frqStr[0]) { 530 cout<< "PCO : " << frqStr << setw(12) << setprecision(3) << _model._antPCO[iFreq] << endl531 LOG << "PCO : " << frqStr << setw(12) << setprecision(3) << _model._antPCO[iFreq] << endl 531 532 << "BIAS CODE : " << frqStr << setw(12) << setprecision(3) << _model._codeBias[iFreq] << endl 532 533 << "BIAS PHASE : " << frqStr << setw(12) << setprecision(3) << _model._phaseBias[iFreq] << endl
Note:
See TracChangeset
for help on using the changeset viewer.