Changeset 9504 in ntrip


Ignore:
Timestamp:
Sep 24, 2021, 2:34:28 PM (17 months ago)
Author:
stuerze
Message:

update regarding PPP

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

Legend:

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

    r9491 r9504  
    3434////////////////////////////////////////////////////////////////////////////
    3535t_pppFilter::t_pppFilter(t_pppObsPool* obsPool) {
    36   _parlist = 0;
    3736  _numSat = 0;
    3837  _obsPool = obsPool;
     
    4443////////////////////////////////////////////////////////////////////////////
    4544t_pppFilter::~t_pppFilter() {
    46   delete _parlist;
    4745  delete _datumTrafo;
    4846}
     
    5351  _numSat     = 0;
    5452  const double maxSolGap = 60.0;
    55 
    56   if (!_parlist) {
    57     _parlist = new t_pppParlist();
    58   }
    5953
    6054  // Vector of all Observations
     
    7872  string epoTimeStr = string(_epoTime);
    7973
     74  if (OPT->_obsModelType == OPT->DCMcodeBias ||
     75      OPT->_obsModelType == OPT->DCMphaseBias) {
     76     // Save parameters of epoch before
     77    _parlist_sav = _parlist;
     78 }
     79
    8080  //--
    8181  // Set Parameters
    82   // --------------
    83   if (_parlist->set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) {
     82  if (_parlist.set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) {
    8483    return failure;
    8584  }
    86   const vector<t_pppParam*>& params = _parlist->params();
     85
     86  const vector<t_pppParam*>& params = _parlist.params();
    8787#ifdef BNC_DEBUG_PPP
    88   for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    89     LOG << params[iPar]->toString() << endl;
     88  for (int iPar = 0; iPar < params.size(); iPar++) {
     89    LOG << "available par " << params[iPar]->toString() << endl;
    9090  }
    9191#endif
     
    9696  SymmetricMatrix QFltOld = _QFlt;
    9797
    98   _QFlt.ReSize(_parlist->nPar()); _QFlt = 0.0;
    99   _xFlt.ReSize(_parlist->nPar()); _xFlt = 0.0;
    100   _x0.ReSize(_parlist->nPar());   _x0   = 0.0;
     98  _QFlt.ReSize(_parlist.nPar()); _QFlt = 0.0;
     99  _xFlt.ReSize(_parlist.nPar()); _xFlt = 0.0;
     100  _x0.ReSize(_parlist.nPar());   _x0   = 0.0;
    101101
    102102  for (unsigned ii = 0; ii < params.size(); ii++) {
     
    130130      OPT->_obsModelType == OPT->DCMphaseBias) {
    131131    preProcessing = true;
    132     QList<char>& usedSystems = _parlist->usedSystems();
     132    const QList<char>& usedSystems = _parlist.usedSystems();
    133133    for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
    134134      char sys = usedSystems[iSys];
     
    155155      _xFlt = xFltOld;
    156156      _QFlt = QFltOld;
     157      _parlist = _parlist_sav;
    157158      return success;
    158159    }
     
    165166  // ------------------------------------
    166167  preProcessing = false;
    167   QList<char>& usedSystems = _parlist-> usedSystems();
     168  const QList<char>& usedSystems = _parlist. usedSystems();
    168169  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
    169170    char sys = usedSystems[iSys];
     
    195196  // ----------------------
    196197  cmpDOP(allObs);
    197   _parlist->printResult(_epoTime, _QFlt, _xFlt);
     198  _parlist.printResult(_epoTime, _QFlt, _xFlt);
    198199  _lastEpoTimeOK = _epoTime;  // remember time of last successful epoch processing
    199200  if (OPT->_refSatRequired) {
    200201    _obsPool->saveLastEpoRefSats();
    201     _datumTrafo->setLastEpoParlist(_parlist);
    202202  }
    203203  return success;
     
    226226  SymmetricMatrix            QSav       = _QFlt;
    227227  string                     epoTimeStr = string(_epoTime);
    228   const vector<t_pppParam*>& params     = _parlist->params();
     228  const vector<t_pppParam*>& params     = _parlist.params();
    229229
    230230  unsigned usedLCs     = LCs.size();
     
    256256    // First-Design Matrix, Terms Observed-Computed, Weight Matrix
    257257    // -----------------------------------------------------------
    258     Matrix                AA(maxObs, _parlist->nPar());
     258    Matrix                AA(maxObs, _parlist.nPar());
    259259    ColumnVector          ll(maxObs);
    260260    DiagonalMatrix        PP(maxObs); PP = 0.0;
     
    318318        (!preProcessing)) {
    319319      _datumTrafo->updateIndices(sys, iObs+1);
    320       _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist->nPar()), 1);
     320      _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist.nPar()), 1);
    321321    }
    322322
     
    460460  char sys = refPrn.system();
    461461  string epoTimeStr = string(_epoTime);
    462   const vector<t_pppParam*>& params  = _parlist->params();
     462  const vector<t_pppParam*>& params  = _parlist.params();
    463463
    464464  for (unsigned ii = 0; ii < LCs.size(); ii++) {
     
    542542
    543543  t_irc irc = failure;
    544   vector<t_pppParam*>& params = _parlist->params();
     544  vector<t_pppParam*>& params = _parlist.params();
    545545  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    546546    t_pppParam* par = params[iPar];
     
    579579
    580580  t_irc irc = failure;
    581   vector<t_pppParam*>& params = _parlist->params();
     581  vector<t_pppParam*>& params = _parlist.params();
    582582  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    583583    t_pppParam* par = params[iPar];
     
    614614        ++_numSat;
    615615        for (unsigned iPar = 0; iPar < numPar; iPar++) {
    616           const t_pppParam* par = _parlist->params()[iPar];
     616          const t_pppParam* par = _parlist.params()[iPar];
    617617          AA[_numSat-1][iPar] = par->partial(_epoTime, obs, t_lc::c1, refPrn);
    618618        }
     
    640640void t_pppFilter::predictCovCrdPart(const SymmetricMatrix& QFltOld) {
    641641
    642   const vector<t_pppParam*>& params = _parlist->params();
     642  const vector<t_pppParam*>& params = _parlist.params();
    643643  if (params.size() < 3) {
    644644    return;
     
    705705  // set AA2
    706706  // =======
    707   t_pppParlist* parlist = _datumTrafo->lastEpoParlist();
    708   if (parlist->set(epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) {
     707  if (_parlist.set(epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) {
    709708    return failure;
    710709  }
    711   vector<t_pppParam*>& params = parlist->params();
    712   unsigned nPar = parlist->nPar();
     710  const vector<t_pppParam*>& _params = _parlist.params();
     711  unsigned nPar = _parlist.nPar();
    713712#ifdef BNC_DEBUG_PPP
    714713  LOG << " parameters of last epoch" << endl;
    715714  for (unsigned iPar = 0; iPar < nPar; iPar++) {
    716     LOG << params[iPar]->toString() << "\t\t" << endl;
     715    LOG << _params[iPar]->toString() << "\t\t" << endl;
    717716  }
    718717#endif
    719   QList<char>& usedSystems = _parlist->usedSystems();
     718  const QList<char>& usedSystems = _parlist.usedSystems();
    720719  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
    721720    char sys = usedSystems[iSys];
     
    760759        if (tLC == t_lc::Tz0) {continue;}
    761760        ++iObs;
    762         for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    763           const t_pppParam* par = params[iPar];
     761        for (unsigned iPar = 0; iPar < _params.size(); iPar++) {
     762          const t_pppParam* par = _params[iPar];
    764763          AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
    765764        }
     
    778777          ++iObs;
    779778          pseudoObsTropoConsidered = true;
    780           for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    781             const t_pppParam* par = params[iPar];
     779          for (unsigned iPar = 0; iPar < _params.size(); iPar++) {
     780            const t_pppParam* par = _params[iPar];
    782781            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn);
    783782          }
     
    836835  _datumTrafo->switchAA();
    837836
    838   // save parameter list
    839   // ====================
    840   _datumTrafo->setLastEpoParlist(_parlist);
    841837  return success;
    842838}
     
    847843                                          bool pseudoObsIono) {
    848844  unsigned trafoObs = 0;
    849   QList<char>& usedSystems = _parlist-> usedSystems();
     845  const QList<char>& usedSystems = _parlist. usedSystems();
    850846  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
    851847    char sys = usedSystems[iSys];
     
    875871  }
    876872  _datumTrafo->setNumObs(trafoObs);
    877   _datumTrafo->setNumPar(_parlist->nPar());
     873  _datumTrafo->setNumPar(_parlist.nPar());
    878874  _datumTrafo->initAA();
    879875}
     
    884880  bool resetRefSat;
    885881  // reference satellite definition per system
    886   QList<char>& usedSystems = _parlist-> usedSystems();
     882  const QList<char>& usedSystems = _parlist.usedSystems();
    887883  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
    888884    resetRefSat = false;
  • trunk/BNC/src/PPP/pppFilter.h

    r9433 r9504  
    3636  double GDOP() const {return _dop.G;}
    3737  double trp() const {
    38     const std::vector<t_pppParam*>& par = _parlist->params();
     38    const std::vector<t_pppParam*>& par = _parlist.params();
    3939    for (unsigned ii = 0; ii < par.size(); ++ii) {
    4040      if (par[ii]->type() == t_pppParam::trp) {
     
    4545  };
    4646  double trpStdev() const {
    47     const std::vector<t_pppParam*>& par = _parlist->params();
     47    const std::vector<t_pppParam*>& par = _parlist.params();
    4848    for (unsigned ii = 0; ii < par.size(); ++ii) {
    4949      if (par[ii]->type() == t_pppParam::trp) {
     
    9191        _firstRow = _lastRow + 1;
    9292      }
    93       _lastRow += maxObsSys;//LOG << "updateIndices: lastRow: " << _lastRow << endl;
     93      _lastRow += maxObsSys;//LOG << sys << " updateIndices: lastRow: " << _lastRow << "\n" ;
    9494    };
    9595
     
    110110      _AA2 = _AA2.SubMatrix(1, _lastRow, 1, _numPar);
    111111    }
    112 
    113     void setLastEpoParlist(t_pppParlist* parlist) {_parlist = parlist;}
    114     t_pppParlist* lastEpoParlist() {return _parlist;}
    115112
    116113    const Matrix& AA1() {return _AA1;}
     
    161158    int               _numPar;
    162159    QMap<char, t_prn> _refSatMapPseudoObs;
    163     t_pppParlist*     _parlist;
    164160  };
    165161
     
    187183
    188184  bncTime         _epoTime;
    189   t_pppParlist*   _parlist;
     185  t_pppParlist    _parlist;
     186  t_pppParlist    _parlist_sav;
    190187  t_pppObsPool*   _obsPool;
    191188  t_datumTrafo*   _datumTrafo;
  • trunk/BNC/src/PPP/pppParlist.cpp

    r9498 r9504  
    3535////////////////////////////////////////////////////////////////////////////
    3636t_pppParam::t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC,
    37                  const vector<t_pppSatObs*>* obsVector) {
     37                       const vector<t_pppSatObs*>* obsVector) {
    3838
    3939  _type     = type;
     
    132132}
    133133
     134//
     135////////////////////////////////////////////////////////////////////////////
     136t_pppParam::t_pppParam(const t_pppParam* old) {
     137  _type     = old->type();
     138  _prn      = old->prn();
     139  _tLC      = old->tLC();
     140  _indexOld = old->indexOld();
     141  _indexNew = old->indexNew();
     142  _noise    = old->noise();
     143  _sigma0   = old->sigma0();
     144  _epoSpec  = old->epoSpec();
     145  _ambInfo  = 0;
     146  if (_type == t_pppParam::amb) {
     147    _ambInfo  = new t_ambInfo();
     148    _ambInfo->_resetCandidate = old->_ambInfo->_resetCandidate;
     149    _ambInfo->_eleSat         = old->_ambInfo->_eleSat;
     150    _ambInfo->_numEpo         = old->_ambInfo->_numEpo;
     151    _x0 = x0();
     152  } else {
     153    cout << endl;
     154  }
     155}
     156
    134157// Destructor
    135158////////////////////////////////////////////////////////////////////////////
    136159t_pppParam::~t_pppParam() {
    137   delete _ambInfo;
    138 }
    139 
     160  if (_ambInfo) {
     161    delete _ambInfo;
     162  }
     163}
    140164//
    141165////////////////////////////////////////////////////////////////////////////
     
    353377////////////////////////////////////////////////////////////////////////////
    354378t_pppParlist::~t_pppParlist() {
    355   for (unsigned ii = 0; ii < _params.size(); ii++) {
    356     delete _params[ii];
    357   }
     379  _usedSystems.clear();
     380
     381  vector<t_pppParam*>::iterator it = _params.begin();
     382  while (it != _params.end()) {
     383    t_pppParam* par = *it;
     384    delete par;
     385    it = _params.erase(it);
     386  }
     387}
     388
     389//
     390////////////////////////////////////////////////////////////////////////////
     391t_pppParlist::t_pppParlist(const t_pppParlist& old) {
     392
     393  _usedSystems = old._usedSystems;
     394
     395  vector<t_pppParam*>::const_iterator it = old.params().begin();
     396  while (it != old.params().end()) {
     397    const t_pppParam* oldParam = *it;
     398    _params.push_back(new t_pppParam(oldParam));
     399  }
     400}
     401
     402//
     403////////////////////////////////////////////////////////////////////////////
     404const t_pppParlist& t_pppParlist::operator= (const t_pppParlist& p) {
     405
     406  _usedSystems.clear();
     407
     408  _usedSystems = p._usedSystems;
     409
     410  vector<t_pppParam*>::iterator it = _params.begin();
     411  while (it != _params.end()) {
     412    t_pppParam* par = *it;
     413    delete par;
     414    it = _params.erase(it);
     415  }
     416
     417  for (unsigned jj = 0; jj < p.params().size(); jj++) {
     418    t_pppParam* parFrom = p.params()[jj];
     419    _params.push_back(new t_pppParam(parFrom));
     420  }
     421  return *this;
    358422}
    359423
     
    685749  t_pppParam* parY = 0;
    686750  t_pppParam* parZ = 0;
    687   for (unsigned ii = 0; ii < _params.size(); ii++) {
    688     t_pppParam* par = _params[ii];
     751  vector<t_pppParam*>::const_iterator it = _params.begin();
     752  while (it != _params.end()) {
     753    t_pppParam* par = *it;
    689754    if      (par->type() == t_pppParam::crdX) {
    690755      parX = par;
     
    710775      LOG << endl;
    711776    }
     777    ++it;
    712778  }
    713779
  • trunk/BNC/src/PPP/pppParlist.h

    r9431 r9504  
    2020
    2121  t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC, const std::vector<t_pppSatObs*>* obsVector = 0);
    22 
     22  t_pppParam(const t_pppParam* old);
    2323  ~t_pppParam();
    2424
     
    7171    return false;
    7272  }
    73 
     73 
    7474 private:
    7575  class t_ambInfo {
     
    103103  t_pppParlist();
    104104  ~t_pppParlist();
    105 
     105  t_pppParlist(const t_pppParlist& old);
     106  const t_pppParlist&operator= (const t_pppParlist& p);
    106107  t_irc set(const bncTime& epoTime, const std::vector<t_pppSatObs*>& obsVector,
    107108            const QMap<char, t_pppRefSat*>& refSatMap);
     
    109110  const std::vector<t_pppParam*>& params() const {return _params;}
    110111        std::vector<t_pppParam*>& params()       {return _params;}
    111   QList<char>& usedSystems() {return _usedSystems;}
     112  const QList<char>& usedSystems() const {return _usedSystems;}
    112113  void printResult(const bncTime& epoTime, const SymmetricMatrix& QQ,
    113114                   const ColumnVector& xx) const;
Note: See TracChangeset for help on using the changeset viewer.