source: ntrip/trunk/BNC/src/PPP_free/pppFilter.h@ 6653

Last change on this file since 6653 was 6653, checked in by stuerze, 10 years ago

sinex tro file support added,
troposphere results in overall ppp logfile added

File size: 6.7 KB
Line 
1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters.
3//
4// Copyright (C) 2007
5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
7// Czech Technical University Prague, Department of Geodesy
8// http://www.fsv.cvut.cz
9//
10// Email: euref-ip@bkg.bund.de
11//
12// This program is free software; you can redistribute it and/or
13// modify it under the terms of the GNU General Public License
14// as published by the Free Software Foundation, version 2.
15//
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25#ifndef PPPFILTER_H
26#define PPPFILTER_H
27
28#include <QtCore>
29#include <QtNetwork>
30#include <newmat.h>
31
32#include "bncconst.h"
33#include "bnctime.h"
34
35class bncAntex;
36
37namespace BNC_PPP {
38
39class t_pppClient;
40class t_pppOptions;
41class t_epoData;
42class t_satData;
43class t_tides;
44
45class t_satData {
46 public:
47 t_satData() {
48 obsIndex = 0;
49 P1 = 0.0;
50 P2 = 0.0;
51 P5 = 0.0;
52 P3 = 0.0;
53 L1 = 0.0;
54 L2 = 0.0;
55 L5 = 0.0;
56 L3 = 0.0;
57 lkA = 0.0;
58 lkB = 0.0;
59 }
60 ~t_satData() {}
61 bncTime tt;
62 QString prn;
63 double P1;
64 double P2;
65 double P5;
66 double P3;
67 double L1;
68 double L2;
69 double L5;
70 double L3;
71 ColumnVector xx;
72 ColumnVector vv;
73 double clk;
74 double eleSat;
75 double azSat;
76 double rho;
77 bool slipFlag;
78 double lambda3;
79 double lkA;
80 double lkB;
81 unsigned obsIndex;
82 char system() const {return prn.toAscii()[0];}
83};
84
85class t_epoData {
86 public:
87 t_epoData() {}
88
89 ~t_epoData() {
90 clear();
91 }
92
93 void clear() {
94 QMapIterator<QString, t_satData*> it(satData);
95 while (it.hasNext()) {
96 it.next();
97 delete it.value();
98 }
99 satData.clear();
100 tt.reset();
101 }
102
103 void deepCopy(const t_epoData* from) {
104 clear();
105 tt = from->tt;
106 QMapIterator<QString, t_satData*> it(from->satData);
107 while (it.hasNext()) {
108 it.next();
109 satData[it.key()] = new t_satData(*it.value());
110 }
111 }
112
113 unsigned sizeSys(char system) const {
114 unsigned ans = 0;
115 QMapIterator<QString, t_satData*> it(satData);
116 while (it.hasNext()) {
117 it.next();
118 if (it.value()->system() == system) {
119 ++ans;
120 }
121 }
122 return ans;
123 }
124 unsigned sizeAll() const {return satData.size();}
125
126 bncTime tt;
127 QMap<QString, t_satData*> satData;
128};
129
130class t_pppParam {
131 public:
132 enum parType {CRD_X, CRD_Y, CRD_Z, RECCLK, TROPO, AMB_L3,
133 GLONASS_OFFSET, GALILEO_OFFSET};
134 t_pppParam(parType typeIn, int indexIn, const QString& prn);
135 ~t_pppParam();
136 double partial(t_satData* satData, bool phase);
137 bool isCrd() const {
138 return (type == CRD_X || type == CRD_Y || type == CRD_Z);
139 }
140 parType type;
141 double xx;
142 int index;
143 int index_old;
144 int numEpo;
145 QString prn;
146};
147
148class t_pppFilter {
149 public:
150 t_pppFilter(t_pppClient* pppClient);
151 ~t_pppFilter();
152 t_irc update(t_epoData* epoData);
153 bncTime time() const {return _time;}
154 const SymmetricMatrix& Q() const {return _QQ;}
155 const ColumnVector& neu() const {return _neu;}
156 int numSat() const {return _numSat;}
157 double PDOP() const {return _pDop;}
158 double x() const {return _params[0]->xx;}
159 double y() const {return _params[1]->xx;}
160 double z() const {return _params[2]->xx;}
161 double clk() const {return _params[3]->xx;}
162 double trp() const {
163 for (int ii = 0; ii < _params.size(); ++ii) {
164 t_pppParam* pp = _params[ii];
165 if (pp->type == t_pppParam::TROPO) {
166 return pp->xx;
167 }
168 }
169 return 0.0;
170 }
171 double trpStdev() const {
172 for (unsigned ii = 0; ii < _params.size(); ++ii) {
173 t_pppParam* pp = _params[ii];
174 if (pp->type() == t_pppParam::TROPO) {
175 return sqrt(Q()[ii][ii]);
176 }
177 }
178 return 0.0;
179 }
180 double Glonass_offset() const {
181 for (int ii = 0; ii < _params.size(); ++ii) {
182 t_pppParam* pp = _params[ii];
183 if (pp->type == t_pppParam::GLONASS_OFFSET) {
184 return pp->xx;
185 }
186 }
187 return 0.0;
188 }
189 double Galileo_offset() const {
190 for (int ii = 0; ii < _params.size(); ++ii) {
191 t_pppParam* pp = _params[ii];
192 if (pp->type == t_pppParam::GALILEO_OFFSET) {
193 return pp->xx;
194 }
195 }
196 return 0.0;
197 }
198
199 private:
200 void reset();
201 t_irc cmpBancroft(t_epoData* epoData);
202 void cmpEle(t_satData* satData);
203 void addAmb(t_satData* satData);
204 void addObs(int iPhase, unsigned& iObs, t_satData* satData,
205 Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP);
206 QByteArray printRes(int iPhase, const ColumnVector& vv,
207 const QMap<QString, t_satData*>& satDataMap);
208 void findMaxRes(const ColumnVector& vv,
209 const QMap<QString, t_satData*>& satData,
210 QString& prnGPS, QString& prnGlo,
211 double& maxResGPS, double& maxResGlo);
212 double cmpValue(t_satData* satData, bool phase);
213 double delay_saast(double Ele);
214 void predict(int iPhase, t_epoData* epoData);
215 t_irc update_p(t_epoData* epoData);
216 QString outlierDetection(int iPhase, const ColumnVector& vv,
217 QMap<QString, t_satData*>& satData);
218
219 double windUp(const QString& prn, const ColumnVector& rSat,
220 const ColumnVector& rRec);
221
222 bncTime _startTime;
223
224 void rememberState(t_epoData* epoData);
225 void restoreState(t_epoData* epoData);
226
227 t_irc selectSatellites(const QString& lastOutlierPrn,
228 QMap<QString, t_satData*>& satData);
229
230 void bancroft(const Matrix& BBpass, ColumnVector& pos);
231
232 void cmpDOP(t_epoData* epoData);
233
234 t_pppClient* _pppClient;
235 bncTime _time;
236 bncTime _lastTimeOK;
237 QVector<t_pppParam*> _params;
238 SymmetricMatrix _QQ;
239 QVector<t_pppParam*> _params_sav;
240 SymmetricMatrix _QQ_sav;
241 t_epoData* _epoData_sav;
242 ColumnVector _xcBanc;
243 ColumnVector _ellBanc;
244 QMap<QString, double> _windUpTime;
245 QMap<QString, double> _windUpSum;
246 QStringList _outlierGPS;
247 QStringList _outlierGlo;
248 bncAntex* _antex;
249 t_tides* _tides;
250 ColumnVector _neu;
251 int _numSat;
252 double _pDop;
253};
254
255}
256
257#endif
Note: See TracBrowser for help on using the repository browser.