Changeset 10388 in ntrip for trunk/BNC/src/PPP/pppClient.cpp


Ignore:
Timestamp:
Mar 12, 2024, 3:10:17 PM (16 months ago)
Author:
stuerze
Message:

changes regarding PPP

File:
1 edited

Legend:

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

    r10384 r10388  
    6767    }
    6868  }
     69  _offGps = 0.0;
    6970  _offGlo = 0.0;
    7071  _offGal = 0.0;
     
    301302      const t_pppSatObs* satObs = obsVector.at(ii);
    302303      char sys = satObs->prn().system();
    303       if (satObs->isValid() && 
     304      if (satObs->isValid() &&
    304305          (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle) ) {
    305306        ColumnVector rr = satObs->xc().Rows(1,3) - xyzc.Rows(1,3);
     
    337338  return success;
    338339}
     340
     341// Compute A Priori Gps Clock Offset
     342//////////////////////////////////////////////////////////////////////////////
     343double t_pppClient::cmpOffGps(vector<t_pppSatObs*>& obsVector) {
     344
     345  t_lc::type tLC   = t_lc::dummy;
     346  double     offGps = 0.0;
     347
     348  if (_opt->useSystem('G')) {
     349    while (obsVector.size() > 0) {
     350      offGps = 0.0;
     351      double   maxRes      = 0.0;
     352      int      maxResIndex = -1;
     353      unsigned nObs        = 0;
     354      t_prn    maxResPrn;
     355      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     356        const t_pppSatObs* satObs = obsVector.at(ii);
     357        if (satObs->prn().system() == 'G') {
     358          if (tLC == t_lc::dummy) {
     359            tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
     360          }
     361          if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {
     362            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
     363            ++nObs;
     364            offGps += ll;
     365            if (fabs(ll) > fabs(maxRes)) {
     366              maxRes      = ll;
     367              maxResIndex = ii;
     368              maxResPrn   = satObs->prn();
     369            }
     370          }
     371        }
     372      }
     373
     374      if (nObs > 0) {
     375        offGps = offGps / nObs;
     376      }
     377      else {
     378        offGps = 0.0;
     379      }
     380
     381      if (fabs(maxRes) > 100.0) {
     382        LOG << "t_pppClient::cmpOffGps outlier " << maxResPrn.toString() << " " << maxRes << endl;
     383        delete obsVector.at(maxResIndex);
     384        obsVector.erase(obsVector.begin() + maxResIndex);
     385      }
     386      else {
     387        break;
     388      }
     389    }
     390  }
     391  return offGps;
     392}
     393
    339394
    340395// Compute A Priori Glonass Clock Offset
     
    443498  return offGal;
    444499}
    445 
    446500// Compute A Priori BDS Clock Offset
    447501//////////////////////////////////////////////////////////////////////////////
     
    638692    }
    639693
     694    _offGps = cmpOffGps(_obsRover);
    640695    _offGlo = cmpOffGlo(_obsRover);
    641696    _offGal = cmpOffGal(_obsRover);
Note: See TracChangeset for help on using the changeset viewer.