source: ntrip/trunk/BNC/src/PPP/pppFilter.h@ 8956

Last change on this file since 8956 was 8956, checked in by stuerze, 4 years ago

update regarding PPP

  • Property svn:keywords set to Author Date Id Rev URL;svn:eol-style=native
  • Property svn:mime-type set to text/plain
File size: 4.1 KB
RevLine 
[7237]1#ifndef FILTER_H
2#define FILTER_H
3
4#include <vector>
5#include <newmat.h>
6#include "pppInclude.h"
7#include "pppParlist.h"
8#include "bnctime.h"
9#include "t_prn.h"
10
11namespace BNC_PPP {
12
13class t_pppParlist;
14class t_pppObsPool;
15class t_pppSatObs;
16
17class t_pppFilter {
18 public:
[8905]19 t_pppFilter(t_pppObsPool* obsPool);
[7237]20 ~t_pppFilter();
21
[8905]22 t_irc processEpoch(int num);
[7237]23
[8956]24 void datumTransformation(const ColumnVector& xFltOld, const SymmetricMatrix& QFltOld);
[8912]25
[7237]26 const ColumnVector& x() const {return _xFlt;}
27 const SymmetricMatrix& Q() const {return _QFlt;}
28
29 int numSat() const {return _numSat;}
[7928]30 double HDOP() const {return _dop.H;}
31 double HDOV() const {return _dop.V;}
[7237]32 double PDOP() const {return _dop.P;}
33 double GDOP() const {return _dop.G;}
34 double trp() const {
35 const std::vector<t_pppParam*>& par = _parlist->params();
36 for (unsigned ii = 0; ii < par.size(); ++ii) {
37 if (par[ii]->type() == t_pppParam::trp) {
38 return x()[ii];
39 }
40 }
41 return 0.0;
42 };
43 double trpStdev() const {
44 const std::vector<t_pppParam*>& par = _parlist->params();
45 for (unsigned ii = 0; ii < par.size(); ++ii) {
46 if (par[ii]->type() == t_pppParam::trp) {
47 return sqrt(Q()[ii][ii]);
48 }
49 }
50 return 0.0;
51 };
52
53 private:
54 class t_slip {
55 public:
56 t_slip() {
57 _slip = false;
58 _obsSlipCounter = -1;
59 _biasJumpCounter = -1;
60 }
61 bool _slip;
62 int _obsSlipCounter;
63 int _biasJumpCounter;
64 };
65
66 class t_dop {
67 public:
68 t_dop() {reset();}
[7928]69 void reset() {H = V = P = T = G = 0.0;}
70 double H;
71 double V;
[7237]72 double P;
73 double T;
74 double G;
75 };
76
[8956]77 class t_datumTrafo {
[8915]78 public:
79 t_datumTrafo () {initIndices();}
80 void initIndices() {_firstRow = 1; _lastRow = 0;}
81 void setFirstSystem(bool firstSys) {_firstSys = firstSys;}
82 bool firstSystem() {return _firstSys;}
83 void updateIndices(int maxObs) {
[8956]84 if (firstSystem()) {
[8915]85 initIndices();
86 }
87 else {
88 _firstRow += maxObs;
89 }
90 _lastRow += maxObs;
91 };
92 void initAA(int maxObs, int numPar) {
93 _AA1.ReSize(maxObs, numPar); _AA1 = 0.0;
94 _AA2.ReSize(maxObs, numPar); _AA2 = 0.0;
95 }
[8956]96 void prepareAA(const Matrix& AA, int numEpoProcessing, int nPar) {
97 Matrix* Prep = &_AA2;
98 if (numEpoProcessing == 1) {
99 Prep = &_AA1;
[8915]100 }
[8956]101 Prep->SubMatrix(_firstRow, _lastRow, 1, nPar) << AA;
[8915]102 }
[8956]103
104 Matrix computeTrafoMatrix() {
[8915]105 Matrix D21 = (_AA2.t() * _AA2).i() * _AA2.t() * _AA1;
[8956]106 return D21;
[8915]107 }
[8956]108
109 static void printMatrix(const Matrix& X, int nRow, int nCol) {
110 for (int rr = 0; rr < nRow; rr++) {
111 for (int cc = 0; cc < nCol; cc++) {
112 cout << setw(7) << setprecision(4) << X[rr][cc] << " ";
113 }
114 cout << endl; }
115 cout << endl;
116 }
[8915]117 int _firstRow;
118 int _lastRow;
119 Matrix _AA1;
120 Matrix _AA2;
121 bool _firstSys;
122 };
123
[7302]124 t_irc processSystem(const std::vector<t_lc::type>& LCs,
[8905]125 const std::vector<t_pppSatObs*>& obsVector,
126 const t_prn& refPrn,
127 bool pseudoObsIonoAvailable,
128 bool preProcessing);
[7237]129
[7302]130 t_irc detectCycleSlips(const std::vector<t_lc::type>& LCs,
[8905]131 const std::vector<t_pppSatObs*>& obsVector,
132 const t_prn& refPrn,
133 bool preProcessing);
[7237]134
135 t_irc resetAmb(t_prn prn, const std::vector<t_pppSatObs*>& obsVector,
136 SymmetricMatrix* QSav = 0, ColumnVector* xSav = 0);
137
138 void cmpDOP(const std::vector<t_pppSatObs*>& obsVector);
139
140 void predictCovCrdPart(const SymmetricMatrix& QFltOld);
141
[8956]142 t_irc addInfiniteNoise(t_pppParam::e_type para);
143
[7237]144 bncTime _epoTime;
145 t_pppParlist* _parlist;
[8905]146 t_pppObsPool* _obsPool;
[8915]147 t_datumTrafo* _datumTrafo;
[7237]148 SymmetricMatrix _QFlt;
149 ColumnVector _xFlt;
150 ColumnVector _x0;
151 t_slip _slips[t_prn::MAXPRN+1];
152 int _numSat;
[8915]153 int _numEpoProcessing;
154 int _numAllUsedLCs;
[7237]155 t_dop _dop;
156 bncTime _firstEpoTime;
[7302]157 bncTime _lastEpoTimeOK;
[8910]158 t_prn _refPrn;
[7237]159};
160
161}
162
163#endif
Note: See TracBrowser for help on using the repository browser.