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


Ignore:
Timestamp:
Apr 3, 2023, 4:02:31 PM (13 months ago)
Author:
stuerze
Message:

change from receiver clock offsets to system clocks

File:
1 edited

Legend:

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

    r10018 r10023  
    7373  }
    7474
    75   _offGlo = 0.0;
    76   _offGal = 0.0;
    77   _offBds = 0.0;
    7875  CLIENTS.setLocalData(this);  // CLIENTS takes ownership over "this"
    7976}
     
    357354  return success;
    358355}
    359 // Compute A Priori Glonass Receiver Clock Offset
    360 //////////////////////////////////////////////////////////////////////////////
    361 double t_pppClient::cmpOffGlo(vector<t_pppSatObs*>& obsVector) {
    362 
    363   t_lc::type tLC   = t_lc::dummy;
    364   double     offGlo = 0.0;
    365 
    366   if (OPT->useSystem('R')) {
    367 
    368     while (obsVector.size() > 0) {
    369       offGlo = 0.0;
    370       double   maxRes      = 0.0;
    371       int      maxResIndex = -1;
    372       t_prn    maxResPrn;
    373       unsigned nObs        = 0;
    374       for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    375         t_pppSatObs* satObs = obsVector.at(ii);
    376         if (satObs->prn().system() == 'R') {
    377           if (tLC == t_lc::dummy) {
    378             tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
    379           }
    380           if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle)) {
    381             double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
    382             ++nObs;
    383             offGlo += ll;
    384             if (fabs(ll) > fabs(maxRes)) {
    385               maxRes      = ll;
    386               maxResIndex = ii;
    387               maxResPrn   = satObs->prn();
    388             }
    389           }
    390         }
    391       }
    392 
    393       if (nObs > 0) {
    394         offGlo = offGlo / nObs;
    395       }
    396       else {
    397         offGlo = 0.0;
    398       }
    399 
    400       if (fabs(maxRes) > 1000.0) {
    401         LOG << "t_pppClient::cmpOffGlo outlier " << maxResPrn.toString() << " " << maxRes << endl;
    402         obsVector.erase(obsVector.begin() + maxResIndex);
    403       }
    404       else {
    405         break;
    406       }
    407     }
    408   }
    409 
    410   return offGlo;
    411 }
    412 
    413 // Compute A Priori Galileo Receiver Clock Offset
    414 //////////////////////////////////////////////////////////////////////////////
    415 double 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 BDS Receiver Clock Offset
    469 //////////////////////////////////////////////////////////////////////////////
    470 double 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 }
     356
    520357//
    521358//////////////////////////////////////////////////////////////////////////////
     
    695532        }
    696533      }
    697 
    698       _offGlo = cmpOffGlo(_obsRover);
    699       _offGal = cmpOffGal(_obsRover);
    700       _offBds = cmpOffBds(_obsRover);
    701534
    702535      // Prepare Pseudo Observations of the Rover
Note: See TracChangeset for help on using the changeset viewer.