source: ntrip/trunk/BNC/src/PPP_SSR_I/pppFilter.h@ 7235

Last change on this file since 7235 was 7235, checked in by stuerze, 9 years ago

some renaming 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: 7.0 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 P7;
67 double P3;
68 double L1;
69 double L2;
70 double L5;
71 double L7;
72 double L3;
73 ColumnVector xx;
74 ColumnVector vv;
75 double clk;
76 double eleSat;
77 double azSat;
78 double rho;
79 bool slipFlag;
80 double lambda3;
81 double lkA;
82 double lkB;
83 unsigned obsIndex;
84 char system() const {return prn.toAscii()[0];}
85};
86
87class t_epoData {
88 public:
89 t_epoData() {}
90
91 ~t_epoData() {
92 clear();
93 }
94
95 void clear() {
96 QMapIterator<QString, t_satData*> it(satData);
97 while (it.hasNext()) {
98 it.next();
99 delete it.value();
100 }
101 satData.clear();
102 tt.reset();
103 }
104
105 void deepCopy(const t_epoData* from) {
106 clear();
107 tt = from->tt;
108 QMapIterator<QString, t_satData*> it(from->satData);
109 while (it.hasNext()) {
110 it.next();
111 satData[it.key()] = new t_satData(*it.value());
112 }
113 }
114
115 unsigned sizeSys(char system) const {
116 unsigned ans = 0;
117 QMapIterator<QString, t_satData*> it(satData);
118 while (it.hasNext()) {
119 it.next();
120 if (it.value()->system() == system) {
121 ++ans;
122 }
123 }
124 return ans;
125 }
126 unsigned sizeAll() const {return satData.size();}
127
128 bncTime tt;
129 QMap<QString, t_satData*> satData;
130};
131
132class t_pppParam {
133 public:
134 enum parType {CRD_X, CRD_Y, CRD_Z, RECCLK, TROPO, AMB_L3,
135 GLONASS_OFFSET, GALILEO_OFFSET, BDS_OFFSET};
136 t_pppParam(parType typeIn, int indexIn, const QString& prn);
137 ~t_pppParam();
138 double partial(t_satData* satData, bool phase);
139 bool isCrd() const {
140 return (type == CRD_X || type == CRD_Y || type == CRD_Z);
141 }
142 parType type;
143 double xx;
144 int index;
145 int index_old;
146 int numEpo;
147 QString prn;
148};
149
150class t_pppFilter {
151 public:
152 t_pppFilter(t_pppClient* pppClient);
153 ~t_pppFilter();
154 t_irc update(t_epoData* epoData);
155 bncTime time() const {return _time;}
156 const SymmetricMatrix& Q() const {return _QQ;}
157 const ColumnVector& neu() const {return _neu;}
158 int numSat() const {return _numSat;}
159 double PDOP() const {return _pDop;}
160 double x() const {return _params[0]->xx;}
161 double y() const {return _params[1]->xx;}
162 double z() const {return _params[2]->xx;}
163 double clk() const {return _params[3]->xx;}
164 double trp0() {return delay_saast(M_PI/2.0);}
165 double trp() const {
166 for (int ii = 0; ii < _params.size(); ++ii) {
167 t_pppParam* pp = _params[ii];
168 if (pp->type == t_pppParam::TROPO) {
169 return pp->xx;
170 }
171 }
172 return 0.0;
173 }
174 double trpStdev() const {
175 for (int ii = 0; ii < _params.size(); ++ii) {
176 t_pppParam* pp = _params[ii];
177 if (pp->type == t_pppParam::TROPO) {
178 return sqrt(Q()[ii][ii]);
179 }
180 }
181 return 0.0;
182 }
183 double Glonass_offset() const {
184 for (int ii = 0; ii < _params.size(); ++ii) {
185 t_pppParam* pp = _params[ii];
186 if (pp->type == t_pppParam::GLONASS_OFFSET) {
187 return pp->xx;
188 }
189 }
190 return 0.0;
191 }
192 double Galileo_offset() const {
193 for (int ii = 0; ii < _params.size(); ++ii) {
194 t_pppParam* pp = _params[ii];
195 if (pp->type == t_pppParam::GALILEO_OFFSET) {
196 return pp->xx;
197 }
198 }
199 return 0.0;
200 }
201 double Bds_offset() const {
202 for (int ii = 0; ii < _params.size(); ++ii) {
203 t_pppParam* pp = _params[ii];
204 if (pp->type == t_pppParam::BDS_OFFSET) {
205 return pp->xx;
206 }
207 }
208 return 0.0;
209 }
210 private:
211 void reset();
212 t_irc cmpBancroft(t_epoData* epoData);
213 void cmpEle(t_satData* satData);
214 void addAmb(t_satData* satData);
215 void addObs(int iPhase, unsigned& iObs, t_satData* satData,
216 Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP);
217 QByteArray printRes(int iPhase, const ColumnVector& vv,
218 const QMap<QString, t_satData*>& satDataMap);
219 void findMaxRes(const ColumnVector& vv,
220 const QMap<QString, t_satData*>& satData,
221 QString& prnGPS, QString& prnGlo,
222 double& maxResGPS, double& maxResGlo);
223 double cmpValue(t_satData* satData, bool phase);
224 double delay_saast(double Ele);
225 void predict(int iPhase, t_epoData* epoData);
226 t_irc update_p(t_epoData* epoData);
227 QString outlierDetection(int iPhase, const ColumnVector& vv,
228 QMap<QString, t_satData*>& satData);
229
230 double windUp(const QString& prn, const ColumnVector& rSat,
231 const ColumnVector& rRec);
232
233 bncTime _startTime;
234
235 void rememberState(t_epoData* epoData);
236 void restoreState(t_epoData* epoData);
237
238 t_irc selectSatellites(const QString& lastOutlierPrn,
239 QMap<QString, t_satData*>& satData);
240
241 void bancroft(const Matrix& BBpass, ColumnVector& pos);
242
243 void cmpDOP(t_epoData* epoData);
244
245 t_pppClient* _pppClient;
246 bncTime _time;
247 bncTime _lastTimeOK;
248 QVector<t_pppParam*> _params;
249 SymmetricMatrix _QQ;
250 QVector<t_pppParam*> _params_sav;
251 SymmetricMatrix _QQ_sav;
252 t_epoData* _epoData_sav;
253 ColumnVector _xcBanc;
254 ColumnVector _ellBanc;
255 QMap<QString, double> _windUpTime;
256 QMap<QString, double> _windUpSum;
257 QStringList _outlierGPS;
258 QStringList _outlierGlo;
259 bncAntex* _antex;
260 t_tides* _tides;
261 ColumnVector _neu;
262 int _numSat;
263 double _pDop;
264};
265
266}
267
268#endif
Note: See TracBrowser for help on using the repository browser.