Changeset 9395 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Mar 30, 2021, 9:59:17 AM (3 years ago)
Author:
stuerze
Message:

update regarding PPP

Location:
trunk/BNC/src/PPP
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppClient.cpp

    r9386 r9395  
    634634          return finish(failure);
    635635        }
    636         if (_obsPool->refSatChanged()) {
     636        if (_obsPool->refSatChanged() &&
     637            _opt->_obsModelType  != t_pppOptions::UncombPPP) {
    637638            epochReProcessing = true;
    638639            continue;
     
    665666      // Epoch re-processing required?
    666667      // -----------------------------
    667       if (_obsPool->refSatChangeRequired()) {//SLIP
     668      if (_obsPool->refSatChangeRequired() && //SLIP
     669          _opt->_obsModelType  != t_pppOptions::UncombPPP) {
    668670        epochReProcessing = true;
    669671        _obsPool->deleteLastEpoch();
     
    777779//////////////////////////////////////////////////////////////////////////////
    778780void t_pppClient::setRefSatellites(std::vector<t_pppSatObs*>& obsVector) {
    779 
     781  t_irc  refSatReDefinition = success;
    780782  // reference satellite definition per system
    781783  for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) {
     
    789791      }
    790792      // reference satellite is unchanged
     793      // ================================
    791794      if      (!_obsPool->refSatChangeRequired(sys) && refSat->prn() == satObs->prn()) {
    792795        refSatDefined = true;
     
    797800      }
    798801      // reference satellite has changed
    799       else if ( _obsPool->refSatChangeRequired(sys) &&
    800                 refSat->prn() != satObs->prn() &&
    801                 !_historicalRefSats[sys].contains(satObs->prn())) {
     802      // ===============================
     803      else if ( _obsPool->refSatChangeRequired(sys) && refSat->prn() != satObs->prn()) {
    802804        if (satObs->prn().system() == sys) {
    803           refSatDefined = true;
    804           obsVector[ii]->setAsReference();
    805           refSat->setPrn(satObs->prn());
     805          if (!_historicalRefSats[sys].contains(satObs->prn())) {
     806            refSatDefined = true;
     807            obsVector[ii]->setAsReference();
     808            refSat->setPrn(satObs->prn());
    806809#ifdef BNC_DEBUG_PPP
    807810          LOG << "=> set refsatprn: "  <<  satObs->prn().toString() << endl;
    808811#endif
     812          }
     813          else if ( _historicalRefSats[sys].contains(satObs->prn())) {
     814            refSatReDefinition = failure;
     815          }
    809816        }
    810817      }
     
    816823      }
    817824    }
     825
     826    if ((!refSatDefined) && (refSatReDefinition == failure)) {
     827      refSat->setPrn(t_prn(sys, 99));
     828      continue;
     829    }
     830
    818831    // reference satellite has to be initialized
     832    // =========================================
    819833    if (!refSatDefined) {
    820834      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     
    823837          continue;
    824838        }
    825         if (satObs->prn().system() == sys &&
    826             !_historicalRefSats[sys].contains(satObs->prn())) {
     839        if (satObs->prn().system() == sys) {
    827840          obsVector[ii]->setAsReference();
    828841          refSat->setPrn(satObs->prn());
     
    838851      }
    839852    }
    840     if (!refSatDefined) {
     853
     854    if (!refSatDefined) { // no observations for that system
    841855      refSat->setPrn(t_prn());
    842856    }
     
    858872    char  sys = it.key();
    859873    t_prn prn = it.value()->prn();
    860     if (prn.number() == 0) {
     874    if      (prn.number() ==  0) { // no obs for that system available
     875      continue;
     876    }
     877    else if (prn.number() == 99) { // refSat re-definition not possible
    861878      return failure;
    862879    }
     
    885902      _historicalRefSats[sys].append(prn);
    886903    }
    887   }
    888 }
     904  }}
    889905
    890906//
  • trunk/BNC/src/PPP/pppFilter.cpp

    r9386 r9395  
    138138        }
    139139      }
     140      if (!obsVector.size()) {continue;}
    140141      if (processSystem(OPT->LCs(sys), obsVector, _refPrn,
    141142                        epoch->pseudoObsIono(), preProcessing) != success) {
     
    174175      }
    175176    }
     177    if (!num) {continue;}
    176178    LOG << epoTimeStr << " SATNUM " << system << ' ' << right << setw(2) << num << endl;
    177179    if (processSystem(OPT->LCs(system), obsVector, _refPrn,
     
    266268          if (tLC == t_lc::GIM) {continue;}
    267269          if (tLC == t_lc::Tz0) {continue;}
     270          ++iObs;
     271          usedObs.push_back(obs);
     272          usedTypes.push_back(tLC);
     273          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     274            const t_pppParam* par = params[iPar];
     275            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
     276          }
     277          ll[iObs] = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1));
     278          PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC));
     279        }
     280      }
     281    }
     282
     283    // pseudo Obs Tropo
     284    // ================
     285    if (OPT->_pseudoObsTropo) {
     286      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     287        t_pppSatObs* obs = obsVector[ii];
     288        if (!obs->isReference()) {continue;}
     289        for (unsigned jj = 0; jj < usedLCs; jj++) {
     290          const t_lc::type tLC = LCs[jj];
     291          if (tLC != t_lc::Tz0) {continue;}
    268292          ++iObs;
    269293          usedObs.push_back(obs);
     
    309333      }
    310334    }
    311     // pseudo Obs Tropo
    312     // ================
    313     if (OPT->_pseudoObsTropo) {
    314       for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    315         t_pppSatObs* obs = obsVector[ii];
    316         if (!obs->isReference()) {continue;}
    317         for (unsigned jj = 0; jj < usedLCs; jj++) {
    318           const t_lc::type tLC = LCs[jj];
    319           if (tLC != t_lc::Tz0) {continue;}
    320           ++iObs;
    321           usedObs.push_back(obs);
    322           usedTypes.push_back(tLC);
    323           for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    324             const t_pppParam* par = params[iPar];
    325             AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
    326           }
    327           ll[iObs] = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1));
    328           PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC));
    329         }
    330       }
    331     }
    332335
    333336    // Check number of observations, truncate matrices
     
    561564}
    562565
    563 // Add innfinite noise to iono
     566// Add infinite noise to iono
    564567////////////////////////////////////////////////////////////////////////////
    565568t_irc t_pppFilter::addNoiseToIono(char sys) {
     
    745748      }
    746749    }
     750    // pseudo Obs Tropo
     751    // ================
     752    if (OPT->_pseudoObsTropo) {
     753      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     754        t_pppSatObs* obs = obsVector[ii];
     755        if (!obs->isReference()) {continue;}
     756        for (unsigned jj = 0; jj < usedLCs; jj++) {
     757          const t_lc::type tLC = LCs[jj];
     758          if (tLC != t_lc::Tz0) {continue;}
     759          ++iObs;
     760          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     761            const t_pppParam* par = params[iPar];
     762            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
     763          }
     764        }
     765      }
     766    }
    747767    _datumTrafo->updateIndices(iObs+1);
    748768    _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist->nPar()), 2);
     
    791811////////////////////////////////////////////////////////////////////////////
    792812void t_pppFilter::initDatumTransformation(const std::vector<t_pppSatObs*>& allObs) {
    793   unsigned realObs = 0;
     813  unsigned trafoObs = 0;
    794814  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    795815    char system = OPT->systems()[iSys];
     
    809829      realUsedLCs -= 1;
    810830    }
    811     realObs += satNum * realUsedLCs;
    812   }
    813   _datumTrafo->setObsNum(realObs);
     831    trafoObs += satNum * realUsedLCs;
     832
     833    if (OPT->_pseudoObsTropo) {
     834      trafoObs += 1;
     835    }
     836
     837  }
     838  _datumTrafo->setObsNum(trafoObs);
    814839  _datumTrafo->setParNum(_parlist->nPar());
    815840  _datumTrafo->initAA();
Note: See TracChangeset for help on using the changeset viewer.