Changeset 10034 in ntrip for trunk/BNC/src/PPP/pppFilter.h


Ignore:
Timestamp:
Apr 21, 2023, 11:48:24 AM (12 months ago)
Author:
stuerze
Message:
 
File:
1 edited

Legend:

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

    r10028 r10034  
    88#include "bnctime.h"
    99#include "t_prn.h"
    10 #include "pppClient.h"
    1110
    1211namespace BNC_PPP {
     
    1817class t_pppFilter {
    1918 public:
    20   t_pppFilter(t_pppObsPool* obsPool);
     19  t_pppFilter();
    2120  ~t_pppFilter();
    2221
    23   t_irc processEpoch(int num);
     22  t_irc processEpoch(t_pppObsPool* obsPool);
    2423
    2524  const ColumnVector&    x() const {return _xFlt;}
    2625  const SymmetricMatrix& Q() const {return _QFlt;}
    27 
    28   t_irc datumTransformation(const QMap<char, t_pppRefSat*>& refSatMap);
    29   void initDatumTransformation(const std::vector<t_pppSatObs*>& allObs, bool pseudoObsIono);
    30   unsigned setTrafoObs();
    31   void restoreState(int num)  {
    32 #ifdef BNC_DEBUG_PPP
    33     LOG << "Restore parameter from last successful epoch: _parlist = _parlist_sav ("<<  num << ")\n";
    34 #endif
    35     _QFlt    = _QFlt_sav;
    36     _parlist = _parlist_sav;
    37   }
    38   void rememberState(int num) {
    39 #ifdef BNC_DEBUG_PPP
    40     LOG << "Remember parameters from successful epoch   : _parlist_sav = _parlist ("<<  num << ")\n";
    41 #endif
    42     _QFlt_sav    = _QFlt;
    43     _parlist_sav = _parlist;
    44   }
    4526
    4627  int    numSat() const {return _numSat;}
     
    5031  double GDOP() const {return _dop.G;}
    5132  double trp() const {
    52     const std::vector<t_pppParam*>& par = _parlist.params();
     33    const std::vector<t_pppParam*>& par = _parlist->params();
    5334    for (unsigned ii = 0; ii < par.size(); ++ii) {
    5435      if (par[ii]->type() == t_pppParam::trp) {
     
    5940  };
    6041  double trpStdev() const {
    61     const std::vector<t_pppParam*>& par = _parlist.params();
     42    const std::vector<t_pppParam*>& par = _parlist->params();
    6243    for (unsigned ii = 0; ii < par.size(); ++ii) {
    6344      if (par[ii]->type() == t_pppParam::trp) {
     
    9273  };
    9374
    94   class t_datumTrafo {
    95   public:
    96     t_datumTrafo () {initIndices();}
    97     ~t_datumTrafo (){}
    98 
    99     void initIndices() {_firstRow = 1; _lastRow = 0;}
    100     void updateIndices(char sys, int maxObsSys) {
    101       if (firstSystem(sys)) {
    102         initIndices();
    103       }
    104       else {
    105         _firstRow = _lastRow + 1;
    106       }
    107       _lastRow += maxObsSys;
    108 
    109     };
    110 
    111     void setFirstSystem(char firstSys) { _firstSys = firstSys;}
    112     bool firstSystem(char sys) {
    113       if (_firstSys == sys) {
    114         return true;
    115       }
    116       return false;
    117     }
    118     void setNumObs(int maxObs) {_maxObs = maxObs;}
    119     void setNumPar(int numPar) {_numPar = numPar;}
    120     int numPar() {return _numPar;}
    121     int numObs() {return _maxObs;}
    122     void updateNumObs() {
    123       _maxObs = _lastRow;
    124       _AA1 = _AA1.SubMatrix(1, _lastRow, 1, _numPar);
    125       _AA2 = _AA2.SubMatrix(1, _lastRow, 1, _numPar);
    126     }
    127 
    128     const Matrix& AA1() {return _AA1;}
    129     const Matrix& AA2() {return _AA2;}
    130     const Matrix& D21() {return _D21;}
    131 
    132     void initAA() {
    133       _AA1.ReSize(_maxObs, _numPar); _AA1 = 0.0;
    134       _AA2.ReSize(_maxObs, _numPar); _AA2 = 0.0;
    135       _D21.ReSize(_numPar, _numPar); _D21 = 0.0;
    136     }
    137     t_irc prepareAA(const Matrix& AA, int ind) {
    138 
    139       Matrix* Prep = &_AA2;
    140       if (ind == 1) {
    141         Prep = &_AA1;
    142       }
    143       if (AA.Ncols() != _numPar) {
    144         LOG << "t_pppFilter::prepareAA: AA.Ncols() != _numPar: " << AA.Ncols() << " != " << _numPar << "\n RETURN FAILURE" <<  std::endl;
    145         return failure;
    146       }
    147       Prep->SubMatrix(_firstRow, _lastRow, 1, _numPar) = AA;
    148       return success;
    149     }
    150     void switchAA() {
    151       _AA1 = _AA2;
    152     }
    153     t_irc computeTrafoMatrix() {
    154       if (((_AA2.t() * _AA2)).Determinant() == 0.0) {
    155         LOG << "t_pppFilter::computeTrafoMatrix: (_AA2.t() * _AA2).inv() is singular" << std::endl;
    156         return failure;
    157       }
    158       _D21 = ((_AA2.t() * _AA2).i()) * _AA2.t() * _AA1;
    159       return success;
    160     }
    161 
    162     void printMatrix(const Matrix& X, int nRow, int nCol) {
    163       for (int rr = 0; rr < nRow; rr++) {
    164         for (int cc = 0; cc < nCol; cc++) {
    165           LOG << std::setw(6) << std::setprecision(3) << X[rr][cc] << " ;";
    166         }
    167         LOG << std::endl;
    168       }
    169       LOG << std::endl;
    170     }
    171   private:
    172     int               _firstRow;
    173     int               _lastRow;
    174     Matrix            _AA1;
    175     Matrix            _AA2;
    176     Matrix            _D21;
    177     char              _firstSys;
    178     int               _maxObs;
    179     int               _numPar;
    180     QMap<char, t_prn> _refSatMapPseudoObs;
    181   };
    182 
    18375  t_irc processSystem(const std::vector<t_lc::type>& LCs,
    18476                      const std::vector<t_pppSatObs*>& obsVector,
    185                       const t_prn& refPrn,
    186                       bool pseudoObsIonoAvailable,
    187                       bool preProcessing);
     77                      bool pseudoObsIonoAvailable);
    18878
    18979  t_irc detectCycleSlips(const std::vector<t_lc::type>& LCs,
    190                          const std::vector<t_pppSatObs*>& obsVector,
    191                          const t_prn& refPrn,
    192                          bool preProcessing);
     80                         const std::vector<t_pppSatObs*>& obsVector);
    19381
    19482  t_irc resetAmb(t_prn prn, const std::vector<t_pppSatObs*>& obsVector, t_lc::type lc,
    19583                 SymmetricMatrix* QSav = 0, ColumnVector* xSav = 0);
    19684
    197   void cmpDOP(const std::vector<t_pppSatObs*>& obsVector,
    198               const QMap<char, t_pppRefSat*>& refSatMap);
     85  void cmpDOP(const std::vector<t_pppSatObs*>& obsVector);
    19986
    20087  void setStateVectorAndVarCovMatrix(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld,
     
    20390  void predictCovCrdPart(const SymmetricMatrix& QFltOld, bool setNeuNoiseToZero);
    20491
    205   t_irc addNoiseToPar(t_pppParam::e_type parType, char sys);
    206 
    207   bool resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector,
    208                                    const QMap<char, t_pppRefSat*>& refSatMap,
    209                                    const QMap<char, t_pppRefSat*>& refSatMapLastEpoch);
    210 
    21192  bncTime         _epoTime;
    212   t_pppParlist    _parlist;
    213   t_pppParlist    _parlist_sav;
    214   t_pppObsPool*   _obsPool;
    215   t_datumTrafo*   _datumTrafo;
     93  t_pppParlist*   _parlist;
    21694  SymmetricMatrix _QFlt;
    217   SymmetricMatrix _QFlt_sav;
    21895  ColumnVector    _xFlt;
    21996  ColumnVector    _x0;
     
    223100  bncTime         _firstEpoTime;
    224101  bncTime         _lastEpoTimeOK;
    225   t_prn           _refPrn;
    226102};
    227103
Note: See TracChangeset for help on using the changeset viewer.