Changeset 10373 in ntrip
- Timestamp:
- Mar 1, 2024, 4:12:31 PM (6 months ago)
- Location:
- trunk/BNC/src/PPP
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppClient.cpp
r10356 r10373 67 67 } 68 68 } 69 _offGps = 0.0; 69 70 _offGlo = 0.0; 70 71 _offGal = 0.0; … … 255 256 ColumnVector& xyzc, bool print) { 256 257 t_lc::type tLC = t_lc::dummy; 258 char sysBancroft = 'G'; 257 259 int numBancroft = obsVector.size(); 260 261 _usedSystems['G'] = _usedSystems['R'] = _usedSystems['E'] = _usedSystems['C'] = 0; 262 for (unsigned jj = 0; jj < obsVector.size(); jj++) { 263 const t_pppSatObs* satObs = obsVector[jj]; 264 char sys = satObs->prn().system(); 265 _usedSystems[sys]++; 266 } 267 268 if ((numBancroft = _usedSystems.value('G')) >= _opt->_minObs) { 269 sysBancroft = 'G'; 270 } 271 else if ((numBancroft = _usedSystems.value('E')) >= _opt->_minObs) { 272 sysBancroft = 'E'; 273 } 274 else if ((numBancroft = _usedSystems.value('C')) >= _opt->_minObs) { 275 sysBancroft = 'C'; 276 } 277 else if ((numBancroft = _usedSystems.value('R')) >= _opt->_minObs) { 278 sysBancroft = 'R'; 279 } 280 else { 281 LOG << "t_pppClient::cmpBancroft not enough observations: " << endl; 282 return failure; 283 } 258 284 259 285 while (_running) { … … 262 288 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 263 289 const t_pppSatObs* satObs = obsVector.at(ii); 290 if (satObs->prn().system() == sysBancroft) { 264 291 if (tLC == t_lc::dummy) { 265 292 if (satObs->isValid(t_lc::cIF)) { … … 282 309 } 283 310 } 311 } 284 312 if (iObs + 1 < _opt->_minObs) { 285 313 LOG << "t_pppClient::cmpBancroft not enough observations: " << iObs + 1 << endl; … … 300 328 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 301 329 const t_pppSatObs* satObs = obsVector.at(ii); 302 if (satObs->isValid() && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle) ) { 330 char sys = satObs->prn().system(); 331 if (satObs->isValid() && sys == sysBancroft && 332 (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle) ) { 303 333 ColumnVector rr = satObs->xc().Rows(1,3) - xyzc.Rows(1,3); 304 334 double res = rr.NormFrobenius() - satObs->obsValue(tLC) … … 316 346 if (!_epoTimeRover.undef()) LOG << string(_epoTimeRover); 317 347 LOG << "\n---------------------------------------------------------------\n"; 318 LOG << string(epoTime) << " BANCROFT " << ": "348 LOG << string(epoTime) << " BANCROFT " << sysBancroft << ": " 319 349 << setw(14) << setprecision(3) << xyzc[0] << ' ' 320 350 << setw(14) << setprecision(3) << xyzc[1] << ' ' … … 334 364 335 365 return success; 366 } 367 // Compute A Priori Gps Clock Offset 368 ////////////////////////////////////////////////////////////////////////////// 369 double t_pppClient::cmpOffGps(vector<t_pppSatObs*>& obsVector) { 370 371 t_lc::type tLC = t_lc::dummy; 372 double offGps = 0.0; 373 374 if (_opt->useSystem('G')) { 375 while (obsVector.size() > 0) { 376 offGps = 0.0; 377 double maxRes = 0.0; 378 int maxResIndex = -1; 379 unsigned nObs = 0; 380 t_prn maxResPrn; 381 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 382 const t_pppSatObs* satObs = obsVector.at(ii); 383 if (satObs->prn().system() == 'G') { 384 if (tLC == t_lc::dummy) { 385 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1; 386 } 387 if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) { 388 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC); 389 ++nObs; 390 offGps += ll; 391 if (fabs(ll) > fabs(maxRes)) { 392 maxRes = ll; 393 maxResIndex = ii; 394 maxResPrn = satObs->prn(); 395 } 396 } 397 } 398 } 399 400 if (nObs > 0) { 401 offGps = offGps / nObs; 402 } 403 else { 404 offGps = 0.0; 405 } 406 407 if (fabs(maxRes) > 100.0) { 408 LOG << "t_pppClient::cmpOffGps outlier " << maxResPrn.toString() << " " << maxRes << endl; 409 delete obsVector.at(maxResIndex); 410 obsVector.erase(obsVector.begin() + maxResIndex); 411 } 412 else { 413 break; 414 } 415 } 416 } 417 return offGps; 336 418 } 337 419 … … 636 718 } 637 719 720 _offGps = cmpOffGps(_obsRover); 638 721 _offGlo = cmpOffGlo(_obsRover); 639 722 _offGal = cmpOffGal(_obsRover); -
trunk/BNC/src/PPP/pppClient.h
r10259 r10373 36 36 const bncAntex* antex() const {return _antex;} 37 37 const t_pppStation* staRover() const {return _staRover;} 38 double offGps() const {return _offGps;} 38 39 double offGlo() const {return _offGlo;} 39 40 double offGal() const {return _offGal;} 40 41 double offBds() const {return _offBds;} 42 void resetOffGps() {_offGps = 0.0;} 41 43 void resetOffGlo() {_offGlo = 0.0;} 42 44 void resetOffGal() {_offGal = 0.0;} 43 45 void resetOffBds() {_offBds = 0.0;} 46 44 47 45 48 std::ostringstream& log() {return *_log;} … … 63 66 t_irc cmpBancroft(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector, 64 67 ColumnVector& xyzc, bool print); 68 double cmpOffGps(std::vector<t_pppSatObs*>& obsVector); 65 69 double cmpOffGlo(std::vector<t_pppSatObs*>& obsVector); 66 70 double cmpOffGal(std::vector<t_pppSatObs*>& obsVector); … … 75 79 bncAntex* _antex; 76 80 t_pppFilter* _filter; 81 double _offGps; 77 82 double _offGlo; 78 83 double _offGal; -
trunk/BNC/src/PPP/pppFilter.cpp
r10369 r10373 76 76 string epoTimeStr = string(_epoTime); 77 77 78 const Q List<char> &usedSystems = _parlist->usedSystems();78 const QMap<char, int> &usedSystems = _parlist->usedSystems(); 79 79 80 80 // Set Parameters … … 92 92 // Process Satellite Systems separately 93 93 // ------------------------------------ 94 for ( int iSys = 0; iSys < usedSystems.size(); iSys++) {95 char sys = usedSystems[iSys];96 unsigned intnum = 0;94 for (auto it = usedSystems.begin(); it != usedSystems.end(); ++it) { 95 char sys = it.key(); 96 unsigned num = 0; 97 97 vector<t_pppSatObs*> obsVector; 98 98 for (unsigned jj = 0; jj < allObs.size(); jj++) { … … 185 185 AA[iObs][iPar] = par->partial(_epoTime, obs, tLC); 186 186 } 187 double offGps = 0.0; 188 if (sys == 'G' && tLC != t_lc::MW) { 189 offGps = PPP_CLIENT->offGps(); 190 } 187 191 double offGlo = 0.0; 188 192 if (sys == 'R' && tLC != t_lc::MW) { … … 197 201 offBds = PPP_CLIENT->offBds(); 198 202 } 199 ll[iObs] = obs->obsValue(tLC) - offGlo - offGal - offBds - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs + 1));203 ll[iObs] = obs->obsValue(tLC) -offGps - offGlo - offGal - offBds - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs + 1)); 200 204 PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC)); 201 205 } … … 229 233 AA[iObs][iPar] = par->partial(_epoTime, obs, tLC); 230 234 } 235 double offGps = 0.0; 236 if (sys == 'G' && tLC != t_lc::MW) { 237 offGps = PPP_CLIENT->offGps(); 238 } 231 239 double offGlo = 0.0; 232 240 if (sys == 'R' && tLC != t_lc::MW) { … … 241 249 offBds = PPP_CLIENT->offBds(); 242 250 } 243 ll[iObs] = obs->obsValue(tLC) - offGlo - offGal - offBds - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs + 1));251 ll[iObs] = obs->obsValue(tLC) -offGps - offGlo - offGal - offBds - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs + 1)); 244 252 PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC)); 245 253 } … … 375 383 376 384 // Check Pre-Fit Residuals 377 / *-----------------------385 // ----------------------- 378 386 else { 379 387 ColumnVector AA(params.size()); … … 382 390 AA[iPar] = par->partial(_epoTime, obs, tLC); 383 391 } 392 double offGps = 0.0; 393 if (sys == 'G' && tLC != t_lc::MW) { 394 offGps = PPP_CLIENT->offGps(); 395 } 384 396 double offGlo = 0.0; 385 397 if (sys == 'R' && tLC != t_lc::MW) { … … 394 406 offBds = PPP_CLIENT->offBds(); 395 407 } 396 double ll = obs->obsValue(tLC) - offGlo - offGal - offBds - obs->cmpValue(tLC) - DotProduct(_x0, AA);408 double ll = obs->obsValue(tLC) -offGps - offGlo - offGal - offBds - obs->cmpValue(tLC) - DotProduct(_x0, AA); 397 409 double vv = DotProduct(AA, _xFlt) - ll; 398 410 … … 402 414 resetAmb(obs->prn(), obsVector, tLC); 403 415 } 404 } */416 } 405 417 } 406 418 } -
trunk/BNC/src/PPP/pppParlist.cpp
r10356 r10373 74 74 const t_pppSatObs* obs = obsVector->at(ii); 75 75 if (obs->prn() == _prn) { 76 double offGps = 0.0; 77 if (_prn.system() == 'G' && tLC != t_lc::MW) { 78 offGps = PPP_CLIENT->offGps(); 79 } 76 80 double offGlo = 0.0; 77 81 if (_prn.system() == 'R' && tLC != t_lc::MW) { … … 86 90 offBds = PPP_CLIENT->offBds(); 87 91 } 88 _x0 = floor((obs->obsValue(tLC) - offG lo - offGal - offBds - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);92 _x0 = floor((obs->obsValue(tLC) - offGps - offGlo - offGal - offBds - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5); 89 93 break; 90 94 } 91 95 } 92 96 } 97 break; 98 case offGps: 99 _epoSpec = true; 100 _sigma0 = OPT->_aprSigClkOff; 101 _x0 = PPP_CLIENT->offGps(); 93 102 break; 94 103 case offGlo: … … 171 180 if (tLC == t_lc::GIM) {return 0.0;} 172 181 return 1.0; 182 case offGps: 183 if (tLC == t_lc::GIM) {return 0.0;} 184 return (obs->prn().system() == 'G') ? 1.0 : 0.0; 173 185 case offGlo: 174 186 if (tLC == t_lc::GIM) {return 0.0;} … … 299 311 ss << "REC_CLK "; 300 312 break; 313 case offGps: 314 ss << "OFF_GPS "; 315 break; 301 316 case offGlo: 302 317 ss << "OFF_GLO "; … … 345 360 //////////////////////////////////////////////////////////////////////////// 346 361 t_pppParlist::~t_pppParlist() { 347 _usedSystems.clear();348 362 349 363 for (unsigned ii = 0; ii < _params.size(); ii++) { … … 396 410 // check which systems have observations 397 411 // ------------------------------------- 398 _usedSystems .clear();412 _usedSystems['G'] = _usedSystems['R'] = _usedSystems['E'] = _usedSystems['C'] = 0; 399 413 for (unsigned jj = 0; jj < obsVector.size(); jj++) { 400 414 const t_pppSatObs* satObs = obsVector[jj]; 401 415 char sys = satObs->prn().system(); 402 if (!_usedSystems.contains(sys)) { 403 _usedSystems.append(sys); 404 } 416 _usedSystems[sys]++; 405 417 } 406 418 … … 438 450 par->type() == t_pppParam::cBiasG2 || 439 451 par->type() == t_pppParam::pBiasG1 || 440 par->type() == t_pppParam::pBiasG2) && ! usedSystems().contains('G')) {452 par->type() == t_pppParam::pBiasG2) && !_usedSystems.value('G')) { 441 453 #ifdef BNC_DEBUG_PPP 442 454 //LOG << "remove1 " << par->toString() << std::endl; … … 448 460 par->type() == t_pppParam::cBiasR2 || 449 461 par->type() == t_pppParam::pBiasR1 || 450 par->type() == t_pppParam::pBiasR2) && ! usedSystems().contains('R')){462 par->type() == t_pppParam::pBiasR2) && !_usedSystems.value('R')){ 451 463 #ifdef BNC_DEBUG_PPP 452 464 //LOG << "remove1 " << par->toString() << std::endl; … … 458 470 par->type() == t_pppParam::cBiasE2 || 459 471 par->type() == t_pppParam::pBiasE1 || 460 par->type() == t_pppParam::pBiasE2) && ! usedSystems().contains('E')) {472 par->type() == t_pppParam::pBiasE2) && !_usedSystems.value('E')) { 461 473 #ifdef BNC_DEBUG_PPP 462 474 //LOG << "remove1 " << par->toString() << std::endl; … … 468 480 par->type() == t_pppParam::cBiasC2 || 469 481 par->type() == t_pppParam::pBiasC1 || 470 par->type() == t_pppParam::pBiasC2) && ! usedSystems().contains('C')) {482 par->type() == t_pppParam::pBiasC2) && !_usedSystems.value('C')) { 471 483 #ifdef BNC_DEBUG_PPP 472 484 //LOG << "remove1 " << par->toString() << std::endl; … … 497 509 // GLONASS Clock Offset 498 510 // -------------------- 499 if (OPT->useSystem('R')) { 511 if ( _usedSystems.value('R') && 512 (_usedSystems.value('G') || _usedSystems.value('E') || _usedSystems.value('C'))) { 500 513 required.push_back(new t_pppParam(t_pppParam::offGlo, t_prn(), t_lc::dummy)); 514 } 515 else { 516 PPP_CLIENT->resetOffGlo(); 501 517 } 502 518 503 519 // Galileo Clock Offset 504 520 // -------------------- 505 if ( OPT->useSystem('E')) {521 if (_usedSystems.value('E') && _usedSystems.value('G') && _usedSystems.value('G') >= OPT->_minObs) { 506 522 required.push_back(new t_pppParam(t_pppParam::offGal, t_prn(), t_lc::dummy)); 523 } 524 else { 525 PPP_CLIENT->resetOffGal(); 526 } 527 528 // GPS Clock Offset 529 // -------------------- 530 if (_usedSystems.value('E') && _usedSystems.value('G') && _usedSystems.value('G') < OPT->_minObs) { 531 required.push_back(new t_pppParam(t_pppParam::offGps, t_prn(), t_lc::dummy)); 532 } 533 else { 534 PPP_CLIENT->resetOffGps(); 507 535 } 508 536 509 537 // BDS Clock Offset 510 538 // ---------------- 511 if (OPT->useSystem('C')) { 539 if (_usedSystems.contains('C') && 540 (_usedSystems.contains('G') || _usedSystems.contains('E'))) { 512 541 required.push_back(new t_pppParam(t_pppParam::offBds, t_prn(), t_lc::dummy)); 542 } 543 else { 544 PPP_CLIENT->resetOffBds(); 513 545 } 514 546 -
trunk/BNC/src/PPP/pppParlist.h
r10256 r10373 14 14 class t_pppParam { 15 15 public: 16 enum e_type {crdX, crdY, crdZ, rClk, offG lo, offGal, offBds, trp, ion, amb,16 enum e_type {crdX, crdY, crdZ, rClk, offGps, offGlo, offGal, offBds, trp, ion, amb, 17 17 cBiasG1, cBiasR1, cBiasE1, cBiasC1, pBiasG1, pBiasR1, pBiasE1, pBiasC1, 18 18 cBiasG2, cBiasR2, cBiasE2, cBiasC2, pBiasG2, pBiasR2, pBiasE2, pBiasC2}; … … 104 104 const std::vector<t_pppParam*>& params() const {return _params;} 105 105 std::vector<t_pppParam*>& params() {return _params;} 106 const Q List<char>& usedSystems() const {return _usedSystems;}106 const QMap<char, int>& usedSystems() const {return _usedSystems;} 107 107 void printResult(const bncTime& epoTime, const SymmetricMatrix& QQ, 108 108 const ColumnVector& xx) const; … … 111 111 private: 112 112 std::vector<t_pppParam*> _params; 113 Q List<char>_usedSystems;113 QMap<char, int> _usedSystems; 114 114 }; 115 115 -
trunk/BNC/src/PPP/pppSatObs.cpp
r10336 r10373 660 660 for (unsigned ii = 0; ii < OPT->LCs(sys).size(); ii++) { 661 661 t_lc::type tLC = OPT->LCs(sys)[ii]; 662 double offGps = 0.0; 663 if (_prn.system() == 'G' && tLC != t_lc::MW) { 664 offGps = PPP_CLIENT->offGps(); 665 } 662 666 double offGlo = 0; 663 667 if (sys == 'R' && tLC != t_lc::MW) { … … 675 679 << setw(12) << setprecision(3) << obsValue(tLC) << " " 676 680 << setw(12) << setprecision(3) << cmpValue(tLC) << " " 677 << setw(12) << setprecision(3) << obsValue(tLC) - offG lo - offGal - offBds - cmpValue(tLC) << endl;681 << setw(12) << setprecision(3) << obsValue(tLC) - offGps - offGlo - offGal - offBds - cmpValue(tLC) << endl; 678 682 } 679 683 }
Note:
See TracChangeset
for help on using the changeset viewer.