Changeset 8912 in ntrip for trunk


Ignore:
Timestamp:
Apr 6, 2020, 10:43:22 AM (4 years ago)
Author:
stuerze
Message:

minor changes regarding PPP (not completed)

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

Legend:

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

    r8910 r8912  
    6868
    6969  if (_opt->_refSatRequired) {
    70     for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    71       char system = OPT->systems()[iSys];
     70    for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) {
     71      char system = _opt->systems()[iSys];
    7272      _obsPool->initRefSatMapElement(system);
    7373    }
     
    165165  for (unsigned ii = 0; ii < satObs.size(); ii++) {
    166166    char system = satObs[ii]->_prn.system();
    167     if (OPT->useSystem(system)) {
     167    if (_opt->useSystem(system)) {
    168168      t_pppSatObs* pppSatObs = new t_pppSatObs(*satObs[ii]);
    169169      if (pppSatObs->isValid()) {
     
    180180  if (_opt->_refSatRequired) {
    181181    // reference satellite definition per system
    182     for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    183       char system = OPT->systems()[iSys];
     182    for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) {
     183      char system = _opt->systems()[iSys];
    184184      bool refSatDefined = false;
    185185      t_pppRefSat* refSat = _obsPool->getRefSatMapElement(system);
     
    187187        const t_pppSatObs* satObs = obsVector.at(ii);
    188188        // reference satellite is unchanged
    189         if      (!_obsPool->epoReProcessing() && refSat->prn() == satObs->prn()) {
     189        if      (!_obsPool->refSatChangeRequired() && refSat->prn() == satObs->prn()) {
    190190          refSatDefined = true;
    191191          obsVector[ii]->setAsReference();
     
    193193        }
    194194        // reference satellite has changed
    195         else if (_obsPool->epoReProcessing() && refSat->prn() != satObs->prn()) {
     195        else if ( _obsPool->refSatChangeRequired() && refSat->prn() != satObs->prn()) {
    196196          if (satObs->prn().system() == system) {
    197197            refSatDefined = true;
     
    217217      }
    218218    }
    219     _obsPool->setEpoReProcessing(false); //TODO: später erst nach Trafo false setzen
     219    _obsPool->setRefSatChangeRequired(false);
    220220  }
    221221
     
    252252  bool pseudoObsIono = false;
    253253
    254   if (OPT->_pseudoObsIono) {
     254  if (_opt->_pseudoObsIono) {
    255255    vector<t_pppSatObs*>::iterator it = obsVector.begin();
    256256    while (it != obsVector.end()) {
     
    295295        }
    296296      }
    297       if ( satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle) ) {
     297      if ( satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle) ) {
    298298        ++iObs;
    299299        BB[iObs][0] = satObs->xc()[0];
     
    303303      }
    304304    }
    305     if (iObs + 1 < OPT->_minObs) {
     305    if (iObs + 1 < _opt->_minObs) {
    306306      LOG << "t_pppClient::cmpBancroft not enough observations" << endl;
    307307      return failure;
     
    321321      if (satObs->isValid() &&
    322322          satObs->prn().system() == 'G' &&
    323           (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle) ) {
     323          (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle) ) {
    324324        ColumnVector rr = satObs->xc().Rows(1,3) - xyzc.Rows(1,3);
    325325        double res = rr.NormFrobenius() - satObs->obsValue(tLC)
     
    363363  double     offGG = 0.0;
    364364
    365   if (OPT->useSystem('R')) {
     365  if (_opt->useSystem('R')) {
    366366    while (obsVector.size() > 0) {
    367367      offGG = 0.0;
     
    376376            tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
    377377          }
    378           if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle)) {
     378          if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {
    379379            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
    380380            ++nObs;
     
    465465  bncTime time;
    466466  time = _epoTimeRover;
    467   station->setName(OPT->_roverName);
    468   station->setAntName(OPT->_antNameRover);
     467  station->setName(_opt->_roverName);
     468  station->setAntName(_opt->_antNameRover);
    469469  station->setEpochTime(time);
    470   if (OPT->xyzAprRoverSet()) {
    471     station->setXyzApr(OPT->_xyzAprRover);
     470  if (_opt->xyzAprRoverSet()) {
     471    station->setXyzApr(_opt->_xyzAprRover);
    472472  }
    473473  else {
    474474    station->setXyzApr(xyzc.Rows(1,3));
    475475  }
    476   station->setNeuEcc(OPT->_neuEccRover);
     476  station->setNeuEcc(_opt->_neuEccRover);
    477477
    478478  // Receiver Clock
     
    495495    }
    496496    if (satObs->isValid() &&
    497         satObs->eleSat() >= OPT->_minEle &&
     497        satObs->eleSat() >= _opt->_minEle &&
    498498        modelSetup == success) {
    499       if (satObs->isReference() && OPT->_pseudoObsIono) {
     499      if (satObs->isReference() && _opt->_pseudoObsIono) {
    500500        char system = satObs->prn().system();
    501501        t_pppRefSat* refSat = _obsPool->getRefSatMapElement(system);
     
    519519  try {
    520520    initOutput(output);
    521     _num = 0;
    522     _obsPool->setEpoReProcessing(false); // initialize for epoch
     521    int num = 0;
     522    bool epochReProcessing = false;
    523523
    524524    do {
    525       _num++;
     525      num++;
    526526
    527527      // Prepare Observations of the Rover
     
    550550      // Prepare Pseudo Observations of the Rover
    551551      // ----------------------------------------
    552       _pseudoObsIono = preparePseudoObs(_obsRover);//qDebug() << "_pseudoObsIonoAvailable: " << _pseudoObsIono;
    553 
    554       if (int(_obsRover.size()) < OPT->_minObs) {
     552      _pseudoObsIono = preparePseudoObs(_obsRover);
     553      if (int(_obsRover.size()) < _opt->_minObs) {
    555554        LOG << "t_pppClient::processEpoch not enough observations" << endl;
    556555        return finish(failure);
    557556      }
    558557
    559       if (OPT->_refSatRequired) {
     558      if (_opt->_refSatRequired) {
    560559        LOG.setf(ios::fixed);
    561560        QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap());
     
    575574      // Process Epoch in Filter
    576575      // -----------------------
    577       if (_filter->processEpoch(_num) != success) {
     576      if (_filter->processEpoch(num) != success) {
    578577        return finish(failure);
    579578      }
    580       // if num > 1 und !obsPool->epoReProcessing() => filter ->datumTransformation
    581     } while (_obsPool->epoReProcessing());
     579
     580      // Epoch re-processing required?
     581      // -----------------------------
     582      if (_obsPool->refSatChangeRequired()) {
     583        epochReProcessing = true;
     584      }
     585      else {
     586        epochReProcessing = false;
     587      }
     588      // Datum transformation required?
     589      // ------------------------------
     590      if (num > 1 && epochReProcessing) {
     591        _filter->datumTransformation();
     592      }
     593
     594    } while (epochReProcessing);
    582595  }
    583596  catch (Exception& exc) {
  • trunk/BNC/src/PPP/pppFilter.cpp

    r8910 r8912  
    5151t_irc t_pppFilter::processEpoch(int num) {
    5252  _numSat     = 0;
     53  _numOfEpochProcessing = num;
    5354  const double maxSolGap = 60.0;
    5455
     
    8788  ColumnVector    xFltOld = _xFlt;
    8889  SymmetricMatrix QFltOld = _QFlt;
    89 
    9090  _QFlt.ReSize(_parlist->nPar()); _QFlt = 0.0;
    9191  _xFlt.ReSize(_parlist->nPar()); _xFlt = 0.0;
    9292  _x0.ReSize(_parlist->nPar());   _x0   = 0.0;
    93 
    9493  for (unsigned ii = 0; ii < params.size(); ii++) {
    9594    const t_pppParam* par1 = params[ii];
     
    111110    }
    112111  }
    113 
    114112  predictCovCrdPart(QFltOld);
    115113
     
    141139  // Process Satellite Systems separately
    142140  // ------------------------------------
     141  int numOfAllUsedLCs = 0;
     142  preProcessing = false;
    143143  for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    144144    char system = OPT->systems()[iSys];
     145    numOfAllUsedLCs += OPT->LCs(system).size();
    145146    if (OPT->_refSatRequired) {
    146147      _refPrn = (_obsPool->getRefSatMapElement(system))->prn();
     
    160161    }
    161162  }
    162   if (_obsPool->epoReProcessing()) {
    163     // set A1 und A2 abhängig von num
    164     // if num == 1 => A1
    165     // if num >  1 => A2
    166   }
     163
     164  // refSat change required?
     165  // -----------------------
     166  if (_obsPool->refSatChangeRequired()) {
     167    _xFlt = xFltOld;
     168    _QFlt = QFltOld;
     169    initDatumTransformation(numOfAllUsedLCs);
     170  }
     171  // close epoch processing
     172  // ----------------------
    167173  else {
    168174    cmpDOP(allObs);
     
    223229    ColumnVector          ll(maxObs);
    224230    DiagonalMatrix        PP(maxObs); PP = 0.0;
    225     //TETSPLOT
     231
     232    // TETSPLOT
    226233    for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    227234      const t_pppParam* par = params[iPar];
     
    229236    }
    230237    cout << endl;
     238    //END TETSPLOT
    231239
    232240    int iObs = -1;
     
    307315      if      (par && preProcessing) {
    308316        if (par->prn() == refPrn) {
    309           _obsPool->setEpoReProcessing(true);
     317          _obsPool->setRefSatChangeRequired(true);
    310318        }
    311319      }
     
    392400          if (preProcessing) {
    393401            if (obs->prn() == refPrn) {
    394               _obsPool->setEpoReProcessing(true);
     402              _obsPool->setRefSatChangeRequired(true);
    395403            }
    396404          }
     
    412420            if (preProcessing) {
    413421              if (obs->prn() == refPrn) {
    414                 _obsPool->setEpoReProcessing(true);
     422                _obsPool->setRefSatChangeRequired(true);
    415423              }
    416424            }
     
    542550  }
    543551}
     552
     553//
     554////////////////////////////////////////////////////////////////////////////
     555void t_pppFilter::initDatumTransformation(int numOfUsedLCs) {
     556
     557  if (_numOfEpochProcessing == 1) {
     558           _AA1.ReSize(numOfUsedLCs, _parlist->nPar());
     559           _AA1 = 0.0;
     560     _AA2.ReSize(numOfUsedLCs, _parlist->nPar());
     561     _AA2 = 0.0;
     562  }
     563}
     564
     565//
     566////////////////////////////////////////////////////////////////////////////
     567void t_pppFilter::datumTransformation() {
     568
     569  Matrix D21 = (_AA2.t() * _AA2).i() * _AA2.t() * _AA1;
     570
     571  _QFlt = D21 * _QFlt * D21.t();
     572}
     573
     574
     575
     576
  • trunk/BNC/src/PPP/pppFilter.h

    r8910 r8912  
    2121
    2222  t_irc processEpoch(int num);
     23
     24  void datumTransformation();
    2325
    2426  const ColumnVector&    x() const {return _xFlt;}
     
    9193  void predictCovCrdPart(const SymmetricMatrix& QFltOld);
    9294
     95  void initDatumTransformation(int numOfAllUsedLCs);
     96
    9397  bncTime         _epoTime;
    9498  t_pppParlist*   _parlist;
    9599  t_pppObsPool*   _obsPool;
    96100  SymmetricMatrix _QFlt;
     101  Matrix          _AA1;
     102  Matrix          _AA2;
    97103  ColumnVector    _xFlt;
    98104  ColumnVector    _x0;
    99105  t_slip          _slips[t_prn::MAXPRN+1];
    100106  int             _numSat;
     107  int             _numOfEpochProcessing;
    101108  t_dop           _dop;
    102109  bncTime         _firstEpoTime;
Note: See TracChangeset for help on using the changeset viewer.