[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 |
|
---|
| 11 | namespace BNC_PPP {
|
---|
| 12 |
|
---|
| 13 | class t_pppParlist;
|
---|
| 14 | class t_pppObsPool;
|
---|
| 15 | class t_pppSatObs;
|
---|
| 16 |
|
---|
| 17 | class 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 |
|
---|
[8912] | 24 | void datumTransformation();
|
---|
| 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 |
|
---|
[8915] | 77 | class t_datumTrafo{
|
---|
| 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) {
|
---|
| 84 | if (_firstSys) {
|
---|
| 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 | }
|
---|
| 96 | void prepareAA(Matrix& AA, int _numEpoProcessing, int nPar) {
|
---|
| 97 | Matrix& Prep = _AA2;
|
---|
| 98 | if (_numEpoProcessing == 1) {
|
---|
| 99 | Prep = _AA1;
|
---|
| 100 | }
|
---|
| 101 | Prep.SubMatrix(_firstRow, _lastRow, 1, nPar) = AA;
|
---|
| 102 | }
|
---|
| 103 | Matrix varCov(const SymmetricMatrix& QFlt) {
|
---|
| 104 | Matrix D21 = (_AA2.t() * _AA2).i() * _AA2.t() * _AA1;
|
---|
| 105 | return D21 * QFlt * D21.t();
|
---|
| 106 | }
|
---|
| 107 | int _firstRow;
|
---|
| 108 | int _lastRow;
|
---|
| 109 | Matrix _AA1;
|
---|
| 110 | Matrix _AA2;
|
---|
| 111 | bool _firstSys;
|
---|
| 112 | };
|
---|
| 113 |
|
---|
[7302] | 114 | t_irc processSystem(const std::vector<t_lc::type>& LCs,
|
---|
[8905] | 115 | const std::vector<t_pppSatObs*>& obsVector,
|
---|
| 116 | const t_prn& refPrn,
|
---|
| 117 | bool pseudoObsIonoAvailable,
|
---|
| 118 | bool preProcessing);
|
---|
[7237] | 119 |
|
---|
[7302] | 120 | t_irc detectCycleSlips(const std::vector<t_lc::type>& LCs,
|
---|
[8905] | 121 | const std::vector<t_pppSatObs*>& obsVector,
|
---|
| 122 | const t_prn& refPrn,
|
---|
| 123 | bool preProcessing);
|
---|
[7237] | 124 |
|
---|
| 125 | t_irc resetAmb(t_prn prn, const std::vector<t_pppSatObs*>& obsVector,
|
---|
| 126 | SymmetricMatrix* QSav = 0, ColumnVector* xSav = 0);
|
---|
| 127 |
|
---|
| 128 | void cmpDOP(const std::vector<t_pppSatObs*>& obsVector);
|
---|
| 129 |
|
---|
| 130 | void predictCovCrdPart(const SymmetricMatrix& QFltOld);
|
---|
| 131 |
|
---|
| 132 | bncTime _epoTime;
|
---|
| 133 | t_pppParlist* _parlist;
|
---|
[8905] | 134 | t_pppObsPool* _obsPool;
|
---|
[8915] | 135 | t_datumTrafo* _datumTrafo;
|
---|
[7237] | 136 | SymmetricMatrix _QFlt;
|
---|
| 137 | ColumnVector _xFlt;
|
---|
| 138 | ColumnVector _x0;
|
---|
| 139 | t_slip _slips[t_prn::MAXPRN+1];
|
---|
| 140 | int _numSat;
|
---|
[8915] | 141 | int _numEpoProcessing;
|
---|
| 142 | int _numAllUsedLCs;
|
---|
[7237] | 143 | t_dop _dop;
|
---|
| 144 | bncTime _firstEpoTime;
|
---|
[7302] | 145 | bncTime _lastEpoTimeOK;
|
---|
[8910] | 146 | t_prn _refPrn;
|
---|
[7237] | 147 | };
|
---|
| 148 |
|
---|
| 149 | }
|
---|
| 150 |
|
---|
| 151 | #endif
|
---|