source: ntrip/trunk/BNC/src/PPP/pppParlist.cpp@ 9439

Last change on this file since 9439 was 9439, checked in by stuerze, 3 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: 21.1 KB
Line 
1/* -------------------------------------------------------------------------
2 * BKG NTRIP Client
3 * -------------------------------------------------------------------------
4 *
5 * Class: t_pppParlist
6 *
7 * Purpose: List of estimated parameters
8 *
9 * Author: L. Mervart
10 *
11 * Created: 29-Jul-2014
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include <cmath>
18#include <iostream>
19#include <sstream>
20#include <iomanip>
21#include <algorithm>
22#include <newmatio.h>
23
24#include "pppParlist.h"
25#include "pppSatObs.h"
26#include "pppStation.h"
27#include "bncutils.h"
28#include "bncconst.h"
29#include "pppClient.h"
30
31using namespace BNC_PPP;
32using namespace std;
33
34// Constructor
35////////////////////////////////////////////////////////////////////////////
36t_pppParam::t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC,
37 const vector<t_pppSatObs*>* obsVector) {
38
39 _type = type;
40 _prn = prn;
41 _tLC = tLC;
42 _x0 = 0.0;
43 _indexOld = -1;
44 _indexNew = -1;
45 _noise = 0.0;
46 _ambInfo = 0;
47
48 switch (_type) {
49 case crdX:
50 _epoSpec = false;
51 _sigma0 = OPT->_aprSigCrd[0];
52 _noise = OPT->_noiseCrd[0];
53 break;
54 case crdY:
55 _epoSpec = false;
56 _sigma0 = OPT->_aprSigCrd[1];
57 _noise = OPT->_noiseCrd[1];
58 break;
59 case crdZ:
60 _epoSpec = false;
61 _sigma0 = OPT->_aprSigCrd[2];
62 _noise = OPT->_noiseCrd[2];
63 break;
64 case clkR:
65 _epoSpec = true;
66 _sigma0 = OPT->_aprSigClk;
67 break;
68 case amb:
69 _epoSpec = false;
70 _sigma0 = OPT->_aprSigAmb;
71 _ambInfo = new t_ambInfo();
72 if (obsVector) {
73 for (unsigned ii = 0; ii < obsVector->size(); ii++) {
74 const t_pppSatObs* obs = obsVector->at(ii);
75 if (obs->prn() == _prn) {
76 double offGR = 0;
77 if (_prn.system() == 'R' && tLC != t_lc::MW) {
78 offGR = PPP_CLIENT->offGR();
79 }
80 double offGE = 0;
81 if (_prn.system() == 'E' && tLC != t_lc::MW) {
82 offGE = PPP_CLIENT->offGE();
83 }
84 double offGC = 0;
85 if (_prn.system() == 'C' && tLC != t_lc::MW) {
86 offGC = PPP_CLIENT->offGC();
87 }
88 _x0 = floor((obs->obsValue(tLC) - offGR -offGE - offGC - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
89 break;
90 }
91 }
92 }
93 break;
94 case offGR:
95 _epoSpec = true;
96 _sigma0 = OPT->_aprSigOGR;
97 _x0 = PPP_CLIENT->offGR();
98 break;
99 case offGE:
100 _epoSpec = true;
101 _sigma0 = OPT->_aprSigOGE;
102 _x0 = PPP_CLIENT->offGE();
103 break;
104 case offGC:
105 _epoSpec = true;
106 _sigma0 = OPT->_aprSigOGC;
107 _x0 = PPP_CLIENT->offGC();
108 break;
109 case trp:
110 _epoSpec = false;
111 _sigma0 = OPT->_aprSigTrp;
112 _noise = OPT->_noiseTrp;
113 break;
114 case ion:
115 _epoSpec = false;
116 _sigma0 = OPT->_aprSigIon;
117 _noise = OPT->_noiseIon;
118 break;
119 case cBiasG1: case cBiasR1: case cBiasE1: case cBiasC1:
120 case cBiasG2: case cBiasR2: case cBiasE2: case cBiasC2:
121 _epoSpec = true;
122 _sigma0 = OPT->_aprSigCodeBias;
123 break;
124 case pBiasG1: case pBiasE1: case pBiasR1: case pBiasC1:
125 case pBiasG2: case pBiasE2: case pBiasR2: case pBiasC2:
126 _epoSpec = true;
127 _sigma0 = OPT->_aprSigPhaseBias;
128 break;
129 }
130}
131
132// Destructor
133////////////////////////////////////////////////////////////////////////////
134t_pppParam::~t_pppParam() {
135 delete _ambInfo;
136}
137
138//
139////////////////////////////////////////////////////////////////////////////
140double t_pppParam::partial(const bncTime& /* epoTime */, const t_pppSatObs* obs,
141 const t_lc::type& tLC, const t_prn refPrn) const {
142
143 // Special Case - Melbourne-Wuebbena
144 // ---------------------------------
145 if (tLC == t_lc::MW && _type != amb) {
146 return 0.0;
147 }
148
149 const t_pppStation* sta = PPP_CLIENT->staRover();
150 ColumnVector rhoV = sta->xyzApr() - obs->xc().Rows(1,3);
151
152 map<t_frequency::type, double> codeCoeff;
153 map<t_frequency::type, double> phaseCoeff;
154 map<t_frequency::type, double> ionoCoeff;
155 obs->lcCoeff(tLC, codeCoeff, phaseCoeff, ionoCoeff);
156
157 switch (_type) {
158 case crdX:
159 if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
160 return (sta->xyzApr()[0] - obs->xc()[0]) / rhoV.NormFrobenius();
161 case crdY:
162 if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
163 return (sta->xyzApr()[1] - obs->xc()[1]) / rhoV.NormFrobenius();
164 case crdZ:
165 if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
166 return (sta->xyzApr()[2] - obs->xc()[2]) / rhoV.NormFrobenius();
167 case clkR:
168 if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
169 return 1.0;
170 case offGR:
171 if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
172 return (obs->prn().system() == 'R') ? 1.0 : 0.0;
173 case offGE:
174 if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
175 return (obs->prn().system() == 'E') ? 1.0 : 0.0;
176 case offGC:
177 if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
178 return (obs->prn().system() == 'C') ? 1.0 : 0.0;
179 case amb:
180 if (tLC == t_lc::GIM || tLC == t_lc::Tz0) {return 0.0;}
181 else if ((OPT->_obsModelType == OPT->IF) ||
182 (OPT->_obsModelType == OPT->PPPRTK) ||
183 (OPT->_obsModelType == OPT->UncombPPP) ||
184 (OPT->_obsModelType == OPT->DCMcodeBias && !obs->isReference()) ||
185 (OPT->_obsModelType == OPT->DCMphaseBias && !obs->isReference()) ) {
186
187 if (obs->prn() == _prn) {
188 if (tLC == _tLC) {
189 return (obs->lambda(tLC));
190 }
191 else if (tLC == t_lc::lIF && _tLC == t_lc::MW) {
192 return obs->lambda(t_lc::lIF) * obs->lambda(t_lc::MW) / obs->lambda(t_lc::l2);
193 }
194 else {
195 if (_tLC == t_lc::l1) {
196 return obs->lambda(t_lc::l1) * phaseCoeff[t_lc::toFreq(obs->prn().system(),t_lc::l1)];
197 }
198 else if (_tLC == t_lc::l2) {
199 return obs->lambda(t_lc::l2) * phaseCoeff[t_lc::toFreq(obs->prn().system(),t_lc::l2)];
200 }
201 }
202 }
203 }
204 break;
205 case trp:
206 if (tLC == t_lc::GIM) {
207 return 0.0;
208 }
209 else if (tLC == t_lc::Tz0) {
210 return 1.0;
211 }
212 else {
213 return 1.0 / sin(obs->eleSat());
214 }
215 case ion:
216 if (obs->prn() == _prn) {
217 if (tLC == t_lc::c1) {
218 return ionoCoeff[t_lc::toFreq(obs->prn().system(),t_lc::c1)];
219 }
220 else if (tLC == t_lc::c2) {
221 return ionoCoeff[t_lc::toFreq(obs->prn().system(),t_lc::c2)];
222 }
223 else if (tLC == t_lc::l1) {
224 return ionoCoeff[t_lc::toFreq(obs->prn().system(),t_lc::l1)];
225 }
226 else if (tLC == t_lc::l2) {
227 return ionoCoeff[t_lc::toFreq(obs->prn().system(),t_lc::l2)];
228 }
229 else if (tLC == t_lc::GIM) {
230 return -1.0;
231 }
232 }
233 if (tLC == t_lc::GIM && _prn == refPrn) {
234 return 1.0;
235 }
236 break;
237 case cBiasG1:
238 if ((obs->prn().system() == 'G') && (tLC == t_lc::c1)) {return 1.0;} else {return 0.0;}
239 break;
240 case cBiasR1:
241 if ((obs->prn().system() == 'R') && (tLC == t_lc::c1)) {return 1.0;} else {return 0.0;}
242 break;
243 case cBiasE1:
244 if ((obs->prn().system() == 'E') && (tLC == t_lc::c1)) {return 1.0;} else {return 0.0;}
245 break;
246 case cBiasC1:
247 if ((obs->prn().system() == 'C') && (tLC == t_lc::c1)) {return 1.0;} else {return 0.0;}
248 break;
249 case cBiasG2:
250 if ((obs->prn().system() == 'G') && (tLC == t_lc::c2)) {return 1.0;} else {return 0.0;}
251 break;
252 case cBiasR2:
253 if ((obs->prn().system() == 'R') && (tLC == t_lc::c2)) {return 1.0;} else {return 0.0;}
254 break;
255 case cBiasE2:
256 if ((obs->prn().system() == 'E') && (tLC == t_lc::c2)) {return 1.0;} else {return 0.0;}
257 break;
258 case cBiasC2:
259 if ((obs->prn().system() == 'C') && (tLC == t_lc::c2)) {return 1.0;} else {return 0.0;}
260 break;
261 case pBiasG1:
262 if ((obs->prn().system() == 'G') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
263 break;
264 case pBiasR1:
265 if ((obs->prn().system() == 'R') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
266 break;
267 case pBiasE1:
268 if ((obs->prn().system() == 'E') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
269 break;
270 case pBiasC1:
271 if ((obs->prn().system() == 'C') && (tLC == t_lc::l1)) {return 1.0;} else {return 0.0;}
272 break;
273 case pBiasG2:
274 if ((obs->prn().system() == 'G') && (tLC == t_lc::l2)) {return 1.0;} else {return 0.0;}
275 break;
276 case pBiasR2:
277 if ((obs->prn().system() == 'R') && (tLC == t_lc::l2)) {return 1.0;} else {return 0.0;}
278 break;
279 case pBiasE2:
280 if ((obs->prn().system() == 'E') && (tLC == t_lc::l2)) {return 1.0;} else {return 0.0;}
281 break;
282 case pBiasC2:
283 if ((obs->prn().system() == 'C') && (tLC == t_lc::l2)) {return 1.0;} else {return 0.0;}
284 break;
285
286 }
287 return 0.0;
288}
289
290//
291////////////////////////////////////////////////////////////////////////////
292string t_pppParam::toString() const {
293 stringstream ss;
294 switch (_type) {
295 case crdX:
296 ss << "CRD_X";
297 break;
298 case crdY:
299 ss << "CRD_Y";
300 break;
301 case crdZ:
302 ss << "CRD_Z";
303 break;
304 case clkR:
305 ss << "REC_CLK ";
306 break;
307 case offGR:
308 ss << "OGR ";
309 break;
310 case offGE:
311 ss << "OGE ";
312 break;
313 case offGC:
314 ss << "OGC ";
315 break;
316 case trp:
317 ss << "TRP ";
318 break;
319 case amb:
320 ss << "AMB " << left << setw(3) << t_lc::toString(_tLC) << right << ' ' << _prn.toString();
321 break;
322 case ion:
323 ss << "ION " << left << setw(3) << t_lc::toString(_tLC) << right << ' ' << _prn.toString();
324 break;
325 case cBiasG1: case pBiasG1:
326 case cBiasG2: case pBiasG2:
327 ss << "BIA " << left << setw(3) << t_lc::toString(_tLC) << right << " G ";
328 break;
329 case cBiasR1: case pBiasR1:
330 case cBiasR2: case pBiasR2:
331 ss << "BIA " << left << setw(3) << t_lc::toString(_tLC) << right << " R ";
332 break;
333 case cBiasE1: case pBiasE1:
334 case cBiasE2: case pBiasE2:
335 ss << "BIA " << left << setw(3) << t_lc::toString(_tLC) << right << " E ";
336 break;
337 case cBiasC1: case pBiasC1:
338 case cBiasC2: case pBiasC2:
339 ss << "BIA " << left << setw(3) << t_lc::toString(_tLC) << right << " C ";
340 break;
341 }
342 return ss.str();
343}
344
345// Constructor
346////////////////////////////////////////////////////////////////////////////
347t_pppParlist::t_pppParlist() {
348}
349
350// Destructor
351////////////////////////////////////////////////////////////////////////////
352t_pppParlist::~t_pppParlist() {
353 for (unsigned ii = 0; ii < _params.size(); ii++) {
354 delete _params[ii];
355 }
356}
357
358//
359////////////////////////////////////////////////////////////////////////////
360t_irc t_pppParlist::set(const bncTime& epoTime, const std::vector<t_pppSatObs*>& obsVector,
361 const QMap<char, t_pppRefSat*>& refSatMap) {
362
363 // Remove some Parameters
364 // ----------------------
365 vector<t_pppParam*>::iterator it = _params.begin();
366 while (it != _params.end()) {
367 t_pppParam* par = *it;
368
369 bool remove = false;
370
371 if (par->epoSpec()) {
372 remove = true;
373 }
374
375 else if (par->type() == t_pppParam::crdX ||
376 par->type() == t_pppParam::crdY ||
377 par->type() == t_pppParam::crdZ) {
378 if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 60.0)) {
379 remove = true;
380 }
381 }
382
383 else if (par->type() == t_pppParam::amb) {
384 if (OPT->_obsModelType == OPT->DCMcodeBias || OPT->_obsModelType == OPT->DCMphaseBias) {
385 t_prn refPrn = (refSatMap[par->prn().system()])->prn();
386 if (par->lastObsTime().valid() &&
387 ((epoTime - par->lastObsTime() > 1.0) || (par->prn() == refPrn))) {
388 remove = true;
389 }
390 }
391 else {
392 if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 60.0)) {
393 remove = true;
394 }
395 }
396 }
397
398 if (remove) {
399 delete par;
400 it = _params.erase(it);
401 }
402 else {
403 ++it;
404 }
405 }
406
407 // Check whether parameters have observations
408 // ------------------------------------------
409 for (unsigned ii = 0; ii < _params.size(); ii++) {
410 t_pppParam* par = _params[ii];
411 if (par->prn() == 0) {
412 par->setLastObsTime(epoTime);
413 if (par->firstObsTime().undef()) {
414 par->setFirstObsTime(epoTime);
415 }
416 }
417 else {
418 for (unsigned jj = 0; jj < obsVector.size(); jj++) {
419 const t_pppSatObs* satObs = obsVector[jj];
420 if (satObs->prn() == par->prn()) {
421 par->setLastObsTime(epoTime);
422 if (par->firstObsTime().undef()) {
423 par->setFirstObsTime(epoTime);
424 }
425 break;
426 }
427 }
428 }
429 }
430
431 // Check if ambiguity parameters have observations
432 // -----------------------------------------------
433 if (OPT->_obsModelType == OPT->DCMcodeBias ||
434 OPT->_obsModelType == OPT->DCMphaseBias) {
435 vector<t_pppParam*>::iterator it = _params.begin();
436 while (it != _params.end()) {
437 t_pppParam* par = *it;
438 bool remove = false;
439 if (par->type() == t_pppParam::amb && !par->lastObsTime().valid()) {
440 remove = true;
441 }
442 if (remove) {
443 delete par;
444 it = _params.erase(it);
445 }
446 else {
447 ++it;
448 }
449 }
450 }
451
452 // check which systems have observations
453 // -------------------------------------
454 _usedSystems.clear();
455 for (unsigned jj = 0; jj < obsVector.size(); jj++) {
456 const t_pppSatObs* satObs = obsVector[jj];
457 char sys = satObs->prn().system();
458 if (!_usedSystems.contains(sys)) {
459 _usedSystems.append(sys);
460 }
461 }
462
463 if (_usedSystems.size() > 1 &&
464 !_usedSystems.contains('G')) { // required to setup ISB w. r. t. GPS
465 return failure;
466 }
467
468 // Required Set of Parameters
469 // --------------------------
470 vector<t_pppParam*> required;
471
472 // Coordinates
473 // -----------
474 required.push_back(new t_pppParam(t_pppParam::crdX, t_prn(), t_lc::dummy));
475 required.push_back(new t_pppParam(t_pppParam::crdY, t_prn(), t_lc::dummy));
476 required.push_back(new t_pppParam(t_pppParam::crdZ, t_prn(), t_lc::dummy));
477
478 // Receiver Code Biases
479 // --------------------
480 if (OPT->_obsModelType == OPT->DCMcodeBias) {
481 if (_usedSystems.contains('G')) {
482 required.push_back(new t_pppParam(t_pppParam::cBiasG1, t_prn(), t_lc::c1));
483 required.push_back(new t_pppParam(t_pppParam::cBiasG2, t_prn(), t_lc::c2));
484 }
485 if (_usedSystems.contains('R')) {
486 required.push_back(new t_pppParam(t_pppParam::cBiasR1, t_prn(), t_lc::c1));
487 required.push_back(new t_pppParam(t_pppParam::cBiasR2, t_prn(), t_lc::c2));
488 }
489 if (_usedSystems.contains('E')) {
490 required.push_back(new t_pppParam(t_pppParam::cBiasE1, t_prn(), t_lc::c1));
491 required.push_back(new t_pppParam(t_pppParam::cBiasE2, t_prn(), t_lc::c2));
492 }
493 if (_usedSystems.contains('C')) {
494 required.push_back(new t_pppParam(t_pppParam::cBiasC1, t_prn(), t_lc::c1));
495 required.push_back(new t_pppParam(t_pppParam::cBiasC2, t_prn(), t_lc::c2));
496 }
497 }
498
499 // Receiver Phase Biases
500 // ---------------------
501 if ((OPT->_obsModelType == OPT->DCMphaseBias) ||
502 (OPT->_obsModelType == OPT->PPPRTK) ) {
503 if (_usedSystems.contains('G')) {
504 required.push_back(new t_pppParam(t_pppParam::pBiasG1, t_prn(), t_lc::l1));
505 required.push_back(new t_pppParam(t_pppParam::pBiasG2, t_prn(), t_lc::l2));
506 }
507 if (_usedSystems.contains('R')) {
508 required.push_back(new t_pppParam(t_pppParam::pBiasR1, t_prn(), t_lc::l1));
509 required.push_back(new t_pppParam(t_pppParam::pBiasR2, t_prn(), t_lc::l2));
510 }
511 if (_usedSystems.contains('E')) {
512 required.push_back(new t_pppParam(t_pppParam::pBiasE1, t_prn(), t_lc::l1));
513 required.push_back(new t_pppParam(t_pppParam::pBiasE2, t_prn(), t_lc::l2));
514 }
515 if (_usedSystems.contains('C')) {
516 required.push_back(new t_pppParam(t_pppParam::pBiasC1, t_prn(), t_lc::l1));
517 required.push_back(new t_pppParam(t_pppParam::pBiasC2, t_prn(), t_lc::l2));
518 }
519 }
520
521 // Receiver Clock
522 // --------------
523 required.push_back(new t_pppParam(t_pppParam::clkR, t_prn(), t_lc::dummy));
524
525 // GPS-GLONASS Clock Offset
526 // ------------------------
527 if (_usedSystems.contains('G') && _usedSystems.contains('R')) {
528 required.push_back(new t_pppParam(t_pppParam::offGR, t_prn(), t_lc::dummy));
529 }
530
531 //GPS-Galileo Clock Offset
532 // ------------------------
533 if (_usedSystems.contains('G') && _usedSystems.contains('E')) {
534 required.push_back(new t_pppParam(t_pppParam::offGE, t_prn(), t_lc::dummy));
535 }
536
537 // GPS-BDS Clock Offset
538 // ------------------------
539 if (_usedSystems.contains('G') && _usedSystems.contains('C')) {
540 required.push_back(new t_pppParam(t_pppParam::offGC, t_prn(), t_lc::dummy));
541 }
542
543 // Troposphere
544 // -----------
545 if (OPT->estTrp()) {
546 required.push_back(new t_pppParam(t_pppParam::trp, t_prn(), t_lc::dummy));
547 }
548
549 // Ionosphere
550 // ----------
551 if (OPT->_obsModelType == OPT->UncombPPP ||
552 OPT->_obsModelType == OPT->DCMcodeBias ||
553 OPT->_obsModelType == OPT->DCMphaseBias ) {
554 for (unsigned jj = 0; jj < obsVector.size(); jj++) {
555 const t_pppSatObs* satObs = obsVector[jj];
556 required.push_back(new t_pppParam(t_pppParam::ion, satObs->prn(), t_lc::dummy));
557 }
558 }
559 // Ambiguities
560 // -----------
561 for (unsigned jj = 0; jj < obsVector.size(); jj++) {
562 const t_pppSatObs* satObs = obsVector[jj];
563 if ((OPT->_obsModelType == OPT->IF) ||
564 (OPT->_obsModelType == OPT->PPPRTK) ||
565 (OPT->_obsModelType == OPT->UncombPPP) ||
566 (OPT->_obsModelType == OPT->DCMcodeBias && !satObs->isReference()) ||
567 (OPT->_obsModelType == OPT->DCMphaseBias && !satObs->isReference()) ) {
568 const vector<t_lc::type>& ambLCs = OPT->ambLCs(satObs->prn().system());
569 for (unsigned ii = 0; ii < ambLCs.size(); ii++) {
570 required.push_back(new t_pppParam(t_pppParam::amb, satObs->prn(), ambLCs[ii], &obsVector));
571 }
572 }
573 }
574
575 // Check if all required parameters are present
576 // --------------------------------------------
577 for (unsigned ii = 0; ii < required.size(); ii++) {
578 t_pppParam* parReq = required[ii];
579
580 bool found = false;
581 for (unsigned jj = 0; jj < _params.size(); jj++) {
582 t_pppParam* parOld = _params[jj];
583 if (parOld->isEqual(parReq)) {
584 found = true;
585 break;
586 }
587 }
588 if (found) {
589 delete parReq;
590 }
591 else {
592 _params.push_back(parReq);
593 }
594 }
595
596 // Set Parameter Indices
597 // ---------------------
598 sort(_params.begin(), _params.end(), t_pppParam::sortFunction);
599
600 for (unsigned ii = 0; ii < _params.size(); ii++) {
601 t_pppParam* par = _params[ii];
602 par->setIndex(ii);
603 for (unsigned jj = 0; jj < obsVector.size(); jj++) {
604 const t_pppSatObs* satObs = obsVector[jj];
605 if (satObs->prn() == par->prn()) {
606 par->setAmbEleSat(satObs->eleSat());
607 par->stepAmbNumEpo();
608 }
609 }
610 }
611
612 return success;
613}
614
615//
616////////////////////////////////////////////////////////////////////////////
617void t_pppParlist::printResult(const bncTime& epoTime, const SymmetricMatrix& QQ,
618 const ColumnVector& xx) const {
619
620 string epoTimeStr = string(epoTime);
621 const t_pppStation* sta = PPP_CLIENT->staRover();
622
623 LOG << endl;
624
625 t_pppParam* parX = 0;
626 t_pppParam* parY = 0;
627 t_pppParam* parZ = 0;
628 for (unsigned ii = 0; ii < _params.size(); ii++) {
629 t_pppParam* par = _params[ii];
630 if (par->type() == t_pppParam::crdX) {
631 parX = par;
632 }
633 else if (par->type() == t_pppParam::crdY) {
634 parY = par;
635 }
636 else if (par->type() == t_pppParam::crdZ) {
637 parZ = par;
638 }
639 else {
640 int ind = par->indexNew();
641 double apr = (par->type() == t_pppParam::trp) ?
642 t_tropo::delay_saast(sta->xyzApr(), M_PI/2.0) : par->x0();
643 LOG << epoTimeStr << ' ' << par->toString() << ' '
644 << setw(10) << setprecision(4) << apr << ' '
645 << showpos << setw(10) << setprecision(4) << xx[ind] << noshowpos << " +- "
646 << setw(8) << setprecision(4) << sqrt(QQ[ind][ind]);
647 if (par->type() == t_pppParam::amb) {
648 LOG << " el = " << setw(6) << setprecision(2) << par->ambEleSat() * 180.0 / M_PI
649 << " epo = " << setw(4) << par->ambNumEpo();
650 }
651 LOG << endl;
652 }
653 }
654
655 if (parX && parY && parZ) {
656
657 ColumnVector xyz(3);
658 xyz[0] = xx[parX->indexNew()];
659 xyz[1] = xx[parY->indexNew()];
660 xyz[2] = xx[parZ->indexNew()];
661
662 ColumnVector neu(3);
663 xyz2neu(sta->ellApr().data(), xyz.data(), neu.data());
664
665 SymmetricMatrix QQxyz = QQ.SymSubMatrix(1,3);
666
667 SymmetricMatrix QQneu(3);
668 covariXYZ_NEU(QQxyz, sta->ellApr().data(), QQneu);
669
670 LOG << epoTimeStr << ' ' << sta->name()
671 << " X = " << setprecision(4) << sta->xyzApr()[0] + xyz[0] << " +- "
672 << setprecision(4) << sqrt(QQxyz[0][0])
673
674 << " Y = " << setprecision(4) << sta->xyzApr()[1] + xyz[1] << " +- "
675 << setprecision(4) << sqrt(QQxyz[1][1])
676
677 << " Z = " << setprecision(4) << sta->xyzApr()[2] + xyz[2] << " +- "
678 << setprecision(4) << sqrt(QQxyz[2][2])
679
680 << " dN = " << setprecision(4) << neu[0] << " +- "
681 << setprecision(4) << sqrt(QQneu[0][0])
682
683 << " dE = " << setprecision(4) << neu[1] << " +- "
684 << setprecision(4) << sqrt(QQneu[1][1])
685
686 << " dU = " << setprecision(4) << neu[2] << " +- "
687 << setprecision(4) << sqrt(QQneu[2][2])
688
689 << endl;
690 }
691}
692
Note: See TracBrowser for help on using the repository browser.