Changeset 9419 in ntrip


Ignore:
Timestamp:
May 3, 2021, 2:18:39 PM (3 years ago)
Author:
stuerze
Message:

update regarding PPP

Location:
trunk/BNC/src/PPP
Files:
6 edited

Legend:

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

    r9398 r9419  
    7373    }
    7474  }
     75
    7576  _offGR = 0.0;
    7677  _offGE = 0.0;
     
    596597    bool epochReProcessing = false;
    597598    _numEpoProcessing = 0;
     599    _historicalRefSats.clear();
     600
    598601    do {
    599602      _numEpoProcessing++;
     603#ifdef BNC_DEBUG_PPP
     604      LOG << "_numEpoProcessing " << _numEpoProcessing  << endl;
     605#endif
    600606      if (_obsPool->refSatChanged()) {
    601607        if(_filter->datumTransformation() != success) {
     608          LOG << "_filter->datumTransformation() != success" << endl;
    602609          return finish(failure);
    603610        }
    604611        else {
     612          LOG << "_filter->datumTransformation() == success" << endl;
    605613          _obsPool->saveLastEpoRefSats();
    606614        }
     
    631639      if (_opt->_refSatRequired) {
    632640        if (handleRefSatellites(_obsRover) != success) {
    633           _historicalRefSats.clear();
    634641          return finish(failure);
    635642        }
    636643        if (_obsPool->refSatChanged() &&
    637             _opt->_obsModelType  != t_pppOptions::UncombPPP) {
     644            (_opt->_obsModelType == OPT->DCMcodeBias ||
     645             _opt->_obsModelType == OPT->DCMphaseBias ||
     646             _opt->_pseudoObsIono)) {
     647          LOG << "refSatChanged()" << endl;
    638648            epochReProcessing = true;
    639649            continue;
     
    674684      else {
    675685        epochReProcessing = false;
    676         _historicalRefSats.clear();
    677686      }
    678687    } while (epochReProcessing);
     
    795804        refSatDefined = true;
    796805        obsVector[ii]->setAsReference();
    797 #ifdef BNC_DEBUG_PPP
    798         LOG << "=> unchanged refsatprn: "  <<  satObs->prn().toString() << endl;
    799 #endif
    800806      }
    801807      // reference satellite has changed
     
    807813            obsVector[ii]->setAsReference();
    808814            refSat->setPrn(satObs->prn());
    809 #ifdef BNC_DEBUG_PPP
    810           LOG << "=> set refsatprn: "  <<  satObs->prn().toString() << endl;
    811 #endif
    812815          }
    813816          else if ( _historicalRefSats[sys].contains(satObs->prn())) {
     
    841844          obsVector[ii]->setAsReference();
    842845          refSat->setPrn(satObs->prn());
    843 #ifdef BNC_DEBUG_PPP
    844           LOG << " => set refsatprn: "  <<  satObs->prn().toString() << endl;
    845 #endif
    846846          if (OPT->_pseudoObsIono) {
    847847            refSat->setStecValue(satObs->getIonoCodeDelay(t_frequency::G1));
     
    858858      refSat->setPrn(t_prn());
    859859    }
    860 
    861860    _obsPool->setRefSatChangeRequired(sys, false); // done or impossible
    862861  }
  • trunk/BNC/src/PPP/pppFilter.cpp

    r9398 r9419  
    8181  // Set Parameters
    8282  // --------------
    83   _parlist->set(_epoTime, allObs, _obsPool->getRefSatMap());
     83  if (_parlist->set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) {
     84    return failure;
     85  }
    8486  const vector<t_pppParam*>& params = _parlist->params();
    8587#ifdef BNC_DEBUG_PPP
     
    8890  }
    8991#endif
     92
    9093  // Status Vector, Variance-Covariance Matrix
    9194  // -----------------------------------------
     
    127130      OPT->_obsModelType == OPT->DCMphaseBias) {
    128131    preProcessing = true;
     132    unsigned usableSys = 0;
    129133    for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    130134      char sys = OPT->systems()[iSys];
     
    138142        }
    139143      }
    140       if (!obsVector.size()) {continue;}
     144      if (!obsVector.size()) {
     145        continue;
     146      }
     147      else {
     148        ++usableSys;
     149        if (usableSys == 1) {
     150          _datumTrafo->setFirstSystem(sys);
     151        }
     152      }
    141153      if (processSystem(OPT->LCs(sys), obsVector, _refPrn,
    142154                        epoch->pseudoObsIono(), preProcessing) != success) {
     
    154166    }
    155167    else if (!_obsPool->refSatChangeRequired()) {
    156       initDatumTransformation(allObs);
     168      initDatumTransformation(allObs, epoch->pseudoObsIono());
    157169    }
    158170  }
     
    162174  preProcessing = false;
    163175  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    164     (iSys) ? _datumTrafo->setFirstSystem(false) : _datumTrafo->setFirstSystem(true);
    165     char system = OPT->systems()[iSys];
     176    char sys = OPT->systems()[iSys];
    166177    if (OPT->_refSatRequired) {
    167       _refPrn = (_obsPool->getRefSatMapElement(system))->prn();
     178      _refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
    168179    }
    169180    unsigned int num = 0;
    170181    vector<t_pppSatObs*> obsVector;
    171182    for (unsigned jj = 0; jj < allObs.size(); jj++) {
    172       if (allObs[jj]->prn().system() == system) {
     183      if (allObs[jj]->prn().system() == sys) {
    173184        obsVector.push_back(allObs[jj]);
    174         num++;
    175       }
    176     }
    177     if (!num) {continue;}
    178     LOG << epoTimeStr << " SATNUM " << system << ' ' << right << setw(2) << num << endl;
    179     if (processSystem(OPT->LCs(system), obsVector, _refPrn,
     185        ++num;
     186      }
     187    }
     188    if (!num) {
     189      continue;
     190    }
     191    LOG << epoTimeStr << " SATNUM " << sys << ' ' << right << setw(2) << num << endl;
     192    if (processSystem(OPT->LCs(sys), obsVector, _refPrn,
    180193                      epoch->pseudoObsIono(), preProcessing) != success) {
    181194      return failure;
     
    190203  if (OPT->_refSatRequired) {
    191204    _obsPool->saveLastEpoRefSats();
     205    _datumTrafo->setLastEpoParlist(_parlist);
    192206  }
    193207  return success;
     
    219233
    220234  unsigned usedLCs     = LCs.size();
    221   unsigned realUsedLCs = usedLCs;
    222235  if (OPT->_pseudoObsIono && !pseudoObsIonoAvailable) {
    223236      usedLCs -= 1;  // GIM not used
     
    226239  if (OPT->_pseudoObsTropo) {
    227240    hlpLCs = -1;
    228     realUsedLCs -= 1;
    229241  }
    230242  // max Obs
    231243  unsigned maxObs = obsVector.size() * (usedLCs + hlpLCs);
    232   if (OPT->_pseudoObsTropo) {
     244  if (OPT->_pseudoObsTropo && _datumTrafo->firstSystem(sys)) {
    233245    maxObs += 1;
    234246  }
     
    260272    for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    261273      t_pppSatObs* obs = obsVector[ii];
     274      if (iOutlier == 0 && !preProcessing) {
     275        obs->resetOutlier();
     276      }
    262277      if (!obs->outlier()) {
    263278        for (unsigned jj = 0; jj < usedLCs; jj++) {
     
    280295    // pseudo Obs Tropo
    281296    // ================
    282     if (OPT->_pseudoObsTropo) {
     297    if (OPT->_pseudoObsTropo && _datumTrafo->firstSystem(sys)) {
    283298      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    284299        t_pppSatObs* obs = obsVector[ii];
     
    302317    if ((!iOutlier) &&
    303318        (OPT->_obsModelType == OPT->DCMcodeBias ||
    304          OPT->_obsModelType == OPT->DCMphaseBias  ) &&  (!preProcessing)) {
    305       _datumTrafo->updateIndices(iObs+1);
     319         OPT->_obsModelType == OPT->DCMphaseBias) &&
     320        (!preProcessing)) {
     321      _datumTrafo->updateIndices(sys, iObs+1);
    306322      _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist->nPar()), 1);
    307323    }
     
    499515        // -----------------------
    500516        else {
     517          if (refPrn != t_prn()) {return success;}
    501518          ColumnVector AA(params.size());
    502519          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     
    666683////////////////////////////////////////////////////////////////////////////
    667684t_irc t_pppFilter::datumTransformation() {
     685  // get last epoch
    668686  t_pppObsPool::t_epoch* epoch = _obsPool->lastEpoch();
    669   if (!epoch) {LOG << "!epoch" << endl;
     687  if (!epoch) {
     688    LOG << "!lastEpoch" << endl;
    670689    return failure;
    671690  }
     
    674693    LOG << string(epoch->epoTime()) << " DATUM TRANSFORMATION " << endl;
    675694  }
     695
    676696  vector<t_pppSatObs*>& allObs = epoch->obsVector();
    677697
    678   // reset old and set new refSats in last epoch (ambiguities)
    679   // ========================================================
     698  // reset old and set new refSats in last epoch (ambiguities/GIM)
     699  // =============================================================
    680700  if (resetRefSatellitesLastEpoch(allObs) != true) {
     701    LOG  << "resetRefSatellitesLastEpoch = failure" << endl;
    681702    return failure;
     703  }
     704
     705  if (OPT->_obsModelType == OPT->UncombPPP) {
     706    return success;
    682707  }
    683708
    684709  // set AA2
    685710  // =======
    686   _parlist->set(epoch->epoTime(), allObs, _obsPool->getRefSatMap());
    687   const vector<t_pppParam*>& params = _parlist->params();
     711  t_pppParlist* parlist = _datumTrafo->lastEpoParlist();
     712  if (parlist->set(epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) {
     713    return failure;
     714  }
     715  vector<t_pppParam*>& params = parlist->params();
    688716#ifdef BNC_DEBUG_PPP
     717  LOG << " parameters of last epoch" << endl;
    689718  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    690719    LOG << params[iPar]->toString() << "\t\t" << endl;
    691720  }
    692721#endif
     722  unsigned nPar = parlist->nPar();
     723  unsigned usableSys = 0;
    693724  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    694     (iSys) ? _datumTrafo->setFirstSystem(false) : _datumTrafo->setFirstSystem(true);
    695725    char sys = OPT->systems()[iSys];
    696726    t_prn refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
    697 #ifdef BNC_DEBUG_PPP
    698     LOG << "refPrn: " << refPrn.toString() << endl;
    699 #endif
    700727    vector<t_pppSatObs*> obsVector;
    701728    for (unsigned jj = 0; jj < allObs.size(); jj++) {
     
    704731      }
    705732    }
    706 
     733    if (!obsVector.size()) {
     734      continue;
     735    }
     736    else {
     737      ++usableSys;
     738      if (usableSys == 1) {
     739        _datumTrafo->setFirstSystem(sys);
     740      }
     741    }
    707742    vector<t_lc::type> LCs = OPT->LCs(sys);
    708743    unsigned usedLCs = LCs.size();
    709     unsigned realUsedLCs = usedLCs;
    710744    if (OPT->_pseudoObsIono && !epoch->pseudoObsIono()) {
    711745        usedLCs -= 1;  // GIM not used
     
    714748    if (OPT->_pseudoObsTropo) {
    715749      hlpLCs = -1;
    716       realUsedLCs -= 1;
    717750    }
    718751    // max Obs
    719752    unsigned maxObs = obsVector.size() * (usedLCs + hlpLCs);
    720     if (OPT->_pseudoObsTropo) {
     753
     754    if (OPT->_pseudoObsTropo && _datumTrafo->firstSystem(sys)) {
    721755      maxObs += 1;
    722756    }
     
    724758      maxObs -= 1; // pseudo obs iono with respect to refSat
    725759    }
    726 
    727     Matrix  AA(maxObs, _parlist->nPar());
     760    Matrix  AA(maxObs, nPar);
    728761
    729762    // Real Observations
     
    732765    for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    733766      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           }
     767      for (unsigned jj = 0; jj < usedLCs; jj++) {
     768        const t_lc::type tLC = LCs[jj];
     769        if (tLC == t_lc::GIM) {continue;}
     770        if (tLC == t_lc::Tz0) {continue;}
     771        ++iObs;
     772        for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     773          const t_pppParam* par = params[iPar];
     774          AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
    744775        }
    745776      }
     
    747778    // pseudo Obs Tropo
    748779    // ================
    749     if (OPT->_pseudoObsTropo) {
     780    if (OPT->_pseudoObsTropo && _datumTrafo->firstSystem(sys)) {
    750781      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
    751782        t_pppSatObs* obs = obsVector[ii];
     
    762793      }
    763794    }
    764     _datumTrafo->updateIndices(iObs+1);
    765     _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist->nPar()), 2);
    766   }
     795    if (!iObs) {
     796      continue;
     797    }
     798    _datumTrafo->updateIndices(sys, iObs+1);
     799    _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, nPar), 2);
     800  }
     801  _datumTrafo->updateNumObs();
    767802
    768803  // Datum Transformation
    769804  // ====================
    770805#ifdef BNC_DEBUG_PPP
    771       LOG << "AA1\n"; _datumTrafo->printMatrix(_datumTrafo->AA1(), _datumTrafo->obsNum(), _datumTrafo->parNum());
    772       LOG << "AA2\n"; _datumTrafo->printMatrix(_datumTrafo->AA2(), _datumTrafo->obsNum(), _datumTrafo->parNum());
     806      //LOG << "AA1\n"; _datumTrafo->printMatrix(_datumTrafo->AA1(), _datumTrafo->numObs(), _datumTrafo->numPar());
     807      //LOG << "AA2\n"; _datumTrafo->printMatrix(_datumTrafo->AA2(), _datumTrafo->numObs(), _datumTrafo->numPar());
    773808#endif
    774   Matrix D21 = _datumTrafo->computeTrafoMatrix();
     809  if(_datumTrafo->computeTrafoMatrix() != success) {
     810    return failure;
     811  }
    775812#ifdef BNC_DEBUG_PPP
    776       LOG << "D21" << endl; _datumTrafo->printMatrix(D21, _datumTrafo->parNum(), _datumTrafo->parNum());
     813      //LOG << "D21" << endl; _datumTrafo->printMatrix(_datumTrafo->D21(), _datumTrafo->numObs(), _datumTrafo->numPar());
    777814#endif
    778815  ColumnVector    xFltOld = _xFlt;
    779816  SymmetricMatrix QFltOld = _QFlt;
    780817
    781   _QFlt << D21 * QFltOld * D21.t();
    782   _xFlt =  D21 * xFltOld;
     818  _QFlt << _datumTrafo->D21() * QFltOld * _datumTrafo->D21().t();
     819  _xFlt =  _datumTrafo->D21() * xFltOld;
    783820
    784821#ifdef BNC_DEBUG_PPP
     
    791828  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    792829    char sys = OPT->systems()[iSys];
    793     t_irc irc = resetAmb(_obsPool->getRefSatMapElementLastEpoch(sys), allObs);
    794     if (OPT->_obsModelType == OPT->DCMcodeBias) {
    795       if (irc == success) {
    796         addNoiseToIono(sys);}
     830    t_prn refPrnOld = _obsPool->getRefSatMapElementLastEpoch(sys);
     831    t_prn refPrnNew = (_obsPool->getRefSatMapElement(sys))->prn();
     832    if (refPrnNew != refPrnOld) {
     833      t_irc irc = resetAmb(_obsPool->getRefSatMapElementLastEpoch(sys), allObs);
     834      if (OPT->_obsModelType == OPT->DCMcodeBias) {
     835        if (irc == success) {
     836          addNoiseToIono(sys);
     837        }
     838      }
    797839    }
    798840  }
     
    802844  _datumTrafo->switchAA();
    803845
     846  // save parameter list
     847  // ====================
     848  _datumTrafo->setLastEpoParlist(_parlist);
    804849  return success;
    805850}
     
    807852// Init datum transformation
    808853////////////////////////////////////////////////////////////////////////////
    809 void t_pppFilter::initDatumTransformation(const std::vector<t_pppSatObs*>& allObs) {
     854void t_pppFilter::initDatumTransformation(const std::vector<t_pppSatObs*>& allObs,
     855                                          bool pseudoObsIono) {
    810856  unsigned trafoObs = 0;
    811857  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    812     char system = OPT->systems()[iSys];
     858    char sys = OPT->systems()[iSys];
    813859    int satNum = 0;
    814860    for (unsigned jj = 0; jj < allObs.size(); jj++) {
    815       if (allObs[jj]->prn().system() == system) {
     861      if (allObs[jj]->prn().system() == sys) {
    816862        satNum++;
    817863      }
    818864    }
     865    if (!satNum) {
     866      continue;
     867    }
    819868    // all LCs
    820     unsigned realUsedLCs = OPT->LCs(system).size();
     869    unsigned realUsedLCs = OPT->LCs(sys).size();
    821870    // exclude pseudo obs GIM
    822     if (OPT->_pseudoObsIono) {
     871    if (OPT->_pseudoObsIono && !pseudoObsIono) {
    823872      realUsedLCs -= 1;
    824873    }
     
    828877    trafoObs += satNum * realUsedLCs;
    829878
    830     if (OPT->_pseudoObsTropo) {
     879    if (OPT->_pseudoObsTropo && _datumTrafo->firstSystem(sys)) {
    831880      trafoObs += 1;
    832881    }
    833 
    834   }
    835   _datumTrafo->setObsNum(trafoObs);
    836   _datumTrafo->setParNum(_parlist->nPar());
     882    if (OPT->_pseudoObsIono && pseudoObsIono) {
     883      trafoObs -= 1; // pseudo obs iono with respect to refSat
     884    }
     885  }
     886  _datumTrafo->setNumObs(trafoObs);
     887  _datumTrafo->setNumPar(_parlist->nPar());
    837888  _datumTrafo->initAA();
    838889}
  • trunk/BNC/src/PPP/pppFilter.h

    r9386 r9419  
    2424
    2525  t_irc datumTransformation();
    26   void initDatumTransformation(const std::vector<t_pppSatObs*>& allObs);
     26  void initDatumTransformation(const std::vector<t_pppSatObs*>& allObs, bool pseudoObsIono);
     27  unsigned setTrafoObs();
    2728
    2829  const ColumnVector&    x() const {return _xFlt;}
     
    7980  class t_datumTrafo {
    8081  public:
    81     t_datumTrafo () {initIndices();}
    82     void initIndices() {_firstRow = 1; _lastRow = 0;}
    83     void setFirstSystem(bool firstSys) {_firstSys = firstSys;}
    84     bool firstSystem() {return _firstSys;}
    85     void updateIndices(int maxObsSys) {
    86       if (firstSystem()) {
     82    t_datumTrafo () {
     83      initIndices();
     84    }
     85    ~t_datumTrafo () {
     86
     87    }
     88
     89    void initIndices() {
     90      _firstRow = 1; _lastRow = 0;
     91    }
     92
     93    void setFirstSystem(char firstSys) {
     94      _firstSys = firstSys;
     95    }
     96
     97    bool firstSystem(char sys) {
     98      if (_firstSys == sys) {
     99        return true;
     100      }
     101      return false;
     102    }
     103
     104    void updateIndices(char sys, int maxObsSys) {
     105      if (firstSystem(sys)) {
    87106        initIndices();
    88107      }
     
    90109        _firstRow = _lastRow + 1;
    91110      }
    92       _lastRow += maxObsSys;
    93 
     111      _lastRow += maxObsSys;//LOG << "updateIndices: lastRow: " << _lastRow << endl;
    94112    };
    95     void setObsNum(int maxObs) {_maxObs = maxObs;}
    96     void setParNum(int numPar) {_numPar = numPar;}
    97     int obsNum() {return _maxObs;}
    98     int parNum() {return _numPar;}
     113
     114    void setNumObs(int maxObs) {_maxObs = maxObs;}
     115    void setNumPar(int numPar) { _numPar = numPar;}
     116    void setLastEpoParlist(t_pppParlist* parlist) {_parlist = parlist;}
     117    t_pppParlist* lastEpoParlist() {return _parlist;}
     118    int numPar() {return _numPar;}
     119    int numObs() {return _maxObs;}
     120    void updateNumObs() {//LOG << "updateObsNum _maxObs " << _maxObs;
     121      _maxObs = _lastRow;//LOG << "=>  _maxObs " << _maxObs << " _numPar: " << _numPar << endl;
     122      _AA1 = _AA1.SubMatrix(1, _lastRow, 1, _numPar);
     123      _AA2 = _AA2.SubMatrix(1, _lastRow, 1, _numPar);
     124    }
     125
    99126    const Matrix& AA1() {return _AA1;}
    100127    const Matrix& AA2() {return _AA2;}
    101 
    102     void initAA() {
     128    const Matrix& D21() {return _D21;}
     129
     130    void initAA() {//LOG << "initAA: _maxObs: " << _maxObs << " _numPar: " << _numPar << endl;
    103131      _AA1.ReSize(_maxObs, _numPar); _AA1 = 0.0;
    104132      _AA2.ReSize(_maxObs, _numPar); _AA2 = 0.0;
     133      _D21.ReSize(_numPar, _numPar); _D21 = 0.0;
    105134    }
    106135
     
    112141      Prep->SubMatrix(_firstRow, _lastRow, 1, _numPar) << AA;
    113142    }
     143
    114144    void switchAA() {
    115145      _AA1 = _AA2;
    116146    }
    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     }
     147
     148    t_irc computeTrafoMatrix() {
     149      if (((_AA2.t() * _AA2)).Determinant() == 0.0) {
     150        LOG << "(_AA2.t() * _AA2).inv() is singular" << endl;
     151        return failure;
     152      }
     153      _D21 = ((_AA2.t() * _AA2).i()) * _AA2.t() * _AA1;
     154      return success;
     155    }
     156
    127157    void printMatrix(const Matrix& X, int nRow, int nCol) {
    128158      for (int rr = 0; rr < nRow; rr++) {
     
    134164      LOG << endl;
    135165    }
    136 
     166  private:
    137167    int               _firstRow;
    138168    int               _lastRow;
    139169    Matrix            _AA1;
    140170    Matrix            _AA2;
    141     bool              _firstSys;
     171    Matrix            _D21;
     172    char              _firstSys;
    142173    int               _maxObs;
    143174    int               _numPar;
    144175    QMap<char, t_prn> _refSatMapPseudoObs;
     176    t_pppParlist*     _parlist;
    145177  };
    146178
  • trunk/BNC/src/PPP/pppParlist.cpp

    r9399 r9419  
    121121     _sigma0  = OPT->_aprSigCodeBias;
    122122     break;
    123    case pBiasG1:   case pBiasE1:   case pBiasC1:
    124    case pBiasG2:   case pBiasE2:   case pBiasC2:
     123   case pBiasG1:   case pBiasE1:   case pBiasR1:   case pBiasC1:
     124   case pBiasG2:   case pBiasE2:   case pBiasR2:   case pBiasC2:
    125125     _epoSpec = true;
    126126     _sigma0  = OPT->_aprSigPhaseBias;
     
    261261    if ((obs->prn().system() == 'G') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
    262262    break;
     263  case pBiasR1:
     264    if ((obs->prn().system() == 'R') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
     265    break;
    263266  case pBiasE1:
    264267    if ((obs->prn().system() == 'E') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
     
    269272  case pBiasG2:
    270273    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;}
    271277    break;
    272278  case pBiasE2:
     
    320326    ss << "BIA  " << left << setw(3) << t_lc::toString(_tLC) << right << " G  ";
    321327    break;
    322   case cBiasR1:
    323   case cBiasR2:
     328  case cBiasR1:  case pBiasR1:
     329  case cBiasR2:  case pBiasR2:
    324330    ss << "BIA  " << left << setw(3) << t_lc::toString(_tLC) << right << " R  ";
    325331    break;
     
    351357//
    352358////////////////////////////////////////////////////////////////////////////
    353 t_irc t_pppParlist::set(const bncTime& epoTime,
    354     const std::vector<t_pppSatObs*>& obsVector,
     359t_irc t_pppParlist::set(const bncTime& epoTime, const std::vector<t_pppSatObs*>& obsVector,
    355360    const QMap<char, t_pppRefSat*>& refSatMap) {
    356361
     
    374379      }
    375380    }
     381
    376382    else if (par->type() == t_pppParam::amb) {
    377       char system = par->prn().system();
    378       t_prn refPrn = t_prn();
    379       if (OPT->_refSatRequired) {
    380         refPrn = (refSatMap[system])->prn();
    381       }
    382       if ((par->lastObsTime().valid() &&
    383           (epoTime - par->lastObsTime() > 60.0)) ||
    384           (refPrn == par->prn())) {
    385         remove = true;
     383      if (OPT->_obsModelType == OPT->DCMcodeBias ||  OPT->_obsModelType == OPT->DCMphaseBias) {
     384        t_prn refPrn = (refSatMap[par->prn().system()])->prn();
     385        if (par->lastObsTime().valid() &&
     386            ((epoTime - par->lastObsTime() > 1.0) || (par->prn() == refPrn))) {
     387            remove = true;
     388        }
     389      }
     390      else {
     391        if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 60.0)) {
     392            remove = true;
     393        }
    386394      }
    387395    }
     
    420428  }
    421429
     430  // Check if ambiguity parameters have observations
     431  // -----------------------------------------------
     432  if (OPT->_obsModelType == OPT->DCMcodeBias ||
     433      OPT->_obsModelType == OPT->DCMphaseBias) {
     434    vector<t_pppParam*>::iterator it = _params.begin();
     435    while (it != _params.end()) {
     436      t_pppParam* par = *it;
     437      bool remove = false;
     438      if (par->type() == t_pppParam::amb && !par->lastObsTime().valid()) {
     439        remove = true;
     440      }
     441      if (remove) {
     442        delete par;
     443        it = _params.erase(it);
     444      }
     445      else {
     446        ++it;
     447      }
     448    }
     449  }
     450
     451  // check which systems have observations
     452  // -------------------------------------
     453  _usedSystems.clear();
     454  for (unsigned jj = 0; jj < obsVector.size(); jj++) {
     455    const t_pppSatObs* satObs = obsVector[jj];
     456    char sys = satObs->prn().system();
     457    if (!_usedSystems.contains(sys)) {
     458      _usedSystems.append(sys);
     459    }
     460  }
     461
     462  if (_usedSystems.size() > 1 &&
     463      !_usedSystems.contains('G')) { // required to setup ISB w. r. t. GPS
     464    return failure;
     465  }
     466
    422467  // Required Set of Parameters
    423468  // --------------------------
     
    433478  // --------------------
    434479  if (OPT->_obsModelType == OPT->DCMcodeBias) {
    435     if (OPT->useSystem('G')) {
     480    if (_usedSystems.contains('G')) {
    436481      required.push_back(new t_pppParam(t_pppParam::cBiasG1, t_prn(), t_lc::c1));
    437482      required.push_back(new t_pppParam(t_pppParam::cBiasG2, t_prn(), t_lc::c2));
    438483    }
    439     if (OPT->useSystem('R')) {
     484    if (_usedSystems.contains('R')) {
    440485      required.push_back(new t_pppParam(t_pppParam::cBiasR1, t_prn(), t_lc::c1));
    441486      required.push_back(new t_pppParam(t_pppParam::cBiasR2, t_prn(), t_lc::c2));
    442487    }
    443     if (OPT->useSystem('E')) {
     488    if (_usedSystems.contains('E')) {
    444489      required.push_back(new t_pppParam(t_pppParam::cBiasE1, t_prn(), t_lc::c1));
    445490      required.push_back(new t_pppParam(t_pppParam::cBiasE2, t_prn(), t_lc::c2));
    446491    }
    447     if (OPT->useSystem('C')) {
     492    if (_usedSystems.contains('C')) {
    448493      required.push_back(new t_pppParam(t_pppParam::cBiasC1, t_prn(), t_lc::c1));
    449494      required.push_back(new t_pppParam(t_pppParam::cBiasC2, t_prn(), t_lc::c2));
     
    455500  if ((OPT->_obsModelType == OPT->DCMphaseBias) ||
    456501      (OPT->_obsModelType == OPT->PPPRTK)     ) {
    457     if (OPT->useSystem('G')) {
     502    if (_usedSystems.contains('G')) {
    458503      required.push_back(new t_pppParam(t_pppParam::pBiasG1, t_prn(), t_lc::l1));
    459504      required.push_back(new t_pppParam(t_pppParam::pBiasG2, t_prn(), t_lc::l2));
    460505    }
    461     if (OPT->useSystem('E')) {
     506    if (_usedSystems.contains('R')) {
     507      required.push_back(new t_pppParam(t_pppParam::pBiasR1, t_prn(), t_lc::l1));
     508      required.push_back(new t_pppParam(t_pppParam::pBiasR2, t_prn(), t_lc::l2));
     509    }
     510    if (_usedSystems.contains('E')) {
    462511      required.push_back(new t_pppParam(t_pppParam::pBiasE1, t_prn(), t_lc::l1));
    463512      required.push_back(new t_pppParam(t_pppParam::pBiasE2, t_prn(), t_lc::l2));
    464513    }
    465     if (OPT->useSystem('C')) {
     514    if (_usedSystems.contains('C')) {
    466515      required.push_back(new t_pppParam(t_pppParam::pBiasC1, t_prn(), t_lc::l1));
    467516      required.push_back(new t_pppParam(t_pppParam::pBiasC2, t_prn(), t_lc::l2));
    468517    }
    469518  }
     519
    470520  // Receiver Clock
    471521  // --------------
     
    474524  // GPS-GLONASS Clock Offset
    475525  // ------------------------
    476   if (OPT->useSystem('R') && OPT->useSystem('G')) {
     526  if (_usedSystems.contains('G') && _usedSystems.contains('R')) {
    477527    required.push_back(new t_pppParam(t_pppParam::offGR, t_prn(), t_lc::dummy));
    478528  }
    479529
    480   // GPS-Galileo Clock Offset
     530  //GPS-Galileo Clock Offset
    481531  // ------------------------
    482   if (OPT->useSystem('E') && OPT->useSystem('G')) {
     532  if (_usedSystems.contains('G') && _usedSystems.contains('E')) {
    483533    required.push_back(new t_pppParam(t_pppParam::offGE, t_prn(), t_lc::dummy));
    484534  }
     
    486536  // GPS-BDS Clock Offset
    487537  // ------------------------
    488   if (OPT->useSystem('C') && OPT->useSystem('G')) {
     538  if (_usedSystems.contains('G') && _usedSystems.contains('C')) {
    489539    required.push_back(new t_pppParam(t_pppParam::offGC, t_prn(), t_lc::dummy));
    490540  }
     
    509559  // -----------
    510560  for (unsigned jj = 0; jj < obsVector.size(); jj++) {
    511     const t_pppSatObs*        satObs = obsVector[jj];
     561    const t_pppSatObs*  satObs = obsVector[jj];
    512562    if ((OPT->_obsModelType == OPT->IF)        ||
    513563        (OPT->_obsModelType == OPT->PPPRTK)    ||
  • trunk/BNC/src/PPP/pppParlist.h

    r9399 r9419  
    1616 public:
    1717  enum e_type {crdX, crdY, crdZ, clkR, trp, ion, amb, offGR, offGE, offGC,
    18                cBiasG1, cBiasR1, cBiasE1, cBiasC1, pBiasG1, pBiasE1, pBiasC1,
    19                cBiasG2, cBiasR2, cBiasE2, cBiasC2, pBiasG2, pBiasE2, pBiasC2};
     18               cBiasG1, cBiasR1, cBiasE1, cBiasC1, pBiasG1, pBiasR1, pBiasE1, pBiasC1,
     19               cBiasG2, cBiasR2, cBiasE2, cBiasC2, pBiasG2, pBiasR2, pBiasE2, pBiasC2};
    2020
    2121  t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC, const std::vector<t_pppSatObs*>* obsVector = 0);
     
    114114 private:
    115115  std::vector<t_pppParam*> _params;
     116  QList<char>              _usedSystems;
    116117};
    117118
  • trunk/BNC/src/PPP/pppSatObs.h

    r9386 r9419  
    4444  bool                outlier() const {return _outlier;}
    4545  void                setOutlier() {_outlier = true;}
     46  void                resetOutlier() {_outlier = false;}
    4647  void                setRes(t_lc::type tLC, double res);
    4748  double              getRes(t_lc::type tLC) const;
Note: See TracChangeset for help on using the changeset viewer.