Changeset 9508 in ntrip for trunk/BNC/src/PPP/pppFilter.cpp
- Timestamp:
- Oct 6, 2021, 10:50:34 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppFilter.cpp
r9504 r9508 72 72 string epoTimeStr = string(_epoTime); 73 73 74 const QMap<char, t_pppRefSat*>& refSatMap = epoch->refSatMap(); 75 74 76 if (OPT->_obsModelType == OPT->DCMcodeBias || 75 77 OPT->_obsModelType == OPT->DCMphaseBias) { 76 78 // Save parameters of epoch before 77 79 _parlist_sav = _parlist; 78 }80 } 79 81 80 82 //-- 81 83 // Set Parameters 82 if (_parlist.set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) {84 if (_parlist.set(_epoTime, allObs, refSatMap) != success) { 83 85 return failure; 84 86 } 85 86 87 const vector<t_pppParam*>& params = _parlist.params(); 87 88 #ifdef BNC_DEBUG_PPP 88 for ( intiPar = 0; iPar < params.size(); iPar++) {89 LOG << " available par " << params[iPar]->toString() << endl;89 for (unsigned iPar = 0; iPar < params.size(); iPar++) { 90 LOG << "t_pppFilter::processEpoch par_cur " << params[iPar]->toString() << endl; 90 91 } 91 92 #endif … … 133 134 for (int iSys = 0; iSys < usedSystems.size(); iSys++) { 134 135 char sys = usedSystems[iSys]; 135 _refPrn = (_obsPool->getRefSatMapElement(sys))->prn();136 _refPrn = refSatMap[sys]->prn(); 136 137 vector<t_pppSatObs*> obsVector; 137 138 for (unsigned jj = 0; jj < allObs.size(); jj++) { … … 170 171 char sys = usedSystems[iSys]; 171 172 if (OPT->_refSatRequired) { 172 _refPrn = (_obsPool->getRefSatMapElement(sys))->prn();173 _refPrn = refSatMap[sys]->prn(); 173 174 } 174 175 else { … … 195 196 // close epoch processing 196 197 // ---------------------- 197 cmpDOP(allObs );198 cmpDOP(allObs, refSatMap); 198 199 _parlist.printResult(_epoTime, _QFlt, _xFlt); 199 200 _lastEpoTimeOK = _epoTime; // remember time of last successful epoch processing 200 if (OPT->_refSatRequired) {201 _obsPool->saveLastEpoRefSats();202 }203 201 return success; 204 202 } … … 596 594 // Compute various DOP Values 597 595 //////////////////////////////////////////////////////////////////////////// 598 void t_pppFilter::cmpDOP(const vector<t_pppSatObs*>& obsVector) { 596 void t_pppFilter::cmpDOP(const vector<t_pppSatObs*>& obsVector, 597 const QMap<char, t_pppRefSat*>& refSatMap) { 599 598 600 599 _dop.reset(); … … 606 605 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 607 606 t_pppSatObs* obs = obsVector[ii]; 608 char sys tem= obs->prn().system();607 char sys = obs->prn().system(); 609 608 t_prn refPrn = t_prn(); 610 609 if (OPT->_refSatRequired) { 611 refPrn = _obsPool->getRefSatMapElement(system)->prn();610 refPrn = refSatMap[sys]->prn(); 612 611 } 613 612 if (obs->isValid() && !obs->outlier()) { … … 678 677 // Compute datum transformation 679 678 //////////////////////////////////////////////////////////////////////////// 680 t_irc t_pppFilter::datumTransformation() { 679 t_irc t_pppFilter::datumTransformation(const QMap<char, t_pppRefSat*>& refSatMap) { 680 681 681 // get last epoch 682 682 t_pppObsPool::t_epoch* epoch = _obsPool->lastEpoch(); 683 683 if (!epoch) { 684 LOG << " !lastEpoch" << endl;684 LOG << "t_pppFilter::datumTransformation: !lastEpoch" << endl; 685 685 return failure; 686 686 } 687 else { 688 LOG.setf(ios::fixed); 689 LOG << string(epoch->epoTime()) << " DATUM TRANSFORMATION " << endl; 690 } 687 _epoTime = epoch->epoTime(); 688 LOG.setf(ios::fixed); 689 LOG << string(_epoTime) << " DATUM TRANSFORMATION " << endl; 691 690 692 691 vector<t_pppSatObs*>& allObs = epoch->obsVector(); 692 693 const QMap<char, t_pppRefSat*>& refSatMapLastEpoch = epoch->refSatMap(); 694 695 bool peseudoObsIono = epoch->pseudoObsIono(); 693 696 694 697 // reset old and set new refSats in last epoch (ambiguities/GIM) 695 698 // ============================================================= 696 if (resetRefSatellitesLastEpoch(allObs ) != true) {699 if (resetRefSatellitesLastEpoch(allObs, refSatMap, refSatMapLastEpoch) != true) { 697 700 LOG << "refsatChange required" << endl; 698 701 return success; … … 705 708 // set AA2 706 709 // ======= 707 if (_parlist.set( epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) {710 if (_parlist.set(_epoTime, allObs, refSatMap) != success) { 708 711 return failure; 709 712 } 710 constvector<t_pppParam*>& _params = _parlist.params();713 vector<t_pppParam*>& _params = _parlist.params(); 711 714 unsigned nPar = _parlist.nPar(); 712 715 #ifdef BNC_DEBUG_PPP 713 LOG << " parameters of last epoch" <<endl;716 LOG << " t_pppFilter::datumTransformation par last epoch: " << _params.size() << "/" << nPar << endl; 714 717 for (unsigned iPar = 0; iPar < nPar; iPar++) { 715 LOG << _params[iPar]->toString() << "\t\t" <<endl;718 LOG << _params[iPar]->toString() << "\t\t" endl; 716 719 } 717 720 #endif … … 719 722 for (int iSys = 0; iSys < usedSystems.size(); iSys++) { 720 723 char sys = usedSystems[iSys]; 721 t_prn refPrn = (_obsPool->getRefSatMapElement(sys))->prn();724 t_prn refPrn = refSatMap[sys]->prn(); 722 725 vector<t_pppSatObs*> obsVector; 723 726 for (unsigned jj = 0; jj < allObs.size(); jj++) { … … 731 734 vector<t_lc::type> LCs = OPT->LCs(sys); 732 735 unsigned usedLCs = LCs.size(); 733 if (OPT->_pseudoObsIono && ! epoch->pseudoObsIono()) {736 if (OPT->_pseudoObsIono && !peseudoObsIono) { 734 737 usedLCs -= 1; // GIM not used 735 738 } … … 744 747 maxObs += 1; 745 748 } 746 if (OPT->_pseudoObsIono && epoch->pseudoObsIono()) {749 if (OPT->_pseudoObsIono && peseudoObsIono) { 747 750 maxObs -= 1; // pseudo obs iono with respect to refSat 748 751 } 749 752 Matrix AA(maxObs, nPar); 750 751 753 // Real Observations 752 754 // ----------------- … … 787 789 continue; 788 790 } 789 _datumTrafo->updateIndices(sys, iObs+1); 790 _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, nPar), 2); 791 _datumTrafo->updateIndices(sys, iObs+1); //LOG << "AA Ncols/Nrows: " << AA.Ncols() << "/" << AA.Nrows() << " nPar: " << nPar << endl; //LOG << "AA.SubMatrix(1 .. " << iObs+1 << " , 1 .. " << nPar << ")" << endl; 792 if(_datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, nPar), 2) != success) { 793 return failure; 794 } 791 795 } 792 796 _datumTrafo->updateNumObs(); … … 819 823 for (int iSys = 0; iSys < usedSystems.size(); iSys++) { 820 824 char sys = usedSystems[iSys]; 821 t_prn refPrnOld = _obsPool->getRefSatMapElementLastEpoch(sys);822 t_prn refPrnNew = (_obsPool->getRefSatMapElement(sys))->prn();825 t_prn refPrnOld = refSatMapLastEpoch[sys]->prn(); 826 t_prn refPrnNew = refSatMap[sys]->prn(); 823 827 if (refPrnNew != refPrnOld) { 824 t_irc irc = resetAmb( _obsPool->getRefSatMapElementLastEpoch(sys), allObs);828 t_irc irc = resetAmb(refPrnOld, allObs); 825 829 if (OPT->_obsModelType == OPT->DCMcodeBias) { 826 830 if (irc == success) { … … 834 838 // ================= 835 839 _datumTrafo->switchAA(); 840 841 _obsPool->putEpoch(_epoTime, allObs, peseudoObsIono, refSatMap); 836 842 837 843 return success; … … 877 883 // 878 884 ////////////////////////////////////////////////////////////////////////////// 879 bool t_pppFilter::resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector) { 885 bool t_pppFilter::resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector, 886 const QMap<char, t_pppRefSat*>& refSatMap, 887 const QMap<char, t_pppRefSat*>& refSatMapLastEpoch) { 880 888 bool resetRefSat; 881 889 // reference satellite definition per system … … 884 892 resetRefSat = false; 885 893 char sys = usedSystems[iSys]; 886 t_pppRefSat* refSat = _obsPool->getRefSatMapElement(sys); 887 t_prn newPrn = refSat->prn(); 888 t_prn oldPrn = _obsPool->getRefSatMapElementLastEpoch(sys); 894 t_prn newPrn = refSatMap[sys]->prn(); 895 t_prn oldPrn = refSatMapLastEpoch[sys]->prn(); 889 896 #ifdef BNC_DEBUG_PPP 890 LOG << "oldPrn: " << oldPrn.toString() << " => newPrn: " << newPrn.toString() << endl; 897 if (oldPrn != newPrn) { 898 LOG << "oldRef: " << oldPrn.toString() << " => newRef " << newPrn.toString() << endl; 899 } 891 900 #endif 892 901 vector<t_pppSatObs*>::iterator it = obsVector.begin(); … … 896 905 resetRefSat = true; 897 906 satObs->setAsReference(); 898 } 899 else if (satObs->prn() == oldPrn) { 907 } else if (satObs->prn() == oldPrn) { 900 908 satObs->resetReference(); 901 909 }
Note:
See TracChangeset
for help on using the changeset viewer.