Changeset 10232 in ntrip for trunk/BNC/src/PPP/pppClient.cpp
- Timestamp:
- Oct 30, 2023, 4:39:46 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/BNC/src/PPP/pppClient.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppClient.cpp
r10222 r10232 297 297 // Check Blunders 298 298 // -------------- 299 const double BLUNDER = 1 50.0;299 const double BLUNDER = 100.0; 300 300 double maxRes = 0.0; 301 301 unsigned maxResIndex = 0; … … 338 338 return success; 339 339 } 340 // Compute A Priori Glonass Receiver Clock Offset 341 ////////////////////////////////////////////////////////////////////////////// 342 double t_pppClient::cmpOffGlo(vector<t_pppSatObs*>& obsVector) { 343 344 t_lc::type tLC = t_lc::dummy; 345 double offGlo = 0.0; 346 const double MAXRES = 1000.0; 347 348 if (OPT->useSystem('R')) { 349 while (obsVector.size() > 0) { 350 offGlo = 0.0; 351 double maxRes = 0.0; 352 int maxResIndex = -1; 353 t_prn maxResPrn; 354 unsigned nObs = 0; 355 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 356 t_pppSatObs* satObs = obsVector.at(ii); 357 if (satObs->prn().system() == 'R') { 358 if (tLC == t_lc::dummy) { 359 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1; 360 } 361 if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle)) { 362 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC); 363 ++nObs; 364 offGlo += ll; 365 if (fabs(ll) > fabs(maxRes)) { 366 maxRes = ll; 367 maxResIndex = ii; 368 maxResPrn = satObs->prn(); 369 } 370 } 371 } 372 } 373 if (nObs > 0) { 374 offGlo = offGlo / nObs; 375 } 376 else { 377 offGlo = 0.0; 378 } 379 if (fabs(maxRes) > MAXRES) { 380 LOG << "t_pppClient::cmpOffGlo Outlier " << maxResPrn.toString() << " " << maxRes << endl; 381 obsVector.erase(obsVector.begin() + maxResIndex); 382 } 383 else { 384 break; 385 } 386 } 387 } 388 389 return offGlo; 390 } 391 392 // Compute A Priori Galileo Receiver Clock Offset 393 ////////////////////////////////////////////////////////////////////////////// 394 double t_pppClient::cmpOffGal(vector<t_pppSatObs*>& obsVector) { 395 396 t_lc::type tLC = t_lc::dummy; 397 double offGal = 0.0; 398 const double MAXRES = 1000.0; 399 400 if (OPT->useSystem('E')) { 401 while (obsVector.size() > 0) { 402 offGal = 0.0; 403 double maxRes = 0.0; 404 int maxResIndex = -1; 405 t_prn maxResPrn; 406 unsigned nObs = 0; 407 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 408 t_pppSatObs* satObs = obsVector.at(ii); 409 if (satObs->prn().system() == 'E') { 410 if (tLC == t_lc::dummy) { 411 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1; 412 } 413 if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle)) { 414 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC); 415 ++nObs; 416 offGal += ll; 417 if (fabs(ll) > fabs(maxRes)) { 418 maxRes = ll; 419 maxResIndex = ii; 420 maxResPrn = satObs->prn(); 421 } 422 } 423 } 424 } 425 if (nObs > 0) { 426 offGal = offGal / nObs; 427 } 428 else { 429 offGal = 0.0; 430 } 431 if (fabs(maxRes) > MAXRES) { 432 LOG << "t_pppClient::cmpOffGal Outlier " << maxResPrn.toString() << " " << maxRes << endl; 433 obsVector.erase(obsVector.begin() + maxResIndex); 434 } 435 else { 436 break; 437 } 438 } 439 } 440 441 return offGal; 442 } 443 444 445 // Compute A Priori BDS Receiver Clock Offset 446 ////////////////////////////////////////////////////////////////////////////// 447 double t_pppClient::cmpOffBds(vector<t_pppSatObs*>& obsVector) { 448 449 t_lc::type tLC = t_lc::dummy; 450 double offBds = 0.0; 451 const double MAXRES = 1000.0; 452 453 if (_opt->useSystem('C')) { 454 while (obsVector.size() > 0) { 455 offBds = 0.0; 456 double maxRes = 0.0; 457 int maxResIndex = -1; 458 t_prn maxResPrn; 459 unsigned nObs = 0; 460 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 461 const t_pppSatObs* satObs = obsVector.at(ii); 462 if (satObs->prn().system() == 'C') { 463 if (tLC == t_lc::dummy) { 464 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1; 465 } 466 if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) { 467 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC); 468 ++nObs; 469 offBds += ll; 470 if (fabs(ll) > fabs(maxRes)) { 471 maxRes = ll; 472 maxResIndex = ii; 473 maxResPrn = satObs->prn(); 474 } 475 } 476 } 477 } 478 if (nObs > 0) { 479 offBds = offBds / nObs; 480 } 481 else { 482 offBds = 0.0; 483 } 484 if (fabs(maxRes) > MAXRES) { 485 LOG << "t_pppClient::cmpOffBds Outlier " << maxResPrn.toString() << " " << maxRes << endl; 486 delete obsVector.at(maxResIndex); 487 obsVector.erase(obsVector.begin() + maxResIndex); 488 } 489 else { 490 break; 491 } 492 } 493 } 494 return offBds; 495 } 340 496 341 // 497 342 ////////////////////////////////////////////////////////////////////////////// … … 633 478 return finish(failure, 4); 634 479 } 635 636 _offGlo = cmpOffGlo(_obsRover);637 _offGal = cmpOffGal(_obsRover);638 _offBds = cmpOffBds(_obsRover);639 480 640 481 // Prepare Pseudo Observations of the Rover
Note:
See TracChangeset
for help on using the changeset viewer.
