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


Ignore:
Timestamp:
Dec 3, 2021, 12:22:40 PM (2 years ago)
Author:
stuerze
Message:

update regarding PPP

File:
1 edited

Legend:

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

    r9560 r9561  
    356356}
    357357
    358 // Compute A Priori GPS-Glonass Offset
    359 //////////////////////////////////////////////////////////////////////////////
    360 double t_pppClient::cmpOffGR(vector<t_pppSatObs*>& obsVector) {
    361 
    362   t_lc::type tLC   = t_lc::dummy;
    363   double     offGR = 0.0;
    364 
    365   if (_opt->useSystem('R')) {
    366     while (obsVector.size() > 0) {
    367       offGR = 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         const 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             offGR += 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         offGR = offGR / nObs;
    393       }
    394       else {
    395         offGR = 0.0;
    396       }
    397       if (fabs(maxRes) > OPT->_aprSigOGC) {
    398         LOG << "t_pppClient::cmpOffGR outlier " << maxResPrn.toString() << " " << maxRes << endl;
    399         delete obsVector.at(maxResIndex);
    400         obsVector.erase(obsVector.begin() + maxResIndex);
    401       }
    402       else {
    403         break;
    404       }
    405     }
    406   }
    407   return offGR;
    408 }
    409 
    410 // Compute A Priori GPS-Galileo Offset
    411 //////////////////////////////////////////////////////////////////////////////
    412 double t_pppClient::cmpOffGE(vector<t_pppSatObs*>& obsVector) {
    413 
    414   t_lc::type tLC   = t_lc::dummy;
    415   double     offGE = 0.0;
    416 
    417   if (_opt->useSystem('E')) {
    418     while (obsVector.size() > 0) {
    419       offGE = 0.0;
    420       double   maxRes      = 0.0;
    421       int      maxResIndex = -1;
    422       t_prn    maxResPrn;
    423       unsigned nObs        = 0;
    424       for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    425         const t_pppSatObs* satObs = obsVector.at(ii);
    426         if (satObs->prn().system() == 'E') {
    427           if (tLC == t_lc::dummy) {
    428             tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
    429           }
    430           if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {
    431             double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
    432             ++nObs;
    433             offGE += ll;
    434             if (fabs(ll) > fabs(maxRes)) {
    435               maxRes      = ll;
    436               maxResIndex = ii;
    437               maxResPrn   = satObs->prn();
    438             }
    439           }
    440         }
    441       }
    442 
    443       if (nObs > 0) {
    444         offGE = offGE / nObs;
    445       }
    446       else {
    447         offGE = 0.0;
    448       }
    449 
    450       if (fabs(maxRes) > OPT->_aprSigOGE) {
    451         LOG << "t_pppClient::cmpOffGE outlier " << maxResPrn.toString() << " " << maxRes << endl;
    452         delete obsVector.at(maxResIndex);
    453         obsVector.erase(obsVector.begin() + maxResIndex);
    454       }
    455       else {
    456         break;
    457       }
    458     }
    459   }
    460   return offGE;
    461 }
    462 
    463 // Compute A Priori GPS-BDS Offset
    464 //////////////////////////////////////////////////////////////////////////////
    465 double t_pppClient::cmpOffGC(vector<t_pppSatObs*>& obsVector) {
    466 
    467   t_lc::type tLC   = t_lc::dummy;
    468   double     offGC = 0.0;
    469 
    470   if (_opt->useSystem('C')) {
    471     while (obsVector.size() > 0) {
    472       offGC = 0.0;
    473       double   maxRes      = 0.0;
    474       int      maxResIndex = -1;
    475       t_prn    maxResPrn;
    476       unsigned nObs        = 0;
    477       for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    478         const t_pppSatObs* satObs = obsVector.at(ii);
    479         if (satObs->prn().system() == 'C') {
    480           if (tLC == t_lc::dummy) {
    481             tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
    482           }
    483           if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {
    484             double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
    485             ++nObs;
    486             offGC += ll;
    487             if (fabs(ll) > fabs(maxRes)) {
    488               maxRes      = ll;
    489               maxResIndex = ii;
    490               maxResPrn   = satObs->prn();
    491             }
    492           }
    493         }
    494       }
    495 
    496       if (nObs > 0) {
    497         offGC = offGC / nObs;
    498       }
    499       else {
    500         offGC = 0.0;
    501       }
    502 
    503       if (fabs(maxRes) > OPT->_aprSigOGC) {
    504         LOG << "t_pppClient::cmpOffGC outlier " << maxResPrn.toString() << " " << maxRes << endl;
    505         delete obsVector.at(maxResIndex);
    506         obsVector.erase(obsVector.begin() + maxResIndex);
    507       }
    508       else {
    509         break;
    510       }
    511     }
    512   }
    513   return offGC;
    514 }
    515 
    516358//
    517359//////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.