Changeset 9386 in ntrip for trunk


Ignore:
Timestamp:
Mar 25, 2021, 3:17:35 PM (3 years ago)
Author:
stuerze
Message:

update regarding PPP

Location:
trunk/BNC/src
Files:
16 edited

Legend:

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

    r9288 r9386  
    309309    }
    310310    if (!std::isnan(maxRes) && maxRes < BLUNDER) {
    311       if (print) {
     311      if (print && _numEpoProcessing == 1) {
    312312        LOG.setf(ios::fixed);
    313313        LOG << string(epoTime) << " BANCROFT:"        << ' '
     
    370370        offGR = 0.0;
    371371      }
    372 
    373       if (fabs(maxRes) > 1000.0) {
     372      if (fabs(maxRes) > OPT->_aprSigOGC) {
    374373        LOG << "t_pppClient::cmpOffGR outlier " << maxResPrn.toString() << " " << maxRes << endl;
    375374        delete obsVector.at(maxResIndex);
     
    424423      }
    425424
    426       if (fabs(maxRes) > 1000.0) {
     425      if (fabs(maxRes) > OPT->_aprSigOGE) {
    427426        LOG << "t_pppClient::cmpOffGE outlier " << maxResPrn.toString() << " " << maxRes << endl;
    428427        delete obsVector.at(maxResIndex);
     
    477476      }
    478477
    479       if (fabs(maxRes) > 1000.0) {
     478      if (fabs(maxRes) > OPT->_aprSigOGC) {
    480479        LOG << "t_pppClient::cmpOffGC outlier " << maxResPrn.toString() << " " << maxRes << endl;
    481480        delete obsVector.at(maxResIndex);
     
    529528    _output->_trpStdev = _filter->trpStdev();
    530529
    531     _output->_numSat     = _filter->numSat();
    532     _output->_hDop       = _filter->HDOP();
     530    _output->_numSat   = _filter->numSat();
     531    _output->_hDop     = _filter->HDOP();
    533532    _output->_error = false;
    534533  }
     
    593592void t_pppClient::processEpoch(const vector<t_satObs*>& satObs, t_output* output) {
    594593
    595   _historicalRefSats.clear();
    596594  try {
    597595    initOutput(output);
    598     int num = 0;
    599596    bool epochReProcessing = false;
    600 
     597    _numEpoProcessing = 0;
    601598    do {
    602       num++;
    603       if (num == 1) {
    604         LOG << "\nPPP of Epoch ";
    605         if (!_epoTimeRover.undef()) LOG << string(_epoTimeRover);
    606         LOG << "\n---------------------------------------------------------------\n";
    607       }
    608 
     599      _numEpoProcessing++;
     600      if (_obsPool->refSatChanged()) {
     601        if(_filter->datumTransformation() != success) {
     602          return finish(failure);
     603        }
     604        else {
     605          _obsPool->saveLastEpoRefSats();
     606        }
     607      }
    609608      // Prepare Observations of the Rover
    610609      // ---------------------------------
    611610      if (prepareObs(satObs, _obsRover, _epoTimeRover) != success) {
    612611        return finish(failure);
     612      }
     613
     614      if (_numEpoProcessing == 1) {
     615        LOG << "\nPPP of Epoch ";
     616        if (!_epoTimeRover.undef()) LOG << string(_epoTimeRover);
     617        LOG << "\n---------------------------------------------------------------\n";
    613618      }
    614619
     
    624629      }
    625630
     631      if (_opt->_refSatRequired) {
     632        if (handleRefSatellites(_obsRover) != success) {
     633          _historicalRefSats.clear();
     634          return finish(failure);
     635        }
     636        if (_obsPool->refSatChanged()) {
     637            epochReProcessing = true;
     638            continue;
     639        }
     640      }
     641
    626642      _offGR = cmpOffGR(_obsRover);
    627643      _offGE = cmpOffGE(_obsRover);
    628644      _offGC = cmpOffGC(_obsRover);
    629645
    630       if (_opt->_refSatRequired) {
    631         setRefSatellites(_obsRover);
    632         LOG.setf(ios::fixed);
    633         QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap());
    634         while (it.hasNext()) {
    635           it.next();
    636           char   sys = it.key();
    637           string prn = it.value()->prn().toString();
    638           if (num == 1) {
    639             LOG << "set   ";
    640           }
    641           else {
    642             LOG << "reset ";
    643           }
    644           LOG << string(_epoTimeRover) << " REFSAT  " << sys << ": " << prn << endl;
    645         }
    646       }
    647 
    648 
    649646      // Prepare Pseudo Observations of the Rover
    650647      // ----------------------------------------
     
    656653      }
    657654
    658 
    659655      // Store last epoch of data
    660656      // ------------------------
    661657      _obsPool->putEpoch(_epoTimeRover, _obsRover, _pseudoObsIono);
    662       _obsPool->setHistoricalRefSatList(_historicalRefSats);
    663658
    664659      // Process Epoch in Filter
    665660      // -----------------------
    666       if (_filter->processEpoch(num) != success) {
     661      if (_filter->processEpoch() != success) {
    667662        return finish(failure);
    668663      }
     
    670665      // Epoch re-processing required?
    671666      // -----------------------------
    672       if (_obsPool->refSatChangeRequired()) {
     667      if (_obsPool->refSatChangeRequired()) {//SLIP
    673668        epochReProcessing = true;
    674669        _obsPool->deleteLastEpoch();
    675         QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap());
    676         while (it.hasNext()) {
    677           it.next();
    678           _historicalRefSats.append(it.value()->prn());
    679         }
     670        setHistoricalRefSats();
    680671      }
    681672      else {
    682673        epochReProcessing = false;
    683 
     674        _historicalRefSats.clear();
    684675      }
    685676    } while (epochReProcessing);
     
    789780  // reference satellite definition per system
    790781  for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) {
    791     char system = _opt->systems()[iSys];
     782    char sys = _opt->systems()[iSys];
    792783    bool refSatDefined = false;
    793     t_pppRefSat* refSat = _obsPool->getRefSatMapElement(system);
     784    t_pppRefSat* refSat = _obsPool->getRefSatMapElement(sys);
    794785    for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    795786      t_pppSatObs* satObs = obsVector.at(ii);
    796       if (satObs->eleSat() < _opt->_minEle) {continue;}
     787      if (satObs->eleSat() < _opt->_minEle) {
     788        continue;
     789      }
    797790      // reference satellite is unchanged
    798       if      (!_obsPool->refSatChangeRequired() && refSat->prn() == satObs->prn()) {
     791      if      (!_obsPool->refSatChangeRequired(sys) && refSat->prn() == satObs->prn()) {
    799792        refSatDefined = true;
    800793        obsVector[ii]->setAsReference();
     794#ifdef BNC_DEBUG_PPP
     795        LOG << "=> unchanged refsatprn: "  <<  satObs->prn().toString() << endl;
     796#endif
    801797      }
    802798      // reference satellite has changed
    803       else if ( _obsPool->refSatChangeRequired() && refSat->prn() != satObs->prn() && !_historicalRefSats.contains(satObs->prn())) {
    804         if (satObs->prn().system() == system) {
     799      else if ( _obsPool->refSatChangeRequired(sys) &&
     800                refSat->prn() != satObs->prn() &&
     801                !_historicalRefSats[sys].contains(satObs->prn())) {
     802        if (satObs->prn().system() == sys) {
    805803          refSatDefined = true;
    806804          obsVector[ii]->setAsReference();
    807805          refSat->setPrn(satObs->prn());
     806#ifdef BNC_DEBUG_PPP
     807          LOG << "=> set refsatprn: "  <<  satObs->prn().toString() << endl;
     808#endif
    808809        }
    809810      }
     
    822823          continue;
    823824        }
    824         if (satObs->prn().system() == system) {
     825        if (satObs->prn().system() == sys &&
     826            !_historicalRefSats[sys].contains(satObs->prn())) {
    825827          obsVector[ii]->setAsReference();
    826828          refSat->setPrn(satObs->prn());
     829#ifdef BNC_DEBUG_PPP
     830          LOG << " => set refsatprn: "  <<  satObs->prn().toString() << endl;
     831#endif
    827832          if (OPT->_pseudoObsIono) {
    828833            refSat->setStecValue(satObs->getIonoCodeDelay(t_frequency::G1));
     
    833838      }
    834839    }
    835   }
    836   _obsPool->setRefSatChangeRequired(false);
    837 
     840    if (!refSatDefined) {
     841      refSat->setPrn(t_prn());
     842    }
     843    _obsPool->setRefSatChangeRequired(sys, false);
     844  }
     845}
     846
     847//
     848//////////////////////////////////////////////////////////////////////////////
     849t_irc t_pppClient::handleRefSatellites(std::vector<t_pppSatObs*>& obsVector) {
     850
     851  // set refSats in current epoch
     852  // ============================
     853  setRefSatellites(obsVector); // current epoch
     854  LOG.setf(ios::fixed);
     855  QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap());
     856  while (it.hasNext()) {
     857    it.next();
     858    char  sys = it.key();
     859    t_prn prn = it.value()->prn();
     860    if (prn.number() == 0) {
     861      return failure;
     862    }
     863    QString str;
     864    if (prn == _obsPool->getRefSatMapElementLastEpoch(sys) ||
     865               _obsPool->getRefSatMapElementLastEpoch(sys) == t_prn() )  {
     866      _obsPool->setRefSatChanged(sys, false);
     867      str = " SET   ";
     868    }
     869    else {
     870      _obsPool->setRefSatChanged(sys, true);
     871      str = " RESET ";
     872    }
     873    LOG << string(_epoTimeRover) <<  str.toStdString() << " REFSAT  " << sys << ": " << prn.toString() << endl;
     874  }
     875  return success;
     876}
     877
     878void t_pppClient::setHistoricalRefSats() {
     879  QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap());
     880  while (it.hasNext()) {
     881    it.next();
     882    t_prn prn = it.value()->prn();
     883    char sys = prn.system();
     884    if (_obsPool->refSatChangeRequired(sys)){
     885      _historicalRefSats[sys].append(prn);
     886    }
     887  }
    838888}
    839889
  • trunk/BNC/src/PPP/pppClient.h

    r9288 r9386  
    6464  double cmpOffGE(std::vector<t_pppSatObs*>& obsVector);
    6565  double cmpOffGC(std::vector<t_pppSatObs*>& obsVector);
     66  t_irc handleRefSatellites(std::vector<t_pppSatObs*>& obsVector);
    6667  void setRefSatellites(std::vector<t_pppSatObs*>& obsVector);
     68  void setHistoricalRefSats();
    6769
    6870  t_output*                 _output;
     
    8183  t_tides*                  _tides;
    8284  bool                      _pseudoObsIono;
    83   QList<t_prn>              _historicalRefSats;
     85  int                       _numEpoProcessing;
     86  QMap<char, QList<t_prn>>  _historicalRefSats;
    8487};
    8588
  • trunk/BNC/src/PPP/pppFilter.cpp

    r9088 r9386  
    2727#include "pppObsPool.h"
    2828#include "pppStation.h"
    29 #include "pppClient.h"
    3029
    3130using namespace BNC_PPP;
     
    5150// Process Single Epoch
    5251////////////////////////////////////////////////////////////////////////////
    53 t_irc t_pppFilter::processEpoch(int num) {
     52t_irc t_pppFilter::processEpoch() {
    5453  _numSat     = 0;
    55   _numEpoProcessing = num;
    5654  const double maxSolGap = 60.0;
    5755
     
    8583  _parlist->set(_epoTime, allObs, _obsPool->getRefSatMap());
    8684  const vector<t_pppParam*>& params = _parlist->params();
    87 
     85#ifdef BNC_DEBUG_PPP
     86  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     87    LOG << params[iPar]->toString() << endl;
     88  }
     89#endif
    8890  // Status Vector, Variance-Covariance Matrix
    8991  // -----------------------------------------
     
    9496  _xFlt.ReSize(_parlist->nPar()); _xFlt = 0.0;
    9597  _x0.ReSize(_parlist->nPar());   _x0   = 0.0;
     98
    9699  for (unsigned ii = 0; ii < params.size(); ii++) {
    97     const t_pppParam* par1 = params[ii];
     100    t_pppParam* par1 = params[ii];
     101    if (QFltOld.size() == 0) {
     102      par1->resetIndex();
     103    }
    98104    _x0[ii] = par1->x0();
    99105    int iOld = par1->indexOld();
     
    105111      _xFlt[ii]     = xFltOld[iOld];
    106112      for (unsigned jj = 0; jj < ii; jj++) {
    107         const t_pppParam* par2 = params[jj];
    108         int               jOld = par2->indexOld();
     113        t_pppParam* par2 = params[jj];
     114        int  jOld = par2->indexOld();
    109115        if (jOld >= 0) {
    110116          _QFlt[ii][jj] = QFltOld(iOld+1,jOld+1);
     
    114120  }
    115121  predictCovCrdPart(QFltOld);
    116 
    117   // Init Datum Trafo
    118   // ----------------------------------------
    119   if ((OPT->_obsModelType == OPT->DCMcodeBias   ||
    120        OPT->_obsModelType == OPT->DCMphaseBias) &&(_numEpoProcessing == 1))  {
    121     _numAllUsedLCs = 0;
    122     for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    123       char system = OPT->systems()[iSys];
    124       _numAllUsedLCs += OPT->LCs(system).size();
    125       if (OPT->_pseudoObsIono && epoch->pseudoObsIono() == false) {
    126         _numAllUsedLCs -= 1;  // GIM not used
    127         if (OPT->_pseudoObsTropo) { // if no VTEC values /pseudo obs iono then no pseudo obs tropo
    128           _numAllUsedLCs -= 1;
    129         }
    130       }
    131       int modifyLCs = 0;
    132       if (OPT->_pseudoObsTropo &&
    133           OPT->_pseudoObsIono && epoch->pseudoObsIono() == true) {
    134         modifyLCs  = -1;
    135       }
    136       // max Obs
    137       int maxObs = allObs.size() * (_numAllUsedLCs + modifyLCs);
    138       if (OPT->_pseudoObsIono && epoch->pseudoObsIono() == true) {
    139         maxObs -= 1; // pseudo obs iono with respect to refSat
    140       }
    141       if (OPT->_pseudoObsIono && epoch->pseudoObsIono() == true &&
    142           OPT->_pseudoObsTropo) {
    143         maxObs += 1;   // pseudo obs tropo once per station
    144       }
    145       _datumTrafo->initAA(maxObs, _parlist->nPar());
    146     }
    147   }
    148122
    149123  // Pre-Process Satellite Systems separately
     
    154128    preProcessing = true;
    155129    for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    156       (iSys) ? _datumTrafo->setFirstSystem(false) : _datumTrafo->setFirstSystem(true);
    157       char system = OPT->systems()[iSys];
     130      char sys = OPT->systems()[iSys];
    158131      if (OPT->_refSatRequired) {
    159         _refPrn = (_obsPool->getRefSatMapElement(system))->prn();
    160         if (_obsPool->hasHistoricalRefSat(_refPrn)) {
    161           LOG << epoTimeStr << " Warning: prevent to process erroneous refSat again!";
    162           return failure;
    163         }
    164       }
    165       vector<t_pppSatObs*> obsVector;
     132        _refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
     133      }
     134     vector<t_pppSatObs*> obsVector;
    166135      for (unsigned jj = 0; jj < allObs.size(); jj++) {
    167         if (allObs[jj]->prn().system() == system) {
     136        if (allObs[jj]->prn().system() == sys) {
    168137          obsVector.push_back(allObs[jj]);
    169138        }
    170139      }
    171       if (processSystem(OPT->LCs(system), obsVector, _refPrn,
     140      if (processSystem(OPT->LCs(sys), obsVector, _refPrn,
    172141                        epoch->pseudoObsIono(), preProcessing) != success) {
     142        _xFlt = xFltOld;
     143        _QFlt = QFltOld;
    173144        return failure;
    174145      }
     
    181152      return success;
    182153    }
    183     else if (!_obsPool->refSatChangeRequired() &&
    184              _numEpoProcessing > 1) {
    185       datumTransformation(xFltOld, QFltOld);
     154    else if (!_obsPool->refSatChangeRequired()) {
     155      initDatumTransformation(allObs);
    186156    }
    187157  }
     
    191161  preProcessing = false;
    192162  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
     163    (iSys) ? _datumTrafo->setFirstSystem(false) : _datumTrafo->setFirstSystem(true);
    193164    char system = OPT->systems()[iSys];
    194165    if (OPT->_refSatRequired) {
     
    215186  _parlist->printResult(_epoTime, _QFlt, _xFlt);
    216187  _lastEpoTimeOK = _epoTime;  // remember time of last successful epoch processing
    217 
     188  if (OPT->_refSatRequired) {
     189    _obsPool->saveLastEpoRefSats();
     190  }
    218191  return success;
    219192}
     
    227200                                 bool preProcessing) {
    228201  LOG.setf(ios::fixed);
     202  char sys = refPrn.system();
    229203
    230204  // Detect Cycle Slips
     
    233207    return failure;
    234208  }
    235 
    236   unsigned usedLCs = LCs.size();
     209  if (preProcessing && _obsPool->refSatChangeRequired(sys)) { // from detectCycleSlips()
     210#ifdef BNC_DEBUG_PPP
     211    LOG << "_obsPool->refSatChangeRequired(" << sys << ") from detectCycleSlips()" << endl;
     212#endif
     213    return success;
     214  }
    237215
    238216  ColumnVector               xSav       = _xFlt;
     
    241219  const vector<t_pppParam*>& params     = _parlist->params();
    242220
     221  unsigned usedLCs     = LCs.size();
     222  unsigned realUsedLCs = usedLCs;
    243223  if (OPT->_pseudoObsIono && !pseudoObsIonoAvailable) {
    244     usedLCs -= 1;  // GIM not used
    245     if (OPT->_pseudoObsTropo) { // if no VTEC values /pseudo obs iono then no pseudo obs tropo
    246       usedLCs -= 1;
    247     }
    248   }
    249 
    250   int modifyLCs = 0;
    251   if (OPT->_pseudoObsTropo &&
    252       OPT->_pseudoObsIono && pseudoObsIonoAvailable) {
    253     modifyLCs  = -1;
     224      usedLCs -= 1;  // GIM not used
     225  }
     226  int hlpLCs = 0;
     227  if (OPT->_pseudoObsTropo) {
     228    hlpLCs = -1;
     229    realUsedLCs -= 1;
    254230  }
    255231  // max Obs
    256   unsigned maxObs = obsVector.size() * (usedLCs + modifyLCs);
     232  unsigned maxObs = obsVector.size() * (usedLCs + hlpLCs);
     233  if (OPT->_pseudoObsTropo) {
     234    maxObs += 1;
     235  }
    257236  if (OPT->_pseudoObsIono && pseudoObsIonoAvailable) {
    258237    maxObs -= 1; // pseudo obs iono with respect to refSat
    259   }
    260   if (OPT->_pseudoObsIono && pseudoObsIonoAvailable &&
    261       OPT->_pseudoObsTropo) {
    262     maxObs += 1;   // pseudo obs tropo once per station
    263238  }
    264239
     
    281256    vector<t_pppSatObs*> usedObs;
    282257    vector<t_lc::type>   usedTypes;
     258
     259    // Real Observations
     260    // =================
    283261    for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    284262      t_pppSatObs* obs = obsVector[ii];
    285       unsigned hlp = ii+1;
    286263      if (!obs->outlier()) {
    287264        for (unsigned jj = 0; jj < usedLCs; jj++) {
    288265          const t_lc::type tLC = LCs[jj];
    289           if (tLC == t_lc::GIM &&  obs->isReference()) {continue;}
    290           if (tLC == t_lc::Tz0 && hlp != obsVector.size()) {continue;}
     266          if (tLC == t_lc::GIM) {continue;}
     267          if (tLC == t_lc::Tz0) {continue;}
    291268          ++iObs;
    292269          usedObs.push_back(obs);
     
    302279    }
    303280
    304     if ((preProcessing && ! iOutlier) &&
    305         (OPT->_obsModelType == OPT->DCMcodeBias || OPT->_obsModelType == OPT->DCMphaseBias)) {
    306           _datumTrafo->updateIndices(maxObs);
    307       _datumTrafo->prepareAA(AA, _numEpoProcessing, _parlist->nPar());
    308       if (_obsPool->refSatChangeRequired()) { // from detectCycleSlips()
    309         return success;
     281    if ((!iOutlier) &&
     282        (OPT->_obsModelType == OPT->DCMcodeBias ||
     283         OPT->_obsModelType == OPT->DCMphaseBias  ) &&  (!preProcessing)) {
     284      _datumTrafo->updateIndices(iObs+1);
     285      _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist->nPar()), 1);
     286    }
     287
     288    // Pseudo Obs Iono
     289    // ================
     290    if (OPT->_pseudoObsIono && pseudoObsIonoAvailable) {
     291      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     292        t_pppSatObs* obs = obsVector[ii];
     293        if (!obs->outlier()) {
     294          for (unsigned jj = 0; jj < usedLCs; jj++) {
     295            const t_lc::type tLC = LCs[jj];
     296            if (tLC == t_lc::GIM && !obs->isReference()) {
     297              ++iObs;
     298            } else {continue;}
     299            usedObs.push_back(obs);
     300            usedTypes.push_back(tLC);
     301            for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     302              const t_pppParam* par = params[iPar];
     303              AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
     304            }
     305            ll[iObs] = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1));
     306            PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC));
     307          }
     308        }
     309      }
     310    }
     311    // pseudo Obs Tropo
     312    // ================
     313    if (OPT->_pseudoObsTropo) {
     314      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     315        t_pppSatObs* obs = obsVector[ii];
     316        if (!obs->isReference()) {continue;}
     317        for (unsigned jj = 0; jj < usedLCs; jj++) {
     318          const t_lc::type tLC = LCs[jj];
     319          if (tLC != t_lc::Tz0) {continue;}
     320          ++iObs;
     321          usedObs.push_back(obs);
     322          usedTypes.push_back(tLC);
     323          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     324            const t_pppParam* par = params[iPar];
     325            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
     326          }
     327          ll[iObs] = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1));
     328          PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC));
     329        }
    310330      }
    311331    }
     
    347367      t_pppSatObs* obs = usedObs[maxOutlierIndex];
    348368      t_pppParam* par = 0;
    349       if (!preProcessing) {
    350         LOG << epoTimeStr << " Outlier " << t_lc::toString(maxOutlierLC) << ' '
    351             << obs->prn().toString()                        << ' '
    352             << setw(8) << setprecision(4) << maxOutlier << endl;
    353       }
     369#ifdef BNC_DEBUG_PPP
     370      LOG << epoTimeStr << " Outlier ("
     371          << ((preProcessing) ? "pre-processing) " : "fin-processing) ") << t_lc::toString(maxOutlierLC) << ' '
     372          << obs->prn().toString()                        << ' '
     373          << setw(8) << setprecision(4) << maxOutlier << endl;
     374#endif
    354375      for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    355376        t_pppParam* hlp = params[iPar];
     
    361382      }
    362383      if (preProcessing) {
    363         if      (par && obs->prn() == refPrn) {
    364           _obsPool->setRefSatChangeRequired(true);
    365           break;
    366         }
    367         else if (par && obs->prn() != refPrn) {
    368           par->setAmbResetCandidate();
    369         }
    370       }
    371       else {
     384        // for refSats  no ambiguity parameter exists
     385         if ((obs->prn() == refPrn) &&
     386             (t_lc::toString(maxOutlierLC) == "l1" ||
     387              t_lc::toString(maxOutlierLC) == "l2") ) {
     388           _obsPool->setRefSatChangeRequired(sys, true);
     389         }
     390         else {
     391          if (par) {
     392            par->setAmbResetCandidate();
     393            obs->setOutlier();
     394          }
     395          else {
     396            obs->setOutlier();
     397          }
     398        }
     399      }
     400      else {// fin-processing
    372401        if (par) {
    373           if (par->ambResetCandidate() || _obsPool->hasHistoricalRefSat(par->prn())) {
     402          if (par->ambResetCandidate()) {
    374403            resetAmb(par->prn(), obsVector, &QSav, &xSav);
    375404          }
     
    391420          for (unsigned ii = 0; ii < usedObs.size(); ii++) {
    392421            const t_lc::type tLC = usedTypes[ii];
    393             t_pppSatObs*        obs = usedObs[ii];
     422            t_pppSatObs* obs = usedObs[ii];
    394423            if (tLC == LCs[jj]) {
    395424              obs->setRes(tLC, vv[ii]);
    396425              LOG << epoTimeStr << " RES "
    397                   << left << setw(3) << t_lc::toString(tLC) << right << ' '
    398                   << obs->prn().toString().substr(0,3) << ' '
    399                   << setw(8) << setprecision(4) << vv[ii] << endl;
     426                  << left << setw(3) << t_lc::toString(tLC) << right << ' ';
     427              if (t_lc::toString(tLC) == "Tz0") {LOG << sys << "  ";}
     428              else {LOG << obs->prn().toString();}
     429              LOG << setw(8) << setprecision(4) << vv[ii] << endl;
    400430            }
    401431          }
     
    405435    }
    406436  }
    407 
    408437  return success;
    409438}
     
    415444                                    const t_prn& refPrn,
    416445                                    bool preProcessing) {
    417   if (_obsPool->hasHistoricalRefSat(refPrn)) {
    418     return success;
    419   }
    420 
    421   //double                  SLIP       = 20.0;  // slip threshold
    422   double                  SLIP       = 200.0;  // slip threshold deactivated
    423   string                  epoTimeStr = string(_epoTime);
     446
     447  const double SLIP = 20.0;
     448  char sys = refPrn.system();
     449  string epoTimeStr = string(_epoTime);
    424450  const vector<t_pppParam*>& params  = _parlist->params();
    425451
     
    430456        const t_pppSatObs* obs = obsVector[iObs];
    431457
    432         if (preProcessing && obs->prn() != refPrn) {continue;}
    433 
    434458        // Check set Slips and Jump Counters
    435459        // ---------------------------------
    436460        bool slip = false;
     461
     462        // in pre-processing only the reference satellite has to be checked
     463        if (preProcessing && obs->prn() != refPrn) {
     464          continue;
     465        }
     466
    437467        if (obs->slip()) {
    438468          LOG << epoTimeStr  << "cycle slip set (obs) " << obs->prn().toString()  << endl;
     
    460490        if (slip) {
    461491          if (preProcessing) {
    462             _obsPool->setRefSatChangeRequired(true);
     492            _obsPool->setRefSatChangeRequired(sys, true);
    463493          }
    464494          else {
     
    474504            AA[iPar] = par->partial(_epoTime, obs, tLC, refPrn);
    475505          }
    476 
    477506          double ll = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA);
    478507          double vv = DotProduct(AA, _xFlt) - ll;
    479 
    480508          if (fabs(vv) > SLIP) {
     509            LOG << epoTimeStr << " cycle slip detected " << t_lc::toString(tLC) << ' '
     510              << obs->prn().toString() << ' ' << setw(8) << setprecision(4) << vv << endl;
    481511            if (preProcessing) {
    482               _obsPool->setRefSatChangeRequired(true);
     512              _obsPool->setRefSatChangeRequired(sys, true);
    483513            }
    484514            else {
    485               LOG << epoTimeStr << " cycle slip detected " << t_lc::toString(tLC) << ' '
    486                   << obs->prn().toString() << ' ' << setw(8) << setprecision(4) << vv << endl;
    487515              resetAmb(obs->prn(), obsVector);
    488516            }
     
    533561}
    534562
     563// Add innfinite noise to iono
     564////////////////////////////////////////////////////////////////////////////
     565t_irc t_pppFilter::addNoiseToIono(char sys) {
     566
     567  t_irc irc = failure;
     568  vector<t_pppParam*>& params = _parlist->params();
     569  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     570    t_pppParam* par = params[iPar];
     571    if (par->type() == t_pppParam::ion && par->prn().system() == sys) {
     572      int ind = par->indexNew();
     573      LOG << string(_epoTime) << " ADD IONO_NOISE TO "  <<  par->prn().toString() << endl;
     574      par->setIndex(ind);
     575      _QFlt(ind+1,ind+1) += par->sigma0() * par->sigma0();
     576      irc = success;
     577    }
     578  }
     579
     580  return irc;
     581}
     582
    535583// Compute various DOP Values
    536584////////////////////////////////////////////////////////////////////////////
     
    617665// Compute datum transformation
    618666////////////////////////////////////////////////////////////////////////////
    619 void t_pppFilter::datumTransformation(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld) {
     667t_irc t_pppFilter::datumTransformation() {
     668  t_pppObsPool::t_epoch* epoch = _obsPool->lastEpoch();
     669  if (!epoch) {LOG << "!epoch" << endl;
     670    return failure;
     671  }
     672  else {
     673    LOG.setf(ios::fixed);
     674    LOG << string(epoch->epoTime()) << " DATUM TRANSFORMATION " << endl;
     675  }
     676  vector<t_pppSatObs*>& allObs = epoch->obsVector();
     677
     678  // reset old and set new refSats in last epoch (ambiguities)
     679  // ========================================================
     680  if (resetRefSatellitesLastEpoch(allObs) != true) {
     681    return failure;
     682  }
     683
     684  // set AA2
     685  // =======
     686  _parlist->set(epoch->epoTime(), allObs, _obsPool->getRefSatMap());
     687  const vector<t_pppParam*>& params = _parlist->params();
     688#ifdef BNC_DEBUG_PPP
     689  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     690    LOG << params[iPar]->toString() << "\t\t" << endl;
     691  }
     692#endif
     693  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
     694    (iSys) ? _datumTrafo->setFirstSystem(false) : _datumTrafo->setFirstSystem(true);
     695    char sys = OPT->systems()[iSys];
     696    t_prn refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
     697#ifdef BNC_DEBUG_PPP
     698    LOG << "refPrn: " << refPrn.toString() << endl;
     699#endif
     700    vector<t_pppSatObs*> obsVector;
     701    for (unsigned jj = 0; jj < allObs.size(); jj++) {
     702      if (allObs[jj]->prn().system() == sys) {
     703        obsVector.push_back(allObs[jj]);
     704      }
     705    }
     706
     707    vector<t_lc::type> LCs = OPT->LCs(sys);
     708    unsigned usedLCs = LCs.size();
     709    unsigned realUsedLCs = usedLCs;
     710    if (OPT->_pseudoObsIono && !epoch->pseudoObsIono()) {
     711        usedLCs -= 1;  // GIM not used
     712    }
     713    int hlpLCs = 0;
     714    if (OPT->_pseudoObsTropo) {
     715      hlpLCs = -1;
     716      realUsedLCs -= 1;
     717    }
     718    // max Obs
     719    unsigned maxObs = obsVector.size() * (usedLCs + hlpLCs);
     720    if (OPT->_pseudoObsTropo) {
     721      maxObs += 1;
     722    }
     723    if (OPT->_pseudoObsIono && epoch->pseudoObsIono()) {
     724      maxObs -= 1; // pseudo obs iono with respect to refSat
     725    }
     726
     727    Matrix  AA(maxObs, _parlist->nPar());
     728
     729    // Real Observations
     730    // -----------------
     731    int iObs = -1;
     732    for (unsigned ii = 0; ii < obsVector.size(); ii++) {
     733      t_pppSatObs* obs = obsVector[ii];
     734      if (!obs->outlier()) {
     735        for (unsigned jj = 0; jj < usedLCs; jj++) {
     736          const t_lc::type tLC = LCs[jj];
     737          if (tLC == t_lc::GIM) {continue;}
     738          if (tLC == t_lc::Tz0) {continue;}
     739          ++iObs;
     740          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     741            const t_pppParam* par = params[iPar];
     742            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
     743          }
     744        }
     745      }
     746    }
     747    _datumTrafo->updateIndices(iObs+1);
     748    _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist->nPar()), 2);
     749  }
     750
     751  // Datum Transformation
     752  // ====================
     753#ifdef BNC_DEBUG_PPP
     754      LOG << "AA1\n"; _datumTrafo->printMatrix(_datumTrafo->AA1(), _datumTrafo->obsNum(), _datumTrafo->parNum());
     755      LOG << "AA2\n"; _datumTrafo->printMatrix(_datumTrafo->AA2(), _datumTrafo->obsNum(), _datumTrafo->parNum());
     756#endif
    620757  Matrix D21 = _datumTrafo->computeTrafoMatrix();
     758#ifdef BNC_DEBUG_PPP
     759      LOG << "D21" << endl; _datumTrafo->printMatrix(D21, _datumTrafo->parNum(), _datumTrafo->parNum());
     760#endif
     761  ColumnVector    xFltOld = _xFlt;
     762  SymmetricMatrix QFltOld = _QFlt;
     763
    621764  _QFlt << D21 * QFltOld * D21.t();
    622   _xFlt = D21 * xFltOld;
    623 }
    624 
    625 
    626 // Reset Ambiguity Parameter (cycle slip)
    627 ////////////////////////////////////////////////////////////////////////////
    628 t_irc t_pppFilter::addInfiniteNoise(t_pppParam::e_type para) {
    629   t_irc irc = failure;
    630   vector<t_pppParam*>& params = _parlist->params();
    631   for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    632     t_pppParam* par = params[iPar];
    633     if (par->type() == para) {
    634       int ind = par->indexNew();
    635       if (ind < 0) {
    636         return irc;
    637       }
    638       _QFlt(ind+1,ind+1) += par->sigma0() * par->sigma0();
    639       irc = success;
    640     }
    641   }
    642   return irc;
    643 }
     765  _xFlt =  D21 * xFltOld;
     766
     767#ifdef BNC_DEBUG_PPP
     768  LOG << "xFltOld:\n" << xFltOld << endl;
     769  LOG << "xFlt   :\n" << _xFlt   << endl;
     770#endif
     771
     772  // Reset Ambiguities after Datum Transformation
     773  // ============================================
     774  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
     775    char sys = OPT->systems()[iSys];
     776    t_irc irc = resetAmb(_obsPool->getRefSatMapElementLastEpoch(sys), allObs);
     777    if (OPT->_obsModelType == OPT->DCMcodeBias) {
     778      if (irc == success) {
     779        addNoiseToIono(sys);}
     780    }
     781  }
     782
     783  // switch AA2 to AA1
     784  // =================
     785  _datumTrafo->switchAA();
     786
     787  return success;
     788}
     789
     790// Init datum transformation
     791////////////////////////////////////////////////////////////////////////////
     792void t_pppFilter::initDatumTransformation(const std::vector<t_pppSatObs*>& allObs) {
     793  unsigned realObs = 0;
     794  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
     795    char system = OPT->systems()[iSys];
     796    int satNum = 0;
     797    for (unsigned jj = 0; jj < allObs.size(); jj++) {
     798      if (allObs[jj]->prn().system() == system) {
     799        satNum++;
     800      }
     801    }
     802    // all LCs
     803    unsigned realUsedLCs = OPT->LCs(system).size();
     804    // exclude pseudo obs GIM
     805    if (OPT->_pseudoObsIono) {
     806      realUsedLCs -= 1;
     807    }
     808    if (OPT->_pseudoObsTropo) {
     809      realUsedLCs -= 1;
     810    }
     811    realObs += satNum * realUsedLCs;
     812  }
     813  _datumTrafo->setObsNum(realObs);
     814  _datumTrafo->setParNum(_parlist->nPar());
     815  _datumTrafo->initAA();
     816}
     817
     818//
     819//////////////////////////////////////////////////////////////////////////////
     820bool t_pppFilter::resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector) {
     821
     822  bool resetRefSat = false;
     823  // reference satellite definition per system
     824  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
     825    char sys = OPT->systems()[iSys];
     826    t_pppRefSat* refSat = _obsPool->getRefSatMapElement(sys);
     827    t_prn newPrn = refSat->prn();
     828    t_prn oldPrn = _obsPool->getRefSatMapElementLastEpoch(sys);
     829#ifdef BNC_DEBUG_PPP
     830    LOG << "oldPrn: " << oldPrn.toString() << " => newPrn: " << newPrn.toString() << endl;
     831#endif
     832    vector<t_pppSatObs*>::iterator it = obsVector.begin();
     833    while (it != obsVector.end()) {
     834      t_pppSatObs* satObs = *it;
     835      if      (satObs->prn() == newPrn) {
     836        resetRefSat = true;
     837        satObs->setAsReference();
     838      }
     839      else if (satObs->prn() == oldPrn) {
     840        satObs->resetReference();
     841      }
     842     it++;
     843    }
     844  }
     845  return resetRefSat;
     846}
  • trunk/BNC/src/PPP/pppFilter.h

    r9304 r9386  
    88#include "bnctime.h"
    99#include "t_prn.h"
     10#include "pppClient.h"
    1011
    1112namespace BNC_PPP {
     
    2021  ~t_pppFilter();
    2122
    22   t_irc processEpoch(int num);
     23  t_irc processEpoch();
    2324
    24   void datumTransformation(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld);
     25  t_irc datumTransformation();
     26  void initDatumTransformation(const std::vector<t_pppSatObs*>& allObs);
    2527
    2628  const ColumnVector&    x() const {return _xFlt;}
     
    8183    void setFirstSystem(bool firstSys) {_firstSys = firstSys;}
    8284    bool firstSystem() {return _firstSys;}
    83     void updateIndices(int maxObs) {
     85    void updateIndices(int maxObsSys) {
    8486      if (firstSystem()) {
    8587        initIndices();
     
    8890        _firstRow = _lastRow + 1;
    8991      }
    90       _lastRow += maxObs;
     92      _lastRow += maxObsSys;
     93
    9194    };
    92     void initAA(int maxObs, int numPar) {
    93       _AA1.ReSize(maxObs, numPar); _AA1 = 0.0;
    94       _AA2.ReSize(maxObs, numPar); _AA2 = 0.0;
     95    void setObsNum(int maxObs) {_maxObs = maxObs;}
     96    void setParNum(int numPar) {_numPar = numPar;}
     97    int obsNum() {return _maxObs;}
     98    int parNum() {return _numPar;}
     99    const Matrix& AA1() {return _AA1;}
     100    const Matrix& AA2() {return _AA2;}
     101
     102    void initAA() {
     103      _AA1.ReSize(_maxObs, _numPar); _AA1 = 0.0;
     104      _AA2.ReSize(_maxObs, _numPar); _AA2 = 0.0;
    95105    }
    96     void prepareAA(const Matrix& AA, int numEpoProcessing, int nPar) {
     106
     107    void prepareAA(const Matrix& AA, int ind) {
    97108      Matrix* Prep = &_AA2;
    98       if (numEpoProcessing == 1) {
     109      if (ind == 1) {
    99110        Prep = &_AA1;
    100111      }
    101       Prep->SubMatrix(_firstRow, _lastRow, 1, nPar) << AA;
     112      Prep->SubMatrix(_firstRow, _lastRow, 1, _numPar) << AA;
     113    }
     114    void switchAA() {
     115      _AA1 = _AA2;
     116    }
     117    Matrix&  getAA(int ind) {
     118      if (ind == 1) {
     119          return _AA1;
     120      }
     121      return _AA2;
     122    }
     123    Matrix computeTrafoMatrix() {
     124      Matrix D21 = ((_AA2.t() * _AA2).i()) * _AA2.t() * _AA1;
     125      return D21;
     126    }
     127    void printMatrix(const Matrix& X, int nRow, int nCol) {
     128      for (int rr = 0; rr < nRow; rr++) {
     129        for (int cc = 0; cc < nCol; cc++) {
     130          LOG << setw(6) << setprecision(3) << X[rr][cc] << " ;";
     131        }
     132        LOG << endl;
     133      }
     134      LOG << endl;
    102135    }
    103136
    104     Matrix computeTrafoMatrix() {
    105       Matrix D21 = (_AA2.t() * _AA2).i() * _AA2.t() * _AA1;
    106       return D21;
    107     }
    108 
    109     static void printMatrix(const Matrix& X, int nRow, int nCol) {
    110       for (int rr = 0; rr < nRow; rr++) {
    111         for (int cc = 0; cc < nCol; cc++) {
    112           cout << setw(7) << setprecision(4) << X[rr][cc] << " ";
    113         }
    114         cout << endl;      }
    115       cout << endl;
    116     }
    117     int     _firstRow;
    118     int     _lastRow;
    119     Matrix  _AA1;
    120     Matrix  _AA2;
    121     bool    _firstSys;
     137    int               _firstRow;
     138    int               _lastRow;
     139    Matrix            _AA1;
     140    Matrix            _AA2;
     141    bool              _firstSys;
     142    int               _maxObs;
     143    int               _numPar;
     144    QMap<char, t_prn> _refSatMapPseudoObs;
    122145  };
    123146
     
    140163  void predictCovCrdPart(const SymmetricMatrix& QFltOld);
    141164
    142   t_irc addInfiniteNoise(t_pppParam::e_type para);
     165  t_irc addNoiseToIono(char sys);
     166
     167  bool resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector);
    143168
    144169  bncTime         _epoTime;
     
    151176  t_slip          _slips[t_prn::MAXPRN+1];
    152177  int             _numSat;
    153   int             _numEpoProcessing;
    154   int             _numAllUsedLCs;
    155178  t_dop           _dop;
    156179  bncTime         _firstEpoTime;
  • trunk/BNC/src/PPP/pppObsPool.cpp

    r8956 r9386  
    5050  }
    5151  _vTec = 0;
    52   _refSatChangeRequired = false;
     52  _refSatChangeRequiredMap['G'] = false;
     53  _refSatChangeRequiredMap['R'] = false;
     54  _refSatChangeRequiredMap['E'] = false;
     55  _refSatChangeRequiredMap['C'] = false;
     56
    5357}
    5458
  • trunk/BNC/src/PPP/pppObsPool.h

    r8956 r9386  
    55#include <deque>
    66#include <QMap>
     7#include <iostream>
    78#include "pppSatObs.h"
    89#include "bnctime.h"
     
    5758  }
    5859
    59   void initRefSatMapElement(char system) {
    60     _refSatMap[system] = new t_pppRefSat();
    61   }
     60  // RefSatMap of the current epoch
     61  // ==============================
     62  void initRefSatMapElement(char system) {_refSatMap[system] = new t_pppRefSat();}
    6263  void clearRefSatMap() {
    6364    QMapIterator<char, t_pppRefSat*> it(_refSatMap);
     
    6869    _refSatMap.clear();
    6970  }
    70   t_pppRefSat* getRefSatMapElement(char system) {
    71     return _refSatMap[system];
     71  QMap<char, t_pppRefSat*> getRefSatMap() {return _refSatMap;}
     72  t_pppRefSat* getRefSatMapElement(char sys) {return _refSatMap[sys];}
     73
     74
     75  // RefSatMap of the last epoch
     76  // ===========================
     77  QMap<char, t_prn> getRefSatMapLastEpoch() {return _refSatMapLastEpoch;}
     78  t_prn getRefSatMapElementLastEpoch(char sys) {return _refSatMapLastEpoch[sys];}
     79  void setRefSatMapElementLastEpoch(char sys, t_prn prn) {_refSatMapLastEpoch[sys] = prn;}
     80  void saveLastEpoRefSats() {
     81    QMapIterator<char, t_pppRefSat*> it(getRefSatMap());
     82    while (it.hasNext()) {
     83      it.next();
     84      t_prn prn = it.value()->prn();
     85      setRefSatMapElementLastEpoch(prn.system(), prn);
     86    };
    7287  }
    73   QMap<char, t_pppRefSat*> getRefSatMap() {return _refSatMap;}
    7488
    75   void setRefSatChangeRequired(bool refSatChangeRequired) {
    76     _refSatChangeRequired = refSatChangeRequired;
     89  // RefSat change required in current epoch
     90  // =======================================
     91  void setRefSatChangeRequired(char sys, bool refSatChangeRequired) {
     92    _refSatChangeRequiredMap[sys] = refSatChangeRequired;
    7793  }
    78   bool refSatChangeRequired() {return _refSatChangeRequired;}
     94  bool refSatChangeRequired() {
     95    QMapIterator<char, bool> it(_refSatChangeRequiredMap);
     96      while (it.hasNext()) {
     97        it.next();
     98        if (it.value() == true) {
     99          return true;
     100        }
     101      }
     102    return false;
     103  }
     104  bool refSatChangeRequired(char sys) {
     105    return _refSatChangeRequiredMap[sys];
     106  }
    79107
    80   void setHistoricalRefSatList(QList<t_prn>& historicalRefSats) {_historicalRefSats = historicalRefSats;}
    81 
    82   bool hasHistoricalRefSat(t_prn prn) {return _historicalRefSats.contains(prn);}
     108  // RefSat changed in current epoch (different from last epoch)
     109  // ===========================================================
     110  void setRefSatChanged(char sys, bool refSatChanged) {
     111    _refSatChangedMap[sys] = refSatChanged;
     112  }
     113  bool refSatChanged() {
     114    QMapIterator<char, bool> it(_refSatChangedMap);
     115      while (it.hasNext()) {
     116        it.next();
     117        if (it.value() == true) {
     118          return true;
     119        }
     120      }
     121    return false;
     122  }
     123  bool refSatChanged(char sys) {
     124    return _refSatChangedMap[sys];
     125  }
    83126
    84127 private:
     
    88131  std::deque<t_epoch*>     _epochs;
    89132  QMap<char, t_pppRefSat*> _refSatMap;
    90   bool                     _refSatChangeRequired;
    91   QList<t_prn>             _historicalRefSats;
     133  QMap<char, bool>         _refSatChangeRequiredMap;
     134  QMap<char, bool>         _refSatChangedMap;
     135  QMap<char, t_prn>        _refSatMapLastEpoch;
    92136};
    93137
  • trunk/BNC/src/PPP/pppParlist.cpp

    r9303 r9386  
    9494   case offGR:
    9595     _epoSpec = true;
    96      _sigma0  = 1000.0;
     96     _sigma0  = OPT->_aprSigOGR;
    9797     _x0      = PPP_CLIENT->offGR();
    9898     break;
    9999   case offGE:
    100100     _epoSpec = true;
    101      _sigma0  = 1000.0;
     101     _sigma0  = OPT->_aprSigOGE;
    102102     _x0      = PPP_CLIENT->offGE();
    103103     break;
    104104   case offGC:
    105105     _epoSpec = true;
    106      _sigma0  = 1000.0;
     106     _sigma0  = OPT->_aprSigOGC;
    107107     _x0      = PPP_CLIENT->offGC();
    108108     break;
     
    113113     break;
    114114    case ion:
    115      _epoSpec = false;
    116      _sigma0  = OPT->_aprSigIon;
    117      _noise   = OPT->_noiseIon;
    118      break;
    119    case cBias1:
    120    case cBias2:
    121      _epoSpec = false;
     115      _epoSpec = true;
     116      _sigma0  = OPT->_aprSigIon;
     117     break;
     118   case cBiasG1:   case cBiasR1:   case cBiasE1:   case cBiasC1:
     119   case cBiasG2:   case cBiasR2:   case cBiasE2:   case cBiasC2:
     120     _epoSpec = true;
    122121     _sigma0  = OPT->_aprSigCodeBias;
    123      _noise   = OPT->_noiseCodeBias;
    124      break;
    125    case pBias1:
    126    case pBias2:
    127      _epoSpec = false;
     122     break;
     123   case pBiasG1:   case pBiasR1:   case pBiasE1:   case pBiasC1:
     124   case pBiasG2:   case pBiasR2:   case pBiasE2:   case pBiasC2:
     125     _epoSpec = true;
    128126     _sigma0  = OPT->_aprSigPhaseBias;
    129      _noise   = OPT->_noisePhaseBias;
    130127     break;
    131128  }
     
    186183             (OPT->_obsModelType == OPT->DCMcodeBias  && !obs->isReference()) ||
    187184             (OPT->_obsModelType == OPT->DCMphaseBias && !obs->isReference())   ) {
     185
    188186      if (obs->prn() == _prn) {
    189187        if      (tLC == _tLC) {
     
    236234    }
    237235    break;
    238   case cBias1:
    239     if  (tLC == t_lc::c1) {
    240       return 1.0;
    241     }
    242     else {
    243       return 0.0;
    244     }
    245     break;
    246   case cBias2:
    247      if (tLC == t_lc::c2) {
    248       return 1.0;
    249     }
    250     else {
    251       return 0.0;
    252     }
    253     break;
    254   case pBias1:
    255     if  (tLC == t_lc::l1) {
    256       return 1.0;
    257     }
    258     else {
    259       return 0.0;
    260     }
    261     break;
    262   case pBias2:
    263     if  (tLC == t_lc::l2) {
    264       return 1.0;
    265     }
    266     else {
    267       return 0.0;
    268     }
     236  case cBiasG1:
     237    if ((obs->prn().system() == 'G') && (tLC == t_lc::c1)) {return 1.0;} else {return 0.0;}
     238    break;
     239  case cBiasR1:
     240    if ((obs->prn().system() == 'R') && (tLC == t_lc::c1)) {return 1.0;} else {return 0.0;}
     241    break;
     242  case cBiasE1:
     243    if ((obs->prn().system() == 'E') && (tLC == t_lc::c1)) {return 1.0;} else {return 0.0;}
     244    break;
     245  case cBiasC1:
     246    if ((obs->prn().system() == 'C') && (tLC == t_lc::c1)) {return 1.0;} else {return 0.0;}
     247    break;
     248  case cBiasG2:
     249    if ((obs->prn().system() == 'G') && (tLC == t_lc::c2)) {return 1.0;} else {return 0.0;}
     250    break;
     251  case cBiasR2:
     252    if ((obs->prn().system() == 'R') && (tLC == t_lc::c2)) {return 1.0;} else {return 0.0;}
     253    break;
     254  case cBiasE2:
     255    if ((obs->prn().system() == 'E') && (tLC == t_lc::c2)) {return 1.0;} else {return 0.0;}
     256        break;
     257  case cBiasC2:
     258    if ((obs->prn().system() == 'C') && (tLC == t_lc::c2)) {return 1.0;} else {return 0.0;}
     259    break;
     260  case pBiasG1:
     261    if ((obs->prn().system() == 'G') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
     262    break;
     263  case pBiasR1:
     264    if ((obs->prn().system() == 'R') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
     265    break;
     266  case pBiasE1:
     267    if ((obs->prn().system() == 'E') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
     268    break;
     269  case pBiasC1:
     270    if ((obs->prn().system() == 'C') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
     271    break;
     272  case pBiasG2:
     273    if ((obs->prn().system() == 'G') && (tLC == t_lc::l2)) {return 1.0;} else {return 0.0;}
     274    break;
     275  case pBiasR2:
     276    if ((obs->prn().system() == 'R') && (tLC == t_lc::l2)) {return 1.0;} else {return 0.0;}
     277    break;
     278  case pBiasE2:
     279    if ((obs->prn().system() == 'E') && (tLC == t_lc::l2)) {return 1.0;} else {return 0.0;}
     280    break;
     281  case pBiasC2:
     282    if ((obs->prn().system() == 'C') && (tLC == t_lc::l2)) {return 1.0;} else {return 0.0;}
     283    break;
     284
    269285  }
    270286  return 0.0;
     
    286302    break;
    287303  case clkR:
    288     ss << "REC_CLK    ";
     304    ss << "REC_CLK     ";
    289305    break;
    290306  case offGR:
    291     ss << "OGR        ";
     307    ss << "OGR         ";
    292308    break;
    293309  case offGE:
    294     ss << "OGE        ";
     310    ss << "OGE         ";
    295311    break;
    296312  case offGC:
    297     ss << "OGC        ";
     313    ss << "OGC         ";
    298314    break;
    299315  case trp:
    300     ss << "TRP        ";
     316    ss << "TRP         ";
    301317    break;
    302318  case amb:
     
    306322    ss << "ION  " << left << setw(3) << t_lc::toString(_tLC) << right << ' ' << _prn.toString();
    307323    break;
    308   case cBias1:
    309   case cBias2:
    310   case pBias1:
    311   case pBias2:
    312     ss << "BIAS " << left << setw(3) << t_lc::toString(_tLC) << right << ' ' << "REC";
     324  case cBiasG1:  case pBiasG1:
     325  case cBiasG2:  case pBiasG2:
     326    ss << "BIA  " << left << setw(3) << t_lc::toString(_tLC) << right << " G  ";
     327    break;
     328  case cBiasR1:  case pBiasR1:
     329  case cBiasR2:  case pBiasR2:
     330    ss << "BIA  " << left << setw(3) << t_lc::toString(_tLC) << right << " R  ";
     331    break;
     332  case cBiasE1:  case pBiasE1:
     333  case cBiasE2:  case pBiasE2:
     334    ss << "BIA  " << left << setw(3) << t_lc::toString(_tLC) << right << " E  ";
     335    break;
     336  case cBiasC1:  case pBiasC1:
     337  case cBiasC2:  case pBiasC2:
     338    ss << "BIA  " << left << setw(3) << t_lc::toString(_tLC) << right << " C  ";
    313339    break;
    314340  }
     
    360386        refPrn = (refSatMap[system])->prn();
    361387      }
    362       if ((par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 60.0)) ||
    363           ( refPrn == par->prn())) {
     388      if ((par->lastObsTime().valid() &&
     389          (epoTime - par->lastObsTime() > 60.0)) ||
     390          (refPrn == par->prn())) {
    364391        remove = true;
    365392      }
     
    409436  required.push_back(new t_pppParam(t_pppParam::crdZ, t_prn(), t_lc::dummy));
    410437
     438  // Receiver Code Biases
     439  // --------------------
     440  if (OPT->_obsModelType == OPT->DCMcodeBias) {
     441    if (OPT->useSystem('G')) {
     442      required.push_back(new t_pppParam(t_pppParam::cBiasG1, t_prn(), t_lc::c1));
     443      required.push_back(new t_pppParam(t_pppParam::cBiasG2, t_prn(), t_lc::c2));
     444    }
     445    if (OPT->useSystem('R')) {
     446      required.push_back(new t_pppParam(t_pppParam::cBiasR1, t_prn(), t_lc::c1));
     447      required.push_back(new t_pppParam(t_pppParam::cBiasR2, t_prn(), t_lc::c2));
     448    }
     449    if (OPT->useSystem('E')) {
     450      required.push_back(new t_pppParam(t_pppParam::cBiasE1, t_prn(), t_lc::c1));
     451      required.push_back(new t_pppParam(t_pppParam::cBiasE2, t_prn(), t_lc::c2));
     452    }
     453    if (OPT->useSystem('C')) {
     454      required.push_back(new t_pppParam(t_pppParam::cBiasC1, t_prn(), t_lc::c1));
     455      required.push_back(new t_pppParam(t_pppParam::cBiasC2, t_prn(), t_lc::c2));
     456    }
     457  }
     458
     459  // Receiver Phase Biases
     460  // ---------------------
     461  if ((OPT->_obsModelType == OPT->DCMphaseBias) ||
     462      (OPT->_obsModelType == OPT->PPPRTK)     ) {
     463    if (OPT->useSystem('G')) {
     464      required.push_back(new t_pppParam(t_pppParam::pBiasG1, t_prn(), t_lc::l1));
     465      required.push_back(new t_pppParam(t_pppParam::pBiasG2, t_prn(), t_lc::l2));
     466    }
     467    if (OPT->useSystem('R')) {
     468      required.push_back(new t_pppParam(t_pppParam::pBiasR1, t_prn(), t_lc::l1));
     469      required.push_back(new t_pppParam(t_pppParam::pBiasR2, t_prn(), t_lc::l2));
     470    }
     471    if (OPT->useSystem('E')) {
     472      required.push_back(new t_pppParam(t_pppParam::pBiasE1, t_prn(), t_lc::l1));
     473      required.push_back(new t_pppParam(t_pppParam::pBiasE2, t_prn(), t_lc::l2));
     474    }
     475    if (OPT->useSystem('C')) {
     476      required.push_back(new t_pppParam(t_pppParam::pBiasC1, t_prn(), t_lc::l1));
     477      required.push_back(new t_pppParam(t_pppParam::pBiasC2, t_prn(), t_lc::l2));
     478    }
     479  }
    411480  // Receiver Clock
    412481  // --------------
     
    415484  // GPS-GLONASS Clock Offset
    416485  // ------------------------
    417   if (OPT->useSystem('R')) {
     486  if (OPT->useSystem('R') && OPT->useSystem('G')) {
    418487    required.push_back(new t_pppParam(t_pppParam::offGR, t_prn(), t_lc::dummy));
    419488  }
     
    421490  // GPS-Galileo Clock Offset
    422491  // ------------------------
    423   if (OPT->useSystem('E')) {
     492  if (OPT->useSystem('E') && OPT->useSystem('G')) {
    424493    required.push_back(new t_pppParam(t_pppParam::offGE, t_prn(), t_lc::dummy));
    425494  }
     
    427496  // GPS-BDS Clock Offset
    428497  // ------------------------
    429   if (OPT->useSystem('C')) {
     498  if (OPT->useSystem('C') && OPT->useSystem('G')) {
    430499    required.push_back(new t_pppParam(t_pppParam::offGC, t_prn(), t_lc::dummy));
    431500  }
     
    443512      OPT->_obsModelType == OPT->DCMphaseBias   ) {
    444513    for (unsigned jj = 0; jj < obsVector.size(); jj++) {
    445       const t_pppSatObs*        satObs = obsVector[jj];
     514      const t_pppSatObs* satObs = obsVector[jj];
    446515      required.push_back(new t_pppParam(t_pppParam::ion, satObs->prn(), t_lc::dummy));
    447516    }
    448517  }
    449 
    450518  // Ambiguities
    451519  // -----------
     
    464532  }
    465533
    466   // Receiver Code Biases
    467   // --------------------
    468   if (OPT->_obsModelType == OPT->DCMcodeBias) {
    469     required.push_back(new t_pppParam(t_pppParam::cBias1, t_prn(), t_lc::c1));
    470     required.push_back(new t_pppParam(t_pppParam::cBias2, t_prn(), t_lc::c2));
    471   }
    472 
    473   // Receiver Phase Biases
    474   // ---------------------
    475   if ((OPT->_obsModelType == OPT->DCMphaseBias) ||
    476       (OPT->_obsModelType == OPT->PPPRTK)     ) {
    477     required.push_back(new t_pppParam(t_pppParam::pBias1, t_prn(), t_lc::l1));
    478     required.push_back(new t_pppParam(t_pppParam::pBias2, t_prn(), t_lc::l2));
    479   }
    480 
    481534  // Check if all required parameters are present
    482535  // --------------------------------------------
  • trunk/BNC/src/PPP/pppParlist.h

    r9288 r9386  
    1515class t_pppParam {
    1616 public:
    17   enum e_type {crdX, crdY, crdZ, clkR, amb, offGR, offGE, offGC, trp, ion, cBias1, cBias2, pBias1, pBias2};
     17  enum e_type {crdX, crdY, crdZ, clkR, trp, ion, amb, offGR, offGE, offGC,
     18               cBiasG1, cBiasR1, cBiasE1, cBiasC1, pBiasG1, pBiasR1, pBiasE1, pBiasC1,
     19               cBiasG2, cBiasR2, cBiasE2, cBiasC2, pBiasG2, pBiasR2, pBiasE2, pBiasC2};
    1820
    19   t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC,
    20           const std::vector<t_pppSatObs*>* obsVector = 0);
     21  t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC, const std::vector<t_pppSatObs*>* obsVector = 0);
    2122
    2223  ~t_pppParam();
     
    3334    _indexOld = _indexNew;
    3435    _indexNew = indexNew;
     36  }
     37  void resetIndex() {
     38    _indexOld = -1;
     39    _indexNew = -1;
    3540  }
    3641  int indexOld() const {return _indexOld;}
  • trunk/BNC/src/PPP/pppSatObs.cpp

    r9303 r9386  
    6363
    6464  // Select pseudoranges and phase observations
    65   // ------------------------------------------
     65  // -------------------------------------------
    6666  const string preferredAttrib = "G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX E:16&BCX E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:IQX I:ABCX S:1&C S:5&IQX";
    6767
     
    296296
    297297  if (tLC == t_lc::GIM) {
    298     retVal = OPT->_sigmaGIM * OPT->_sigmaGIM;
     298    retVal = OPT->_sigmaGIM * OPT->_sigmaGIM + OPT->_sigmaGIM * OPT->_sigmaGIM;
    299299  }
    300300
     
    304304
    305305  map<t_frequency::type, double>::const_iterator it;
    306   for (it = codeCoeff.begin(); it != codeCoeff.end(); it++)   {//qDebug() << "codeCoeff : " << t_frequency::toString(it->first).c_str() << ": " << it->second;
     306  for (it = codeCoeff.begin(); it != codeCoeff.end(); it++)   {//cout << "codeCoeff : " << t_frequency::toString(it->first).c_str() << ": " << it->second << endl;
    307307    retVal += it->second * it->second * OPT->_sigmaC1 * OPT->_sigmaC1;
    308308  }
    309309
    310   for (it = phaseCoeff.begin(); it != phaseCoeff.end(); it++) {//qDebug() << "phaseCoeff: " << t_frequency::toString(it->first).c_str()  << ": " << it->second;
     310  for (it = phaseCoeff.begin(); it != phaseCoeff.end(); it++) {//cout << "phaseCoeff: " << t_frequency::toString(it->first).c_str()  << ": " << it->second << endl;
    311311    retVal += it->second * it->second * OPT->_sigmaL1 * OPT->_sigmaL1;
    312312  }
     
    316316  // De-Weight GLONASS and BDS
    317317  // --------------------------
    318   if (_prn.system() == 'R' ||
    319       _prn.system() == 'C') {
     318  if ((_prn.system() == 'R' && (t_lc::includesCode(tLC) ||  t_lc::includesPhase(tLC))) ||
     319      (_prn.system() == 'C' && (t_lc::includesCode(tLC) ||  t_lc::includesPhase(tLC)))) { 
    320320    retVal *= 5.0;
    321321  }
     
    336336//
    337337////////////////////////////////////////////////////////////////////////////
    338 double t_pppSatObs::maxRes(t_lc::type tLC) const {//qDebug() << "t_pppSatObs::maxRes(t_lc::type tLC)";
     338double t_pppSatObs::maxRes(t_lc::type tLC) const {
    339339  double retVal = 0.0;
    340340
     
    345345
    346346  map<t_frequency::type, double>::const_iterator it;
    347   for (it = codeCoeff.begin(); it != codeCoeff.end(); it++)   {//qDebug() << "codeCoeff: " << it->first << ": " << it->second;
     347  for (it = codeCoeff.begin(); it != codeCoeff.end(); it++)   {//cout << "codeCoeff: " << it->first << ": " << it->second << endl;
    348348    retVal += it->second * it->second * OPT->_maxResC1 * OPT->_maxResC1;
    349349  }
    350   for (it = phaseCoeff.begin(); it != phaseCoeff.end(); it++) {//qDebug() << "phaseCoeff: " << it->first << ": " << it->second;
     350  for (it = phaseCoeff.begin(); it != phaseCoeff.end(); it++) {//cout << "phaseCoeff: " << it->first << ": " << it->second << endl;
    351351    retVal += it->second * it->second * OPT->_maxResL1 * OPT->_maxResL1;
    352352  }
    353353  if (tLC == t_lc::GIM) {
    354     retVal = 3.0 * OPT->_sigmaGIM * OPT->_sigmaGIM;
     354    retVal = 3.0 * (OPT->_sigmaGIM * OPT->_sigmaGIM + OPT->_sigmaGIM * OPT->_sigmaGIM);
    355355  }
    356356  if (tLC == t_lc::Tz0) {
    357357    retVal = 3.0 * OPT->_sigmaTz0 * OPT->_sigmaTz0;
    358358  }
    359   return sqrt(retVal);
     359
     360  retVal = sqrt(retVal);
     361
     362  return retVal;
    360363}
    361364
  • trunk/BNC/src/PPP/pppSatObs.h

    r8961 r9386  
    2121  bool                isReference() const {return _reference;};
    2222  void                setAsReference() {_reference = true;};
     23  void                resetReference() {_reference = false;};
    2324  const t_prn&        prn() const {return _prn;}
    2425  const ColumnVector& xc() const {return _xcSat;}
  • trunk/BNC/src/bncwindow.cpp

    r9302 r9386  
    14541454  _pppWidgets._sigmaC1->setWhatsThis(tr("<p>Enter a Sigma for GNSS C1 code observations in meters.</p><p>The higher the sigma you enter, the less the contribution of C1 code observations to a PPP solution from combined code and phase data. 2.0 is likely to be an appropriate choice.</p><p>Default is an empty option field, meaning<br>'Sigma C1 = 2.0' <i>[key: PPP/sigmaC1]</i></p>"));
    14551455  _pppWidgets._sigmaL1->setWhatsThis(tr("<p>Enter a Sigma for GNSS L1 phase observations in meters.</p><p>The higher the sigma you enter, the less the contribution of L1 phase observations to a PPP solutions from combined code and phase data. 0.01 is likely to be an appropriate choice.</p><p>Default is an empty option field, meaning<br>'Sigma L1 = 0.01' <i>[key: PPP/sigmaL1]</i></p>"));
    1456   _pppWidgets._sigmaGIM->setWhatsThis(tr("<p>Enter a Sigma for GIM pseudo observations in meters.</p><p>The higher the sigma you enter, the less the contribution of GIM pseudo observations to a PPP solution. 0.05 is likely to be an appropriate choice.</p><p>Default is an empty option field, meaning<br>'Sigma GIM = 0.05' <i>[key: PPP/sigmaGIM]</i></p>"));
     1456  _pppWidgets._sigmaGIM->setWhatsThis(tr("<p>Enter a Sigma for GIM pseudo observations in meters.</p><p>The higher the sigma you enter, the less the contribution of GIM pseudo observations to a PPP solution. 4.0 is likely to be an appropriate choice.</p><p>Default is an empty option field, meaning<br>'Sigma GIM = 4.0' <i>[key: PPP/sigmaGIM]</i></p>"));
    14571457  _pppWidgets._sigmaTz0->setWhatsThis(tr("<p>Enter a Sigma for a Tropospheric pseudo observation in zenith direction in meters.</p><p>The higher the sigma you enter, the less the contribution of Tz0 pseudo observations to a PPP solution. 0.10 is likely to be an appropriate choice.</p><p>Default is an empty option field, meaning<br>'Sigma Tzo = 0.10' <i>[key: PPP/sigmaTz0]</i></p>"));
    14581458  _pppWidgets._maxResC1->setWhatsThis(tr("<p>Specify a maximum for residuals from C1 code observations in a PPP solution. '3.0' meters may be an appropriate choice for that.</p><p>If the maximum is exceeded, contributions from the corresponding observation will be ignored in the PPP solution.</p><p>Default is an empty option field, meaning<br>'Max Rex C1 = 3.0' <i>[key: PPP/maxResC1]</i></p>"));
  • trunk/BNC/src/pppInclude.h

    r8961 r9386  
    9898      else if (sys == 'R') return t_frequency::R2;
    9999      else if (sys == 'E') return t_frequency::E5;
    100       else if (sys == 'C') return t_frequency::C7;
     100      else if (sys == 'C') return t_frequency::C6;
    101101      else                 return t_frequency::dummy;
    102102    case lIF: case cIF: case MW: case CL:
  • trunk/BNC/src/pppMain.cpp

    r9302 r9386  
    175175    opt->_blqFileName.assign(settings.value("PPP/blqFile").toString().toStdString());
    176176#endif
    177     opt->_sigmaC1      = settings.value("PPP/sigmaC1").toDouble(); if (opt->_sigmaC1 <= 0.0)  opt->_sigmaC1  =  2.0;
     177    opt->_sigmaC1      = settings.value("PPP/sigmaC1").toDouble(); if (opt->_sigmaC1 <= 0.0)  opt->_sigmaC1  = 2.00;
    178178    opt->_sigmaL1      = settings.value("PPP/sigmaL1").toDouble(); if (opt->_sigmaL1 <= 0.0)  opt->_sigmaL1  = 0.01;
    179     opt->_sigmaGIM     = settings.value("PPP/sigmaGIM").toDouble();if (opt->_sigmaGIM <= 0.0) opt->_sigmaGIM = 0.05;
     179    opt->_sigmaGIM     = settings.value("PPP/sigmaGIM").toDouble();if (opt->_sigmaGIM <= 0.0) opt->_sigmaGIM = 4.00;
    180180    opt->_sigmaTz0     = settings.value("PPP/sigmaTz0").toDouble();if (opt->_sigmaTz0 <= 0.0) opt->_sigmaTz0 = 0.10;
    181181    opt->_corrWaitTime = settings.value("PPP/corrWaitTime").toDouble();
     
    189189#ifdef USE_PPP
    190190    // Pseudo Observations
    191     if      (settings.value("PPP/pseudoObs").toString() == "Ionosphere") {
    192       opt->_pseudoObsIono  = true;
    193       opt->_pseudoObsTropo = false;
     191    if      (settings.value("PPP/pseudoObs").toString() == "Troposphere") {
     192      opt->_pseudoObsIono  = false;
     193      opt->_pseudoObsTropo = true;
    194194    }
    195195    else if (settings.value("PPP/pseudoObs").toString() == "Iono+Tropo") {
    196196      opt->_pseudoObsIono  = true;
    197197      opt->_pseudoObsTropo = true;
    198     }
    199     else if (settings.value("PPP/pseudoObs").toString() == "no") {
    200       opt->_pseudoObsIono  = false;
    201       opt->_pseudoObsTropo = false;
    202198    }
    203199    // Observation Model
     
    228224#endif
    229225    // GPS
    230     if (settings.value("PPP/lcGPS").toString() == "Pi") {
    231       if (opt->_obsModelType == t_pppOptions::IF) {
    232         opt->_LCsGPS.push_back(t_lc::cIF);
    233       }
    234       else {
    235         opt->_LCsGPS.push_back(t_lc::c1);
    236         opt->_LCsGPS.push_back(t_lc::c2);
    237         if (opt->_pseudoObsIono) {
    238           opt->_LCsGPS.push_back(t_lc::GIM);
    239         }
    240         if (opt->_pseudoObsTropo) {
    241           opt->_LCsGPS.push_back(t_lc::Tz0);
    242         }
    243       }
    244     }
    245     else if (settings.value("PPP/lcGPS").toString() == "Li") {
    246       if (opt->_obsModelType == t_pppOptions::IF) {
    247         opt->_LCsGPS.push_back(t_lc::lIF);
    248       }
    249       else {
    250         opt->_LCsGPS.push_back(t_lc::l1);
    251         opt->_LCsGPS.push_back(t_lc::l2);
    252         if (opt->_pseudoObsIono) {
    253           opt->_LCsGPS.push_back(t_lc::GIM);
    254         }
    255         if (opt->_pseudoObsTropo) {
    256           opt->_LCsGPS.push_back(t_lc::Tz0);
    257         }
    258       }
    259     }
    260     else if (settings.value("PPP/lcGPS").toString() == "Pi&Li") {
     226    if (settings.value("PPP/lcGPS").toString() == "Pi&Li") {
    261227      if (opt->_obsModelType == t_pppOptions::IF) {
    262228        opt->_LCsGPS.push_back(t_lc::cIF);
     
    277243    }
    278244    // GLONASS
    279     if (settings.value("PPP/lcGLONASS").toString() == "Pi") {
    280       if (opt->_obsModelType == t_pppOptions::IF) {
    281         opt->_LCsGLONASS.push_back(t_lc::cIF);
    282       }
    283       else {
    284         opt->_LCsGLONASS.push_back(t_lc::c1);
    285         opt->_LCsGLONASS.push_back(t_lc::c2);
    286         if (opt->_pseudoObsIono) {
    287           opt->_LCsGLONASS.push_back(t_lc::GIM);
    288         }
    289         if (opt->_pseudoObsTropo) {
    290           opt->_LCsGPS.push_back(t_lc::Tz0);
    291         }
    292       }
    293     }
    294     else if (settings.value("PPP/lcGLONASS").toString() == "Li") {
    295       if (opt->_obsModelType == t_pppOptions::IF) {
    296         opt->_LCsGLONASS.push_back(t_lc::lIF);
    297       }
    298       else {
    299         opt->_LCsGLONASS.push_back(t_lc::l1);
    300         opt->_LCsGLONASS.push_back(t_lc::l2);
    301         if (opt->_obsModelType == t_pppOptions::IF) {
    302           opt->_LCsGLONASS.push_back(t_lc::GIM);
    303         }
    304         if (opt->_pseudoObsTropo) {
    305           opt->_LCsGPS.push_back(t_lc::Tz0);
    306         }
    307       }
    308     }
    309     else if (settings.value("PPP/lcGLONASS").toString() == "Pi&Li") {
     245    if (settings.value("PPP/lcGLONASS").toString() == "Pi&Li") {
    310246      if (opt->_obsModelType == t_pppOptions::IF) {
    311247        opt->_LCsGLONASS.push_back(t_lc::cIF);
     
    321257        }
    322258        if (opt->_pseudoObsTropo) {
    323           opt->_LCsGPS.push_back(t_lc::Tz0);
     259          opt->_LCsGLONASS.push_back(t_lc::Tz0);
    324260        }
    325261      }
    326262    }
    327263    // Galileo
    328     if (settings.value("PPP/lcGalileo").toString() == "Pi") {
    329       if (opt->_obsModelType == t_pppOptions::IF) {
    330         opt->_LCsGalileo.push_back(t_lc::cIF);
    331       }
    332       else {
    333         opt->_LCsGalileo.push_back(t_lc::c1);
    334         opt->_LCsGalileo.push_back(t_lc::c2);
    335         if (opt->_pseudoObsIono) {
    336           opt->_LCsGalileo.push_back(t_lc::GIM);
    337         }
    338         if (opt->_pseudoObsTropo) {
    339           opt->_LCsGPS.push_back(t_lc::Tz0);
    340         }
    341       }
    342     }
    343     else if (settings.value("PPP/lcGalileo").toString() == "Li") {
    344       if (opt->_obsModelType == t_pppOptions::IF) {
    345         opt->_LCsGalileo.push_back(t_lc::lIF);
    346       }
    347       else {
    348         opt->_LCsGalileo.push_back(t_lc::l1);
    349         opt->_LCsGalileo.push_back(t_lc::l2);
    350         if (opt->_pseudoObsIono) {
    351           opt->_LCsGalileo.push_back(t_lc::GIM);
    352         }
    353         if (opt->_pseudoObsTropo) {
    354           opt->_LCsGPS.push_back(t_lc::Tz0);
    355         }
    356       }
    357     }
    358     else if (settings.value("PPP/lcGalileo").toString() == "Pi&Li") {
     264    if (settings.value("PPP/lcGalileo").toString() == "Pi&Li") {
    359265      if (opt->_obsModelType == t_pppOptions::IF) {
    360266        opt->_LCsGalileo.push_back(t_lc::cIF);
     
    370276        }
    371277        if (opt->_pseudoObsTropo) {
    372           opt->_LCsGPS.push_back(t_lc::Tz0);
     278          opt->_LCsGalileo.push_back(t_lc::Tz0);
    373279        }
    374280      }
    375281    }
    376282    // BDS
    377     if (settings.value("PPP/lcBDS").toString() == "Pi") {
    378       if (opt->_obsModelType == t_pppOptions::IF) {
    379         opt->_LCsBDS.push_back(t_lc::cIF);
    380       }
    381       else {
    382         opt->_LCsBDS.push_back(t_lc::c1);
    383         opt->_LCsBDS.push_back(t_lc::c2);
    384         if (opt->_pseudoObsIono) {
    385           opt->_LCsBDS.push_back(t_lc::GIM);
    386         }
    387         if (opt->_pseudoObsTropo) {
    388           opt->_LCsGPS.push_back(t_lc::Tz0);
    389         }
    390       }
    391     }
    392     else if (settings.value("PPP/lcBDS").toString() == "Li") {
    393       if (opt->_obsModelType == t_pppOptions::IF) {
    394         opt->_LCsBDS.push_back(t_lc::lIF);
    395       }
    396       else {
    397         opt->_LCsBDS.push_back(t_lc::l1);
    398         opt->_LCsBDS.push_back(t_lc::l2);
    399         if (opt->_pseudoObsIono) {
    400           opt->_LCsBDS.push_back(t_lc::GIM);
    401         }
    402         if (opt->_pseudoObsTropo) {
    403           opt->_LCsGPS.push_back(t_lc::Tz0);
    404         }
    405       }
    406     }
    407     else if (settings.value("PPP/lcBDS").toString() == "Pi&Li") {
     283    if (settings.value("PPP/lcBDS").toString() == "Pi&Li") {
    408284      if (opt->_obsModelType == t_pppOptions::IF) {
    409285        opt->_LCsBDS.push_back(t_lc::cIF);
     
    419295        }
    420296        if (opt->_pseudoObsTropo) {
    421           opt->_LCsGPS.push_back(t_lc::Tz0);
     297          opt->_LCsBDS.push_back(t_lc::Tz0);
    422298        }
    423299      }
     
    446322    }
    447323
    448     opt->_minObs      = settings.value("PPP/minObs").toInt(); if (opt->_minObs < 4) opt->_minObs = 4;
     324    opt->_minObs      = settings.value("PPP/minObs").toInt(); if (opt->_minObs < 5) opt->_minObs = 5;
    449325    opt->_minEle      = settings.value("PPP/minEle").toDouble() * M_PI / 180.0;
    450     opt->_maxResC1    = settings.value("PPP/maxResC1").toDouble(); if (opt->_maxResC1 <= 0.0) opt->_maxResC1 = 3.0;
     326    opt->_maxResC1    = settings.value("PPP/maxResC1").toDouble(); if (opt->_maxResC1 <= 0.0) opt->_maxResC1 = 3.00;
    451327    opt->_maxResL1    = settings.value("PPP/maxResL1").toDouble(); if (opt->_maxResL1 <= 0.0) opt->_maxResL1 = 0.03;
    452328    opt->_eleWgtCode  = (settings.value("PPP/eleWgtCode").toInt() != 0);
     
    459335    opt->_aprSigIon       = 1000.0;
    460336    opt->_aprSigClk       = 1000.0;
     337    opt->_aprSigOGR       = 1000.0;
     338    opt->_aprSigOGE       = 1000.0;
     339    opt->_aprSigOGC       = 1000.0;
    461340    opt->_aprSigCodeBias  = 1000.0;
    462341    opt->_aprSigPhaseBias = 1000.0;
    463     // TODO: Find realistic values!!!!!!
    464     opt->_noiseIon        =  5.00; // Todo: add all to table
    465     opt->_noiseCodeBias   =  5.00;
    466     opt->_noisePhaseBias  =  5.00;
    467342
    468343    _options << opt;
  • trunk/BNC/src/pppOptions.h

    r9302 r9386  
    6161  ColumnVector            _noiseCrd;
    6262  double                  _aprSigClk;
     63  double                  _aprSigOGR;
     64  double                  _aprSigOGE;
     65  double                  _aprSigOGC;
    6366  double                  _aprSigTrp;
    6467  double                  _noiseTrp;
    6568  double                  _aprSigIon;
    66   double                  _noiseIon;
    6769  double                  _aprSigCodeBias;
    68   double                  _noiseCodeBias;
    6970  double                  _aprSigPhaseBias;
    70   double                  _noisePhaseBias;
    7171  int                     _nmeaPort;
    7272  double                  _aprSigAmb;
  • trunk/BNC/src/pppWidgets.cpp

    r9302 r9386  
    124124  _lcGPS->addItems(QString("P3,P3&L3").split(","));
    125125#else
    126   _lcGPS->addItems(QString("no,Pi,Li,Pi&Li").split(","));
     126  _lcGPS->addItems(QString("no,Pi&Li").split(","));
    127127#endif
    128128
     
    131131   _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
    132132#else
    133   _lcGLONASS->addItems(QString("no,Pi,Li,Pi&Li").split(","));
     133  _lcGLONASS->addItems(QString("no,Pi&Li").split(","));
    134134#endif
    135135
     
    138138  _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
    139139#else
    140   _lcGalileo->addItems(QString("no,Pi,Li,Pi&Li").split(","));
     140  _lcGalileo->addItems(QString("no,Pi&Li").split(","));
    141141#endif
    142142
     
    145145  _lcBDS->addItems(QString("no,P3,L3,P3&L3").split(","));
    146146#else
    147   _lcBDS->addItems(QString("no,Pi,Li,Pi&Li").split(","));
     147  _lcBDS->addItems(QString("no,Pi&Li").split(","));
    148148#endif
    149149
     
    155155#else
    156156  _modelObs->addItems(QString("Ionosphere-free PPP,Uncombined PPP,PPP-RTK,DCM with Code Biases,DCM with Phase Biases").split(","));
    157   _pseudoObs->addItems(QString("no,Ionosphere,Iono+Tropo").split(","));
     157  _pseudoObs->addItems(QString("Troposphere,Iono+Tropo").split(","));
    158158#endif
    159159
     
    165165  _snxtroIntr->setCurrentIndex(6);
    166166
    167   _minObs->setMinimum(4);
     167  _minObs->setMinimum(5);
    168168  _minObs->setMaximum(6);
    169169  _minObs->setSingleStep(1);
     
    353353  }
    354354  else {
    355     _sigmaGIM->setText("0.05");
     355    _sigmaGIM->setText("4.0");
    356356  }
    357357
     
    367367  }
    368368  else {
    369     _maxResC1->setText("4.0");
     369    _maxResC1->setText("3.0");
    370370  }
    371371
     
    508508  bool enablePseudoObs;
    509509  if (_modelObs->currentText() == "PPP-RTK" ||
    510     _modelObs->currentText() == "Ionosphere-free PPP") {
     510      _modelObs->currentText() == "Ionosphere-free PPP") {
    511511    enablePseudoObs = false;
    512512  }
  • trunk/BNC/src/src.pri

    r9237 r9386  
    2727release:MOC_DIR=.moc/release
    2828
    29 debug:DEFINES  += BNC_DEBUG
    30 debug:DEFINES  += BNC_DEBUG_BCEP
    31 #debug:DEFINES  += BNC_DEBUG_SSR
     29
     30debug:DEFINES   += BNC_DEBUG_BCEP
     31#debug:DEFINES   += BNC_DEBUG_PPP
     32#debug:DEFINES   += BNC_DEBUG_SSR
    3233release:DEFINES += BNC_DEBUG_BCEP
     34
    3335
    3436# Include Path
Note: See TracChangeset for help on using the changeset viewer.