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

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

some additions regarding BDS for future usage

  • Property svn:keywords set to Author Date Id Rev URL;svn:eol-style=native
  • Property svn:mime-type set to text/plain
File size: 6.9 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, BDS_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 trp0() {return delay_saast(M_PI/2.0);}
163 double trp() const {
164 for (int ii = 0; ii < _params.size(); ++ii) {
165 t_pppParam* pp = _params[ii];
166 if (pp->type == t_pppParam::TROPO) {
167 return pp->xx;
168 }
169 }
170 return 0.0;
171 }
172 double trpStdev() const {
173 for (int ii = 0; ii < _params.size(); ++ii) {
174 t_pppParam* pp = _params[ii];
175 if (pp->type == t_pppParam::TROPO) {
176 return sqrt(Q()[ii][ii]);
177 }
178 }
179 return 0.0;
180 }
181 double Glonass_offset() const {
182 for (int ii = 0; ii < _params.size(); ++ii) {
183 t_pppParam* pp = _params[ii];
184 if (pp->type == t_pppParam::GLONASS_OFFSET) {
185 return pp->xx;
186 }
187 }
188 return 0.0;
189 }
190 double Galileo_offset() const {
191 for (int ii = 0; ii < _params.size(); ++ii) {
192 t_pppParam* pp = _params[ii];
193 if (pp->type == t_pppParam::GALILEO_OFFSET) {
194 return pp->xx;
195 }
196 }
197 return 0.0;
198 }
199 double Bds_offset() const {
200 for (int ii = 0; ii < _params.size(); ++ii) {
201 t_pppParam* pp = _params[ii];
202 if (pp->type == t_pppParam::BDS_OFFSET) {
203 return pp->xx;
204 }
205 }
206 return 0.0;
207 }
208 private:
209 void reset();
210 t_irc cmpBancroft(t_epoData* epoData);
211 void cmpEle(t_satData* satData);
212 void addAmb(t_satData* satData);
213 void addObs(int iPhase, unsigned& iObs, t_satData* satData,
214 Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP);
215 QByteArray printRes(int iPhase, const ColumnVector& vv,
216 const QMap<QString, t_satData*>& satDataMap);
217 void findMaxRes(const ColumnVector& vv,
218 const QMap<QString, t_satData*>& satData,
219 QString& prnGPS, QString& prnGlo,
220 double& maxResGPS, double& maxResGlo);
221 double cmpValue(t_satData* satData, bool phase);
222 double delay_saast(double Ele);
223 void predict(int iPhase, t_epoData* epoData);
224 t_irc update_p(t_epoData* epoData);
225 QString outlierDetection(int iPhase, const ColumnVector& vv,
226 QMap<QString, t_satData*>& satData);
227
228 double windUp(const QString& prn, const ColumnVector& rSat,
229 const ColumnVector& rRec);
230
231 bncTime _startTime;
232
233 void rememberState(t_epoData* epoData);
234 void restoreState(t_epoData* epoData);
235
236 t_irc selectSatellites(const QString& lastOutlierPrn,
237 QMap<QString, t_satData*>& satData);
238
239 void bancroft(const Matrix& BBpass, ColumnVector& pos);
240
241 void cmpDOP(t_epoData* epoData);
242
243 t_pppClient* _pppClient;
244 bncTime _time;
245 bncTime _lastTimeOK;
246 QVector<t_pppParam*> _params;
247 SymmetricMatrix _QQ;
248 QVector<t_pppParam*> _params_sav;
249 SymmetricMatrix _QQ_sav;
250 t_epoData* _epoData_sav;
251 ColumnVector _xcBanc;
252 ColumnVector _ellBanc;
253 QMap<QString, double> _windUpTime;
254 QMap<QString, double> _windUpSum;
255 QStringList _outlierGPS;
256 QStringList _outlierGlo;
257 bncAntex* _antex;
258 t_tides* _tides;
259 ColumnVector _neu;
260 int _numSat;
261 double _pDop;
262};
263
264}
265
266#endif
Note: See TracBrowser for help on using the repository browser.