Changeset 10583 in ntrip for trunk/BNC/src/PPP/pppClient.cpp
- Timestamp:
- Dec 10, 2024, 2:19:35 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/BNC/src/PPP/pppClient.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppClient.cpp
r10576 r10583 67 67 } 68 68 } 69 _offGps = 0.0;70 _offGlo = 0.0;71 _offGal = 0.0;72 _offBds = 0.0;73 69 CLIENTS.setLocalData(this); // CLIENTS takes ownership over "this" 74 70 } … … 338 334 } 339 335 340 // Compute A Priori Gps Clock Offset341 //////////////////////////////////////////////////////////////////////////////342 double t_pppClient::cmpOffGps(vector<t_pppSatObs*>& obsVector) {343 344 t_lc::type tLC = t_lc::dummy;345 double offGps = 0.0;346 347 if (_opt->useSystem('G')) {348 while (obsVector.size() > 0) {349 offGps = 0.0;350 double maxRes = 0.0;351 int maxResIndex = -1;352 unsigned nObs = 0;353 t_prn maxResPrn;354 for (unsigned ii = 0; ii < obsVector.size(); ii++) {355 const t_pppSatObs* satObs = obsVector.at(ii);356 if (satObs->prn().system() == 'G') {357 if (tLC == t_lc::dummy) {358 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;359 }360 if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {361 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);362 ++nObs;363 offGps += ll;364 if (fabs(ll) > fabs(maxRes)) {365 maxRes = ll;366 maxResIndex = ii;367 maxResPrn = satObs->prn();368 }369 }370 }371 }372 373 if (nObs > 0) {374 offGps = offGps / nObs;375 }376 else {377 offGps = 0.0;378 }379 380 if (fabs(maxRes) > 150.0) {381 LOG << "t_pppClient::cmpOffGps outlier " << maxResPrn.toString() << " " << maxRes << endl;382 delete obsVector.at(maxResIndex);383 obsVector.erase(obsVector.begin() + maxResIndex);384 }385 else {386 break;387 }388 }389 }390 return offGps;391 }392 393 394 // Compute A Priori Glonass Clock Offset395 //////////////////////////////////////////////////////////////////////////////396 double t_pppClient::cmpOffGlo(vector<t_pppSatObs*>& obsVector) {397 398 t_lc::type tLC = t_lc::dummy;399 double offGlo = 0.0;400 401 if (_opt->useSystem('R')) {402 while (obsVector.size() > 0) {403 offGlo = 0.0;404 double maxRes = 0.0;405 int maxResIndex = -1;406 unsigned nObs = 0;407 t_prn maxResPrn;408 for (unsigned ii = 0; ii < obsVector.size(); ii++) {409 const t_pppSatObs* satObs = obsVector.at(ii);410 if (satObs->prn().system() == 'R') {411 if (tLC == t_lc::dummy) {412 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;413 }414 if (satObs->isValid(tLC) &&415 (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {416 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);417 ++nObs;418 offGlo += ll;419 if (fabs(ll) > fabs(maxRes)) {420 maxRes = ll;421 maxResIndex = ii;422 maxResPrn = satObs->prn();423 }424 }425 }426 }427 428 if (nObs > 0) {429 offGlo = offGlo / nObs;430 }431 else {432 offGlo = 0.0;433 }434 if (fabs(maxRes) > 150.0) {435 LOG << "t_pppClient::cmpOffGlo outlier " << maxResPrn.toString() << " " << maxRes << endl;436 delete obsVector.at(maxResIndex);437 obsVector.erase(obsVector.begin() + maxResIndex);438 }439 else {440 break;441 }442 }443 }444 return offGlo;445 }446 447 // Compute A Priori Galileo Clock Offset448 //////////////////////////////////////////////////////////////////////////////449 double t_pppClient::cmpOffGal(vector<t_pppSatObs*>& obsVector) {450 451 t_lc::type tLC = t_lc::dummy;452 double offGal = 0.0;453 454 if (_opt->useSystem('E')) {455 while (obsVector.size() > 0) {456 offGal = 0.0;457 double maxRes = 0.0;458 int maxResIndex = -1;459 unsigned nObs = 0;460 t_prn maxResPrn;461 for (unsigned ii = 0; ii < obsVector.size(); ii++) {462 const t_pppSatObs* satObs = obsVector.at(ii);463 if (satObs->prn().system() == 'E') {464 if (tLC == t_lc::dummy) {465 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;466 }467 if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {468 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);469 ++nObs;470 offGal += ll;471 if (fabs(ll) > fabs(maxRes)) {472 maxRes = ll;473 maxResIndex = ii;474 maxResPrn = satObs->prn();475 }476 }477 }478 }479 480 if (nObs > 0) {481 offGal = offGal / nObs;482 }483 else {484 offGal = 0.0;485 }486 487 if (fabs(maxRes) > 150.0) {488 LOG << "t_pppClient::cmpOffGal outlier " << maxResPrn.toString() << " " << maxRes << endl;489 delete obsVector.at(maxResIndex);490 obsVector.erase(obsVector.begin() + maxResIndex);491 }492 else {493 break;494 }495 }496 }497 return offGal;498 }499 // Compute A Priori BDS Clock Offset500 //////////////////////////////////////////////////////////////////////////////501 double t_pppClient::cmpOffBds(vector<t_pppSatObs*>& obsVector) {502 503 t_lc::type tLC = t_lc::dummy;504 double offBds = 0.0;505 506 if (_opt->useSystem('C')) {507 while (obsVector.size() > 0) {508 offBds = 0.0;509 double maxRes = 0.0;510 int maxResIndex = -1;511 unsigned nObs = 0;512 t_prn maxResPrn;513 for (unsigned ii = 0; ii < obsVector.size(); ii++) {514 const t_pppSatObs* satObs = obsVector.at(ii);515 if (satObs->prn().system() == 'C') {516 if (tLC == t_lc::dummy) {517 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;518 }519 if (satObs->isValid(tLC) &&520 (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {521 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);522 ++nObs;523 offBds += ll;524 if (fabs(ll) > fabs(maxRes)) {525 maxRes = ll;526 maxResIndex = ii;527 maxResPrn = satObs->prn();528 }529 }530 }531 }532 533 if (nObs > 0) {534 offBds = offBds / nObs;535 }536 else {537 offBds = 0.0;538 }539 540 if (fabs(maxRes) > 150.0) {541 LOG << "t_pppClient::cmpOffBDS outlier " << maxResPrn.toString() << " " << maxRes << endl;542 delete obsVector.at(maxResIndex);543 obsVector.erase(obsVector.begin() + maxResIndex);544 }545 else {546 break;547 }548 }549 }550 return offBds;551 }552 553 336 // 554 337 ////////////////////////////////////////////////////////////////////////////// … … 690 473 return finish(failure, 4); 691 474 } 692 693 _offGps = cmpOffGps(_obsRover);694 _offGlo = cmpOffGlo(_obsRover);695 _offGal = cmpOffGal(_obsRover);696 _offBds = cmpOffBds(_obsRover);697 475 698 476 // Prepare Pseudo Observations of the Rover
Note:
See TracChangeset
for help on using the changeset viewer.
