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


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

minor changes

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.