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


Ignore:
Timestamp:
Mar 16, 2023, 10:06:39 AM (13 months ago)
Author:
stuerze
Message:

minor changes

File:
1 edited

Legend:

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

    r10002 r10003  
    7373  }
    7474
    75   _offGG = 0.0;
     75  _offGlo = 0.0;
     76  _offGal = 0.0;
     77  _offBds = 0.0;
    7678  CLIENTS.setLocalData(this);  // CLIENTS takes ownership over "this"
    7779}
     
    357359// Compute A Priori GPS-Glonass Offset
    358360//////////////////////////////////////////////////////////////////////////////
    359 double t_pppClient::cmpOffGG(vector<t_pppSatObs*>& obsVector) {
     361double t_pppClient::cmpOffGlo(vector<t_pppSatObs*>& obsVector) {
    360362
    361363  t_lc::type tLC   = t_lc::dummy;
    362   double     offGG = 0.0;
     364  double     offGlo = 0.0;
    363365
    364366  if (OPT->useSystem('R')) {
    365367
    366368    while (obsVector.size() > 0) {
    367       offGG = 0.0;
     369      offGlo = 0.0;
    368370      double   maxRes      = 0.0;
    369371      int      maxResIndex = -1;
     
    379381            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
    380382            ++nObs;
    381             offGG += ll;
     383            offGlo += ll;
    382384            if (fabs(ll) > fabs(maxRes)) {
    383385              maxRes      = ll;
     
    390392
    391393      if (nObs > 0) {
    392         offGG = offGG / nObs;
     394        offGlo = offGlo / nObs;
    393395      }
    394396      else {
    395         offGG = 0.0;
     397        offGlo = 0.0;
    396398      }
    397399
    398400      if (fabs(maxRes) > 1000.0) {
    399         LOG << "t_pppClient::cmpOffGG outlier " << maxResPrn.toString() << " " << maxRes << endl;
     401        LOG << "t_pppClient::cmpOffGlo outlier " << maxResPrn.toString() << " " << maxRes << endl;
    400402        obsVector.erase(obsVector.begin() + maxResIndex);
    401403      }
     
    406408  }
    407409
    408   return offGG;
    409 }
    410 
     410  return offGlo;
     411}
     412
     413// Compute A Priori GPS-Galileo Offset
     414//////////////////////////////////////////////////////////////////////////////
     415double t_pppClient::cmpOffGal(vector<t_pppSatObs*>& obsVector) {
     416
     417  t_lc::type tLC   = t_lc::dummy;
     418  double     offGal = 0.0;
     419
     420  if (OPT->useSystem('E')) {
     421
     422    while (obsVector.size() > 0) {
     423      offGal = 0.0;
     424      double   maxRes      = 0.0;
     425      int      maxResIndex = -1;
     426      t_prn    maxResPrn;
     427      unsigned nObs        = 0;
     428      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     429        t_pppSatObs* satObs = obsVector.at(ii);
     430        if (satObs->prn().system() == 'E') {
     431          if (tLC == t_lc::dummy) {
     432            tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
     433          }
     434          if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle)) {
     435            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
     436            ++nObs;
     437            offGal += ll;
     438            if (fabs(ll) > fabs(maxRes)) {
     439              maxRes      = ll;
     440              maxResIndex = ii;
     441              maxResPrn   = satObs->prn();
     442            }
     443          }
     444        }
     445      }
     446
     447      if (nObs > 0) {
     448        offGal = offGal / nObs;
     449      }
     450      else {
     451        offGal = 0.0;
     452      }
     453
     454      if (fabs(maxRes) > 1000.0) {
     455        LOG << "t_pppClient::cmpOffGal outlier " << maxResPrn.toString() << " " << maxRes << endl;
     456        obsVector.erase(obsVector.begin() + maxResIndex);
     457      }
     458      else {
     459        break;
     460      }
     461    }
     462  }
     463
     464  return offGal;
     465}
     466
     467
     468// Compute A Priori GPS-BDS Offset
     469//////////////////////////////////////////////////////////////////////////////
     470double t_pppClient::cmpOffBds(vector<t_pppSatObs*>& obsVector) {
     471
     472  t_lc::type tLC   = t_lc::dummy;
     473  double     offBds = 0.0;
     474
     475  if (_opt->useSystem('C')) {
     476    while (obsVector.size() > 0) {
     477      offBds = 0.0;
     478      double   maxRes      = 0.0;
     479      int      maxResIndex = -1;
     480      t_prn    maxResPrn;
     481      unsigned nObs        = 0;
     482      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     483        const t_pppSatObs* satObs = obsVector.at(ii);
     484        if (satObs->prn().system() == 'C') {
     485          if (tLC == t_lc::dummy) {
     486            tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
     487          }
     488          if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {
     489            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
     490            ++nObs;
     491            offBds += ll;
     492            if (fabs(ll) > fabs(maxRes)) {
     493              maxRes      = ll;
     494              maxResIndex = ii;
     495              maxResPrn   = satObs->prn();
     496            }
     497          }
     498        }
     499      }
     500
     501      if (nObs > 0) {
     502        offBds = offBds / nObs;
     503      }
     504      else {
     505        offBds = 0.0;
     506      }
     507
     508      if (fabs(maxRes) >  1000.0) {
     509        LOG << "t_pppClient::cmpOffBds outlier " << maxResPrn.toString() << " " << maxRes << endl;
     510        delete obsVector.at(maxResIndex);
     511        obsVector.erase(obsVector.begin() + maxResIndex);
     512      }
     513      else {
     514        break;
     515      }
     516    }
     517  }
     518  return offBds;
     519}
    411520//
    412521//////////////////////////////////////////////////////////////////////////////
     
    586695      }
    587696
    588       _offGG = cmpOffGG(_obsRover);
     697      _offGlo = cmpOffGlo(_obsRover);
     698      _offGal = cmpOffGal(_obsRover);
     699      _offBds = cmpOffBds(_obsRover);
    589700
    590701      // Prepare Pseudo Observations of the Rover
Note: See TracChangeset for help on using the changeset viewer.