Changeset 9526 in ntrip


Ignore:
Timestamp:
Oct 25, 2021, 3:15:33 PM (15 months ago)
Author:
stuerze
Message:

update regarding PPP

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

Legend:

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

    r9524 r9526  
    7676  if (OPT->_obsModelType == OPT->DCMcodeBias ||
    7777      OPT->_obsModelType == OPT->DCMphaseBias) {
    78      // Save parameters of epoch before
    79     _parlist_sav = _parlist;
     78    rememberState();
    8079  }
    8180
     
    8584    return failure;
    8685  }
    87   const vector<t_pppParam*>& params = _parlist.params();
    88   unsigned nPar = _parlist.nPar();
     86
    8987#ifdef BNC_DEBUG_PPP
    90   for (unsigned iPar = 0; iPar < nPar; iPar++) {
    91     LOG << "t_pppFilter::processEpoch par_cur " << params[iPar]->toString()
    92         << "  lastObsTime().valid() " << params[iPar]->lastObsTime().valid()
    93         << "  epoTime-params[iPar]->lastObsTime() " << (_epoTime - params[iPar]->lastObsTime()) << endl;
    94   }
     88  _parlist.printParams();
    9589#endif
    9690
     
    9993  ColumnVector    xFltOld = _xFlt;
    10094  SymmetricMatrix QFltOld = _QFlt;
    101 
    102   _QFlt.ReSize(nPar); _QFlt = 0.0;
    103   _xFlt.ReSize(nPar); _xFlt = 0.0;
    104   _x0.ReSize(nPar);   _x0   = 0.0;
    105 
    106   for (unsigned ii = 0; ii < nPar; ii++) {
    107     t_pppParam* par1 = params[ii];
    108     if (QFltOld.size() == 0) {
    109       par1->resetIndex();
    110     }
    111     _x0[ii] = par1->x0();
    112     int iOld = par1->indexOld();
    113     if (iOld < 0) {
    114       _QFlt[ii][ii] = par1->sigma0() * par1->sigma0(); // new parameter
    115     }
    116     else {
    117       _QFlt[ii][ii] = QFltOld[iOld][iOld] + par1->noise() * par1->noise();
    118       _xFlt[ii]     = xFltOld[iOld];
    119       for (unsigned jj = 0; jj < ii; jj++) {
    120         t_pppParam* par2 = params[jj];
    121         int  jOld = par2->indexOld();
    122         if (jOld >= 0) {
    123           _QFlt[ii][jj] = QFltOld(iOld+1,jOld+1);
    124         }
    125       }
    126     }
    127   }
    128   predictCovCrdPart(QFltOld);
     95  setStateVectorAndVarCovMatrix(xFltOld, QFltOld);
     96
    12997
    13098  // Pre-Process Satellite Systems separately
     
    137105    for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
    138106      char sys = usedSystems[iSys];
    139       _refPrn = refSatMap[sys]->prn();
     107      _refPrn.set(sys, 0);
     108      if (OPT->_refSatRequired) {
     109        _refPrn = refSatMap[sys]->prn();
     110      }
    140111     vector<t_pppSatObs*> obsVector;
    141112      for (unsigned jj = 0; jj < allObs.size(); jj++) {
     
    159130      _xFlt = xFltOld;
    160131      _QFlt = QFltOld;
    161       _parlist = _parlist_sav;
     132      restoreState();
    162133      return success;
    163134    }
     
    173144  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
    174145    char sys = usedSystems[iSys];
     146    _refPrn.set(sys, 0);
    175147    if (OPT->_refSatRequired) {
    176148      _refPrn = refSatMap[sys]->prn();
    177     }
    178     else {
    179       _refPrn.set(sys, 0);
    180149    }
    181150    unsigned int num = 0;
     
    640609}
    641610
    642 // Compute various DOP Values
     611//
    643612////////////////////////////////////////////////////////////////////////////
    644613void t_pppFilter::predictCovCrdPart(const SymmetricMatrix& QFltOld) {
     
    680649}
    681650
     651//
     652////////////////////////////////////////////////////////////////////////////
     653void t_pppFilter::setStateVectorAndVarCovMatrix(const ColumnVector& xFltOld,
     654                                                const SymmetricMatrix& QFltOld) {
     655
     656  const vector<t_pppParam*>& params = _parlist.params();
     657  unsigned nPar = params.size();
     658
     659  _QFlt.ReSize(nPar); _QFlt = 0.0;
     660  _xFlt.ReSize(nPar); _xFlt = 0.0;
     661  _x0.ReSize(nPar);   _x0   = 0.0;
     662
     663  for (unsigned ii = 0; ii < nPar; ii++) {
     664    t_pppParam* par1 = params[ii];
     665    if (QFltOld.size() == 0) {
     666      par1->resetIndex();
     667    }
     668    _x0[ii] = par1->x0();
     669    int iOld = par1->indexOld();
     670    if (iOld < 0) {
     671      _QFlt[ii][ii] = par1->sigma0() * par1->sigma0(); // new parameter
     672    }
     673    else {
     674      _QFlt[ii][ii] = QFltOld[iOld][iOld] + par1->noise() * par1->noise();
     675      _xFlt[ii]     = xFltOld[iOld];
     676      for (unsigned jj = 0; jj < ii; jj++) {
     677        t_pppParam* par2 = params[jj];
     678        int  jOld = par2->indexOld();
     679        if (jOld >= 0) {
     680          _QFlt[ii][jj] = QFltOld(iOld+1,jOld+1);
     681        }
     682      }
     683    }
     684  }
     685  predictCovCrdPart(QFltOld);
     686}
     687
    682688// Compute datum transformation
    683689////////////////////////////////////////////////////////////////////////////
     
    716722    return failure;
    717723  }
    718   const vector<t_pppParam*>& params = _parlist.params();
    719   unsigned nPar = _parlist.nPar();
     724
    720725#ifdef BNC_DEBUG_PPP
    721   LOG << " t_pppFilter::datumTransformation par last epoch: " << nPar << "/" << nPar <<  endl;
    722   for (unsigned iPar = 0; iPar < nPar; iPar++) {
    723     LOG << "t_pppFilter::processEpoch par_cur " << params[iPar]->toString()
    724         << "  lastObsTime().valid() " << params[iPar]->lastObsTime().valid()
    725         << "  epoTime-params[iPar]->lastObsTime() " << (_epoTime - params[iPar]->lastObsTime()) << endl;
    726   }
     726  _parlist.printParams();
    727727#endif
     728
    728729  const QList<char>& usedSystems = _parlist.usedSystems();
    729730  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     
    757758      maxObs -= 1; // pseudo obs iono with respect to refSat
    758759    }
     760
     761    const vector<t_pppParam*>& params = _parlist.params();
     762    unsigned nPar = _parlist.nPar();
     763
    759764    Matrix  AA(maxObs, nPar);
    760765
     
    807812  // ====================
    808813#ifdef BNC_DEBUG_PPP
    809       //LOG << "AA1\n"; _datumTrafo->printMatrix(_datumTrafo->AA1(), _datumTrafo->numObs(), _datumTrafo->numPar());
     814      LOG << "AA1\n"; _datumTrafo->printMatrix(_datumTrafo->AA1(), _datumTrafo->numObs(), _datumTrafo->numPar());
    810815      LOG << "AA2\n"; _datumTrafo->printMatrix(_datumTrafo->AA2(), _datumTrafo->numObs(), _datumTrafo->numPar());
    811816#endif
     
    848853
    849854  _obsPool->putEpoch(_epoTime, allObs, peseudoObsIono, refSatMap);
     855
     856  rememberState();
    850857
    851858  return success;
  • trunk/BNC/src/PPP/pppFilter.h

    r9508 r9526  
    2929  void initDatumTransformation(const std::vector<t_pppSatObs*>& allObs, bool pseudoObsIono);
    3030  unsigned setTrafoObs();
     31  void restoreState()  {    LOG << "restore parameter from last epoch: _parlist = _parlist_old" << endl;
     32    _QFlt    = _QFlt_sav;
     33    _parlist = _parlist_sav;
     34  }
     35  void rememberState() {    LOG << "Remember parameters from epoch before: _parlist_old = _parlist" << endl;
     36    _QFlt_sav    = _QFlt;
     37    _parlist_sav = _parlist;
     38  }
    3139
    3240  int    numSat() const {return _numSat;}
     
    183191              const QMap<char, t_pppRefSat*>& refSatMap);
    184192
     193  void setStateVectorAndVarCovMatrix(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld);
     194
    185195  void predictCovCrdPart(const SymmetricMatrix& QFltOld);
    186196
     
    197207  t_datumTrafo*   _datumTrafo;
    198208  SymmetricMatrix _QFlt;
     209  SymmetricMatrix _QFlt_sav;
    199210  ColumnVector    _xFlt;
    200211  ColumnVector    _x0;
  • trunk/BNC/src/PPP/pppParlist.cpp

    r9525 r9526  
    829829////////////////////////////////////////////////////////////////////////////
    830830void t_pppParlist::printParams() {
    831   vector<t_pppParam*>::const_iterator it = _params.begin();
    832   while (it != _params.end()) {
    833     t_pppParam* par = *it;
    834     LOG << "par " << par->toString() << "  lastObsTime valid? " << par->lastObsTime().valid()<< endl;
    835   }
    836 }
    837 
     831
     832  for (unsigned iPar = 0; iPar < _params.size(); iPar++) {
     833    LOG << "t_pppFilter::processEpoch par_cur " << _params[iPar]->toString()
     834        << "  lastObsTime().valid() " << _params[iPar]->lastObsTime().valid() << endl;
     835  }
     836}
     837
Note: See TracChangeset for help on using the changeset viewer.