Changeset 10002 in ntrip for trunk


Ignore:
Timestamp:
Mar 15, 2023, 5:37:02 PM (13 months ago)
Author:
stuerze
Message:

minor changes

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

Legend:

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

    r9943 r10002  
    7373  }
    7474
    75   _offGR = 0.0;
    76   _offGE = 0.0;
    77   _offGC = 0.0;
     75  _offGG = 0.0;
    7876  CLIENTS.setLocalData(this);  // CLIENTS takes ownership over "this"
    7977}
     
    357355  return success;
    358356}
     357// Compute A Priori GPS-Glonass Offset
     358//////////////////////////////////////////////////////////////////////////////
     359double t_pppClient::cmpOffGG(vector<t_pppSatObs*>& obsVector) {
     360
     361  t_lc::type tLC   = t_lc::dummy;
     362  double     offGG = 0.0;
     363
     364  if (OPT->useSystem('R')) {
     365
     366    while (obsVector.size() > 0) {
     367      offGG = 0.0;
     368      double   maxRes      = 0.0;
     369      int      maxResIndex = -1;
     370      t_prn    maxResPrn;
     371      unsigned nObs        = 0;
     372      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     373        t_pppSatObs* satObs = obsVector.at(ii);
     374        if (satObs->prn().system() == 'R') {
     375          if (tLC == t_lc::dummy) {
     376            tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
     377          }
     378          if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle)) {
     379            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
     380            ++nObs;
     381            offGG += ll;
     382            if (fabs(ll) > fabs(maxRes)) {
     383              maxRes      = ll;
     384              maxResIndex = ii;
     385              maxResPrn   = satObs->prn();
     386            }
     387          }
     388        }
     389      }
     390
     391      if (nObs > 0) {
     392        offGG = offGG / nObs;
     393      }
     394      else {
     395        offGG = 0.0;
     396      }
     397
     398      if (fabs(maxRes) > 1000.0) {
     399        LOG << "t_pppClient::cmpOffGG outlier " << maxResPrn.toString() << " " << maxRes << endl;
     400        obsVector.erase(obsVector.begin() + maxResIndex);
     401      }
     402      else {
     403        break;
     404      }
     405    }
     406  }
     407
     408  return offGG;
     409}
    359410
    360411//
     
    534585        return finish(failure,5);
    535586      }
     587
     588      _offGG = cmpOffGG(_obsRover);
    536589
    537590      // Prepare Pseudo Observations of the Rover
  • trunk/BNC/src/PPP/pppClient.h

    r9600 r10002  
    3838  const bncAntex*     antex() const {return _antex;}
    3939  const t_pppStation* staRover() const {return _staRover;}
    40   double              offGR() const {return _offGR;}
    41   double              offGE() const {return _offGE;}
    42   double              offGC() const {return _offGC;}
     40  double              offGG() const {return _offGG;}
    4341
    4442  std::ostringstream& log() {return *_log;}
     
    6361  t_irc cmpBancroft(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
    6462                    ColumnVector& xyzc, bool print);
     63  double cmpOffGG(std::vector<t_pppSatObs*>& obsVector);
    6564  t_irc handleRefSatellites(std::vector<t_pppSatObs*>& obsVector);
    6665  void setRefSatellites(std::vector<t_pppSatObs*>& obsVector);
     
    7473  bncAntex*                 _antex;
    7574  t_pppFilter*              _filter;
    76   double                    _offGR;
    77   double                    _offGE;
    78   double                    _offGC;
     75  double                    _offGG;
    7976  std::vector<t_pppSatObs*> _obsRover;
    8077  QMap<char, t_pppRefSat*>  _refSatMap;
  • trunk/BNC/src/PPP/pppFilter.cpp

    r9999 r10002  
    348348      }
    349349      if (preProcessing) {
    350         // for refSats no ambiguity parameter exists
    351         if ((obs->prn() == refPrn)
    352             && (t_lc::toString(maxOutlierLC) == "l1" ||
    353                 t_lc::toString(maxOutlierLC) == "l2")) {
     350        if (obs->prn() == refPrn) {
    354351          _obsPool->setRefSatChangeRequired(sys, true);
    355352          LOG << epoTimeStr << " Outlier ("
     
    357354              << t_lc::toString(maxOutlierLC) << ' ' << obs->prn().toString()
    358355              << ' ' << setw(8) << setprecision(4) << maxOutlier << endl;
    359           break;
    360         } else {
    361           obs->setOutlier();
    362         }
     356          //break;
     357        } //else {obs->setOutlier(); }
    363358      } else {    // fin-processing
    364359        LOG << epoTimeStr << " Outlier " << t_lc::toString(maxOutlierLC) << ' '
     
    366361            << maxOutlier << endl;
    367362        if (par) {
    368           //if ( par->ambResetCandidate() || (OPT->_obsModelType == OPT->DCMcodeBias ||    OPT->_obsModelType == OPT->DCMphaseBias) ) {
     363          if (par->ambResetCandidate() ||
     364              OPT->_obsModelType == OPT->DCMcodeBias ||
     365              OPT->_obsModelType == OPT->DCMphaseBias) {
    369366            resetAmb(par->prn(), obsVector, &QSav, &xSav);
    370           //}
    371           //else {
    372           //  par->setAmbResetCandidate();
    373           //  obs->setOutlier();
    374           //}
     367          }
     368          else {
     369            par->setAmbResetCandidate();
     370            obs->setOutlier();
     371          }
    375372        }
    376373        else {
     
    408405    const vector<t_pppSatObs*> &obsVector, const t_prn &refPrn,
    409406    bool preProcessing) {
    410   const double SLIP = 100.0;
     407  const double SLIP = 20.0;
    411408  char sys = refPrn.system();
    412409  string epoTimeStr = string(_epoTime);
     
    462459          }
    463460        }
    464         /* Check Pre-Fit Residuals
     461        // Check Pre-Fit Residuals
    465462        // -----------------------
    466463        else {
    467           if (refPrn != t_prn()) {
    468             return success;
    469           }
    470464          ColumnVector AA(nPar);
    471465          for (unsigned iPar = 0; iPar < nPar; iPar++) {
     
    486480            }
    487481          }
    488         }*/
     482        }
    489483      }
    490484    }
     
    768762      continue;
    769763    }
    770     _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;
     764    _datumTrafo->updateIndices(sys, iObs + 1);
     765#ifdef BNC_DEBUG_PPP
     766    LOG << "AA Ncols/Nrows: " << AA.Ncols() << "/" << AA.Nrows() << "  nPar: "  << nPar << endl;
     767    LOG << "AA.SubMatrix(1 .. " << iObs+1 << " , 1 .. " <<  nPar << ")" << endl;
     768#endif
    771769    if (_datumTrafo->prepareAA(AA.SubMatrix(1, iObs + 1, 1, nPar), 2)
    772770        != success) {
  • trunk/BNC/src/PPP/pppParlist.cpp

    r9663 r10002  
    6262     _noise   = OPT->_noiseCrd[2];
    6363     break;
    64    case rClkG:
    65      _epoSpec = true;
    66      _sigma0  = OPT->_aprSigClk;
    67      break;
    68    case rClkR:
    69      _epoSpec = true;
    70      _sigma0  = OPT->_aprSigClk;
    71      break;
    72    case rClkE:
    73      _epoSpec = true;
    74      _sigma0  = OPT->_aprSigClk;
    75      break;
    76    case rClkC:
     64   case clkR:
    7765     _epoSpec = true;
    7866     _sigma0  = OPT->_aprSigClk;
     
    8674         const t_pppSatObs* obs = obsVector->at(ii);
    8775         if (obs->prn() == _prn) {
    88            _x0 = floor((obs->obsValue(tLC) - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
     76           double offGG = 0;
     77           if (_prn.system() == 'R' && tLC != t_lc::MW) {
     78             offGG = PPP_CLIENT->offGG();
     79           }
     80           _x0 = floor((obs->obsValue(tLC) - offGG - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
    8981           break;
    9082         }
     
    9284     }
    9385     break;
     86   case offGG:
     87     _epoSpec = true;
     88     _sigma0  = OPT->_aprSigClk;
     89     _x0      = PPP_CLIENT->offGG();
     90     break;     
    9491   case trp:
    9592     _epoSpec = false;
     
    176173    if (tLC == t_lc::GIM) {return 0.0;}
    177174    return (sta->xyzApr()[2] - obs->xc()[2]) / rhoV.NormFrobenius();
    178   case rClkG:
     175  case clkR:
    179176    if (tLC == t_lc::GIM) {return 0.0;}
    180     return (obs->prn().system() == 'G') ? 1.0 : 0.0;
    181   case rClkR:
     177    return 1.0;
     178  case offGG:
    182179    if (tLC == t_lc::GIM) {return 0.0;}
    183180    return (obs->prn().system() == 'R') ? 1.0 : 0.0;
    184   case rClkE:
    185     if (tLC == t_lc::GIM) {return 0.0;}
    186     return (obs->prn().system() == 'E') ? 1.0 : 0.0;
    187   case rClkC:
    188     if (tLC == t_lc::GIM) {return 0.0;}
    189     return (obs->prn().system() == 'C') ? 1.0 : 0.0;
    190181  case amb:
    191182    if      (tLC == t_lc::GIM) {return 0.0;}
     
    310301    ss << "CRD_Z";
    311302    break;
    312   case rClkG:
    313     ss << "REC_CLK  G  ";
    314     break;
    315   case rClkR:
    316     ss << "REC_CLK  R  ";
    317     break;
    318   case rClkE:
    319     ss << "REC_CLK  E  ";
    320     break;
    321   case rClkC:
    322     ss << "REC_CLK  C  ";
     303  case clkR:
     304    ss << "REC_CLK     ";
     305    break;
     306  case offGG:
     307    ss << "OFF_GLO      ";
    323308    break;
    324309  case trp:
     
    674659  }
    675660
    676   // GNSS Receiver Clocks
    677   // --------------------
    678   if (_usedSystems.contains('G')) {
    679     required.push_back(new t_pppParam(t_pppParam::rClkG, t_prn(), t_lc::dummy));
    680   }
    681 
    682   if (_usedSystems.contains('R')) {
    683     required.push_back(new t_pppParam(t_pppParam::rClkR, t_prn(), t_lc::dummy));
    684   }
    685 
    686   if (_usedSystems.contains('E')) {
    687     required.push_back(new t_pppParam(t_pppParam::rClkE, t_prn(), t_lc::dummy));
    688   }
    689 
    690   if (_usedSystems.contains('C')) {
    691     required.push_back(new t_pppParam(t_pppParam::rClkC, t_prn(), t_lc::dummy));
     661  // Receiver Clock
     662  // --------------
     663  required.push_back(new t_pppParam(t_pppParam::clkR, t_prn(), t_lc::dummy));
     664
     665  // GPS-Glonass Clock Offset
     666  // ------------------------
     667  if (OPT->useSystem('R')) {
     668    required.push_back(new t_pppParam(t_pppParam::offGG, t_prn(), t_lc::dummy));
    692669  }
    693670
  • trunk/BNC/src/PPP/pppParlist.h

    r9561 r10002  
    1515class t_pppParam {
    1616 public:
    17   enum e_type {crdX, crdY, crdZ, rClkG, rClkR, rClkE, rClkC, trp, ion, amb,
     17  enum e_type {crdX, crdY, crdZ, clkR, offGG, trp, ion, amb,
    1818               cBiasG1, cBiasR1, cBiasE1, cBiasC1, pBiasG1, pBiasR1, pBiasE1, pBiasC1,
    1919               cBiasG2, cBiasR2, cBiasE2, cBiasC2, pBiasG2, pBiasR2, pBiasE2, pBiasC2};
Note: See TracChangeset for help on using the changeset viewer.