Changeset 10023 in ntrip for trunk


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

change from receiver clock offsets to system clocks

Location:
trunk/BNC/src/PPP
Files:
3 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
  • trunk/BNC/src/PPP/pppParlist.cpp

    r10018 r10023  
    6262     _noise   = OPT->_noiseCrd[2];
    6363     break;
    64    case clkR:
     64   case rClkG:
     65     _epoSpec = true;
     66     _sigma0  = OPT->_aprSigClk;
     67     break;
     68   case rClkR:
     69     _epoSpec = true;
     70     _sigma0  = OPT->_aprSigClk;
     71     break;
     72   case rClkE:
     73     _epoSpec = true;
     74     _sigma0  = OPT->_aprSigClk;
     75     break;
     76   case rClkC:
    6577     _epoSpec = true;
    6678     _sigma0  = OPT->_aprSigClk;
     
    7486         const t_pppSatObs* obs = obsVector->at(ii);
    7587         if (obs->prn() == _prn) {
    76            double offGlo = 0;
    77            if (_prn.system() == 'R' && tLC != t_lc::MW) {
    78              offGlo = PPP_CLIENT->offGlo();
    79            }
    80            double offGal = 0;
    81            if (_prn.system() == 'E' && tLC != t_lc::MW) {
    82              offGal = PPP_CLIENT->offGal();
    83            }
    84            double offBds = 0;
    85            if (_prn.system() == 'C' && tLC != t_lc::MW) {
    86              offBds = PPP_CLIENT->offBds();
    87            }
    88            _x0 = floor((obs->obsValue(tLC) - offGlo - offGal - offBds - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
     88           _x0 = floor((obs->obsValue(tLC) - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
    8989           break;
    9090         }
    9191       }
    9292     }
    93      break;
    94    case offGlo:
    95      _epoSpec = true;
    96      _sigma0  = OPT->_aprSigClk;
    97      _x0      = PPP_CLIENT->offGlo();
    98      break;
    99    case offGal:
    100      _epoSpec = true;
    101      _sigma0  = OPT->_aprSigClk;
    102      _x0      = PPP_CLIENT->offGal();
    103      break;
    104    case offBds:
    105      _epoSpec = true;
    106      _sigma0  = OPT->_aprSigClk;
    107      _x0      = PPP_CLIENT->offBds();
    10893     break;
    10994   case trp:
     
    191176    if (tLC == t_lc::GIM) {return 0.0;}
    192177    return (sta->xyzApr()[2] - obs->xc()[2]) / rhoV.NormFrobenius();
    193   case clkR:
     178  case rClkG:
    194179    if (tLC == t_lc::GIM) {return 0.0;}
    195     return 1.0;
    196   case offGlo:
     180    return (obs->prn().system() == 'G') ? 1.0 : 0.0;
     181  case rClkR:
    197182    if (tLC == t_lc::GIM) {return 0.0;}
    198183    return (obs->prn().system() == 'R') ? 1.0 : 0.0;
    199   case offGal:
     184  case rClkE:
    200185    if (tLC == t_lc::GIM) {return 0.0;}
    201186    return (obs->prn().system() == 'E') ? 1.0 : 0.0;
    202   case offBds:
     187  case rClkC:
    203188    if (tLC == t_lc::GIM) {return 0.0;}
    204189    return (obs->prn().system() == 'C') ? 1.0 : 0.0;
     
    325310    ss << "CRD_Z";
    326311    break;
    327   case clkR:
    328     ss << "REC_CLK     ";
    329     break;
    330   case offGlo:
    331     ss << "OFF_GLO     ";
    332     break;
    333   case offGal:
    334     ss << "OFF_GAL     ";
    335     break;
    336   case offBds:
    337     ss << "OFF_BDS     ";
     312  case rClkG:
     313    ss << "REC_CLK  G  ";
     314    break;
     315  case rClkR:
     316    ss << "REC_CLK  R  ";
     317    break;
     318  case rClkE:
     319    ss << "REC_CLK  E  ";
     320    break;
     321  case rClkC:
     322    ss << "REC_CLK  C  ";
    338323    break;
    339324  case trp:
     
    688673  }
    689674
    690   // Receiver Clock
    691   // --------------
    692   required.push_back(new t_pppParam(t_pppParam::clkR, t_prn(), t_lc::dummy));
    693 
    694   // GLONASS Clock Offset
    695   // --------------------
    696   if ( _usedSystems.contains('R')  &&
    697       (_usedSystems.contains('G') || _usedSystems.contains('E') || _usedSystems.contains('C'))) {
    698     required.push_back(new t_pppParam(t_pppParam::offGlo, t_prn(), t_lc::dummy));
    699   }
    700 
    701   // Galileo Clock Offset
    702   // --------------------
    703   if (_usedSystems.contains('E') && _usedSystems.contains('G')) {
    704     required.push_back(new t_pppParam(t_pppParam::offGal, t_prn(), t_lc::dummy));
    705   }
    706 
    707   // BDS Clock Offset
    708   // ----------------
    709   if (_usedSystems.contains('C')  && (_usedSystems.contains('G') || _usedSystems.contains('E'))) {
    710     required.push_back(new t_pppParam(t_pppParam::offBds, t_prn(), t_lc::dummy));
    711   }
     675  // Receiver Clocks
     676  // ---------------
     677   if (_usedSystems.contains('G')) {
     678     required.push_back(new t_pppParam(t_pppParam::rClkG, t_prn(), t_lc::dummy));
     679   }
     680
     681   if (_usedSystems.contains('R')) {
     682     required.push_back(new t_pppParam(t_pppParam::rClkR, t_prn(), t_lc::dummy));
     683   }
     684
     685   if (_usedSystems.contains('E')) {
     686     required.push_back(new t_pppParam(t_pppParam::rClkE, t_prn(), t_lc::dummy));
     687   }
     688
     689   if (_usedSystems.contains('C')) {
     690     required.push_back(new t_pppParam(t_pppParam::rClkC, t_prn(), t_lc::dummy));
     691   }
    712692
    713693  // Troposphere
  • trunk/BNC/src/PPP/pppParlist.h

    r10003 r10023  
    1515class t_pppParam {
    1616 public:
    17   enum e_type {crdX, crdY, crdZ, clkR, offGlo, offGal, offBds, trp, ion, amb,
     17  enum e_type {crdX, crdY, crdZ, rClkG, rClkR, rClkE, rClkC, trp, ion, amb,
    1818               cBiasG1, cBiasR1, cBiasE1, cBiasC1, pBiasG1, pBiasR1, pBiasE1, pBiasC1,
    1919               cBiasG2, cBiasR2, cBiasE2, cBiasC2, pBiasG2, pBiasR2, pBiasE2, pBiasC2};
Note: See TracChangeset for help on using the changeset viewer.