- Timestamp:
- Jan 12, 2010, 10:44:39 AM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmodel.cpp
r2213 r2231 200 200 t_irc bncModel::cmpBancroft(t_epoData* epoData) { 201 201 202 if (epoData->size () < MINOBS) {202 if (epoData->sizeGPS() < MINOBS) { 203 203 _log += "\nNot enough data"; 204 204 return failure; 205 205 } 206 206 207 Matrix BB(epoData->size (), 4);208 209 QMapIterator<QString, t_satData*> it(epoData->satData );207 Matrix BB(epoData->sizeGPS(), 4); 208 209 QMapIterator<QString, t_satData*> it(epoData->satDataGPS); 210 210 int iObs = 0; 211 211 while (it.hasNext()) { … … 228 228 // Compute Satellite Elevations 229 229 // ---------------------------- 230 QMutableMapIterator<QString, t_satData*> i t2(epoData->satData);231 while (i t2.hasNext()) {232 i t2.next();233 QString prn = i t2.key();234 t_satData* satData = i t2.value();230 QMutableMapIterator<QString, t_satData*> iGPS(epoData->satDataGPS); 231 while (iGPS.hasNext()) { 232 iGPS.next(); 233 QString prn = iGPS.key(); 234 t_satData* satData = iGPS.value(); 235 235 236 236 ColumnVector rr = satData->xx - _xcBanc.Rows(1,3); … … 248 248 if (satData->eleSat < MINELE) { 249 249 delete satData; 250 it2.remove(); 250 iGPS.remove(); 251 } 252 } 253 254 QMutableMapIterator<QString, t_satData*> iGlo(epoData->satDataGlo); 255 while (iGlo.hasNext()) { 256 iGlo.next(); 257 QString prn = iGlo.key(); 258 t_satData* satData = iGlo.value(); 259 260 ColumnVector rr = satData->xx - _xcBanc.Rows(1,3); 261 double rho = rr.norm_Frobenius(); 262 263 double neu[3]; 264 xyz2neu(_ellBanc.data(), rr.data(), neu); 265 266 satData->eleSat = acos( sqrt(neu[0]*neu[0] + neu[1]*neu[1]) / rho ); 267 if (neu[2] < 0) { 268 satData->eleSat *= -1.0; 269 } 270 satData->azSat = atan2(neu[1], neu[0]); 271 272 if (satData->eleSat < MINELE) { 273 delete satData; 274 iGlo.remove(); 251 275 } 252 276 } … … 335 359 bool removed = false; 336 360 if (par->type == bncParam::AMB_L3) { 337 if (epoData->satData.find(par->prn) == epoData->satData.end()) { 361 if (epoData->satDataGPS.find(par->prn) == epoData->satDataGPS.end() && 362 epoData->satDataGlo.find(par->prn) == epoData->satDataGlo.end() ) { 338 363 removed = true; 339 364 delete par; … … 349 374 // Add new ambiguity parameters 350 375 // ---------------------------- 351 QMapIterator<QString, t_satData*> itObs(epoData->satData); 352 while (itObs.hasNext()) { 353 itObs.next(); 354 QString prn = itObs.key(); 355 bool found = false; 376 QMapIterator<QString, t_satData*> iGPS(epoData->satDataGPS); 377 while (iGPS.hasNext()) { 378 iGPS.next(); 379 QString prn = iGPS.key(); 380 bool found = false; 381 for (int iPar = 1; iPar <= _params.size(); iPar++) { 382 if (_params[iPar-1]->type == bncParam::AMB_L3 && 383 _params[iPar-1]->prn == prn) { 384 found = true; 385 break; 386 } 387 } 388 if (!found) { 389 bncParam* par = new bncParam(bncParam::AMB_L3, _params.size()+1, prn); 390 _params.push_back(par); 391 } 392 } 393 394 QMapIterator<QString, t_satData*> iGlo(epoData->satDataGlo); 395 while (iGlo.hasNext()) { 396 iGlo.next(); 397 QString prn = iGlo.key(); 398 bool found = false; 356 399 for (int iPar = 1; iPar <= _params.size(); iPar++) { 357 400 if (_params[iPar-1]->type == bncParam::AMB_L3 && … … 449 492 } 450 493 451 if (epoData->size () < MINOBS) {494 if (epoData->sizeGPS() < MINOBS) { 452 495 _log += "\nNot enough data"; 453 496 emit newMessage(_log, false); … … 462 505 // -------------------------- 463 506 unsigned nPar = _params.size(); 464 unsigned nObs = _usePhase ? 2 * epoData->size() : epoData->size(); 507 unsigned nObs = 0; 508 if (_usePhase) { 509 nObs = 2 * epoData->sizeGPS() + epoData->sizeGlo(); 510 } 511 else { 512 nObs = epoData->sizeGPS(); // Glonass pseudoranges are not used 513 } 465 514 466 515 Matrix AA(nObs, nPar); // first design matrix … … 469 518 470 519 unsigned iObs = 0; 471 QMapIterator<QString, t_satData*> itObs(epoData->satData); 472 while (itObs.hasNext()) { 520 521 // GPS code and (optionally) phase observations 522 // -------------------------------------------- 523 QMapIterator<QString, t_satData*> itGPS(epoData->satDataGPS); 524 while (itGPS.hasNext()) { 473 525 ++iObs; 474 it Obs.next();475 QString prn = it Obs.key();476 t_satData* satData = it Obs.value();526 itGPS.next(); 527 QString prn = itGPS.key(); 528 t_satData* satData = itGPS.value(); 477 529 478 530 double rhoCmp = cmpValue(satData); … … 504 556 } 505 557 } 506 558 559 // Glonass phase observations 560 // -------------------------- 561 if (_usePhase) { 562 QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo); 563 while (itGlo.hasNext()) { 564 ++iObs; 565 itGlo.next(); 566 QString prn = itGlo.key(); 567 t_satData* satData = itGlo.value(); 568 569 double rhoCmp = cmpValue(satData); 570 571 double ellWgtCoeff = 1.0; 572 //// double eleD = satData->eleSat * 180.0 / M_PI; 573 //// if (eleD < 25.0) { 574 //// ellWgtCoeff = 2.5 - (eleD - 10.0) * 0.1; 575 //// ellWgtCoeff *= ellWgtCoeff; 576 //// } 577 578 ll(iObs) = satData->L3 - rhoCmp; 579 PP(iObs,iObs) = 1.0 / (sig_L3 * sig_L3) / ellWgtCoeff; 580 for (int iPar = 1; iPar <= _params.size(); iPar++) { 581 if (_params[iPar-1]->type == bncParam::AMB_L3 && 582 _params[iPar-1]->prn == prn) { 583 ll(iObs) -= _params[iPar-1]->xx; 584 } 585 AA(iObs, iPar) = _params[iPar-1]->partial(satData, prn); 586 } 587 } 588 } 589 507 590 // Compute Filter Update 508 591 // --------------------- … … 516 599 vv = ll - AA * dx; 517 600 518 } while (outlierDetection(QQsav, vv, epoData->satData) != 0); 601 } while (outlierDetection(QQsav, vv, epoData->satDataGPS, 602 epoData->satDataGlo) != 0); 519 603 520 604 // Set Solution Vector … … 552 636 str2.setf(ios::fixed); 553 637 str2 << _staID.data() << ": PPP " 554 << epoData->tt.timestr(1) << " " << epoData->size () << " "555 << setw(14) << setprecision(3) << x() << " +- "556 << setw(6) << setprecision(3) << sqrt(_QQ(1,1)) << " "557 << setw(14) << setprecision(3) << y() << " +- "558 << setw(6) << setprecision(3) << sqrt(_QQ(2,2)) << " "559 << setw(14) << setprecision(3) << z() << " +- "638 << epoData->tt.timestr(1) << " " << epoData->sizeAll() << " " 639 << setw(14) << setprecision(3) << x() << " +- " 640 << setw(6) << setprecision(3) << sqrt(_QQ(1,1)) << " " 641 << setw(14) << setprecision(3) << y() << " +- " 642 << setw(6) << setprecision(3) << sqrt(_QQ(2,2)) << " " 643 << setw(14) << setprecision(3) << z() << " +- " 560 644 << setw(6) << setprecision(3) << sqrt(_QQ(3,3)); 561 645 if (_estTropo) { 562 str2 << " " << setw(6) << setprecision(3) << trp() << " +- "646 str2 << " " << setw(6) << setprecision(3) << trp() << " +- " 563 647 << setw(6) << setprecision(3) << sqrt(_QQ(5,5)); 564 648 } … … 601 685 << setw(10) << setprecision(7) << setfill('0') 602 686 << fmod(60*lamDeg,60) << ',' << lamCh 603 << ",1," << setw(2) << setfill('0') << epoData->size () << ','687 << ",1," << setw(2) << setfill('0') << epoData->sizeAll() << ',' 604 688 << setw(3) << setprecision(1) << dop << ',' 605 689 << setprecision(3) << ell[2] << ",M,0.0,M,,,"; … … 614 698 int bncModel::outlierDetection(const SymmetricMatrix& QQsav, 615 699 const ColumnVector& vv, 616 QMap<QString, t_satData*>& satData) { 617 618 double vvMaxCode = 0.0; 619 double vvMaxPhase = 0.0; 620 QMutableMapIterator<QString, t_satData*> itMaxCode(satData); 621 QMutableMapIterator<QString, t_satData*> itMaxPhase(satData); 700 QMap<QString, t_satData*>& satDataGPS, 701 QMap<QString, t_satData*>& satDataGlo) { 702 703 double vvMaxCodeGPS = 0.0; 704 double vvMaxPhaseGPS = 0.0; 705 double vvMaxPhaseGlo = 0.0; 706 QMutableMapIterator<QString, t_satData*> itMaxCodeGPS(satDataGPS); 707 QMutableMapIterator<QString, t_satData*> itMaxPhaseGPS(satDataGPS); 708 QMutableMapIterator<QString, t_satData*> itMaxPhaseGlo(satDataGlo); 622 709 623 710 int ii = 0; 624 QMutableMapIterator<QString, t_satData*> it(satData); 625 while (it.hasNext()) { 626 it.next(); 711 712 // GPS code and (optionally) phase residuals 713 // ----------------------------------------- 714 QMutableMapIterator<QString, t_satData*> itGPS(satDataGPS); 715 while (itGPS.hasNext()) { 716 itGPS.next(); 627 717 ++ii; 628 718 629 if (vvMaxCode == 0.0 || fabs(vv(ii)) > vvMaxCode) {630 vvMaxCode = fabs(vv(ii));631 itMaxCode = it;719 if (vvMaxCodeGPS == 0.0 || fabs(vv(ii)) > vvMaxCodeGPS) { 720 vvMaxCodeGPS = fabs(vv(ii)); 721 itMaxCodeGPS = itGPS; 632 722 } 633 723 634 724 if (_usePhase) { 635 725 ++ii; 636 if (vvMaxPhase == 0.0 || fabs(vv(ii)) > vvMaxPhase) { 637 vvMaxPhase = fabs(vv(ii)); 638 itMaxPhase = it; 639 } 640 } 641 } 642 643 if (vvMaxCode > MAXRES_CODE) { 644 QString prn = itMaxCode.key(); 645 t_satData* satData = itMaxCode.value(); 726 if (vvMaxPhaseGPS == 0.0 || fabs(vv(ii)) > vvMaxPhaseGPS) { 727 vvMaxPhaseGPS = fabs(vv(ii)); 728 itMaxPhaseGPS = itGPS; 729 } 730 } 731 } 732 733 // Glonass phase residuals 734 // ----------------------- 735 if (_usePhase) { 736 QMutableMapIterator<QString, t_satData*> itGlo(satDataGlo); 737 while (itGlo.hasNext()) { 738 itGlo.next(); 739 ++ii; 740 if (vvMaxPhaseGlo == 0.0 || fabs(vv(ii)) > vvMaxPhaseGlo) { 741 vvMaxPhaseGlo = fabs(vv(ii)); 742 itMaxPhaseGlo = itGlo; 743 } 744 } 745 } 746 747 if (vvMaxCodeGPS > MAXRES_CODE) { 748 QString prn = itMaxCodeGPS.key(); 749 t_satData* satData = itMaxCodeGPS.value(); 646 750 delete satData; 647 itMaxCode .remove();751 itMaxCodeGPS.remove(); 648 752 _QQ = QQsav; 649 753 650 754 _log += "\nOutlier Code " + prn.toAscii() + " " 651 + QByteArray::number(vvMaxCode , 'f', 3);755 + QByteArray::number(vvMaxCodeGPS, 'f', 3); 652 756 653 757 return 1; 654 758 } 655 else if (vvMaxPhase > MAXRES_PHASE) {656 QString prn = itMaxPhase .key();657 t_satData* satData = itMaxPhase .value();759 else if (vvMaxPhaseGPS > MAXRES_PHASE) { 760 QString prn = itMaxPhaseGPS.key(); 761 t_satData* satData = itMaxPhaseGPS.value(); 658 762 delete satData; 659 itMaxPhase .remove();763 itMaxPhaseGPS.remove(); 660 764 _QQ = QQsav; 661 765 662 766 _log += "\nOutlier Phase " + prn.toAscii() + " " 663 + QByteArray::number(vvMaxPhase , 'f', 3);767 + QByteArray::number(vvMaxPhaseGPS, 'f', 3); 664 768 665 769 return 1; 666 770 } 667 771 else if (vvMaxPhaseGlo > MAXRES_PHASE) { 772 QString prn = itMaxPhaseGlo.key(); 773 t_satData* satData = itMaxPhaseGlo.value(); 774 delete satData; 775 itMaxPhaseGlo.remove(); 776 _QQ = QQsav; 777 778 _log += "\nOutlier Phase " + prn.toAscii() + " " 779 + QByteArray::number(vvMaxPhaseGlo, 'f', 3); 780 781 return 1; 782 } 783 668 784 return 0; 669 785 } -
trunk/BNC/bncmodel.h
r2181 r2231 76 76 int outlierDetection(const SymmetricMatrix& QQsav, 77 77 const ColumnVector& vv, 78 QMap<QString, t_satData*>& satData); 78 QMap<QString, t_satData*>& satDataGPS, 79 QMap<QString, t_satData*>& satDataGlo); 79 80 void writeNMEAstr(const QString& nmStr); 80 81 -
trunk/BNC/bncpppclient.cpp
r2229 r2231 179 179 } 180 180 181 QString prn = 182 QString("%1%2").arg(obs->satSys).arg(obs->satNum, 2, 10, QChar('0')); 183 184 _epoData->satData[prn] = satData; 181 if (obs->satSys == 'G') { 182 QString prn = QString("G%2").arg(obs->satNum, 2, 10, QChar('0')); 183 _epoData->satDataGPS[prn] = satData; 184 } 185 else if (obs->satSys == 'R') { 186 QString prn = QString("R%2").arg(obs->satNum, 2, 10, QChar('0')); 187 _epoData->satDataGlo[prn] = satData; 188 } 185 189 } 186 190 … … 400 404 // Data Pre-Processing 401 405 // ------------------- 402 QMutableMapIterator<QString, t_satData*> i m(_epoData->satData);403 while (i m.hasNext()) {404 i m.next();405 QString prn = i m.key();406 t_satData* satData = i m.value();406 QMutableMapIterator<QString, t_satData*> iGPS(_epoData->satDataGPS); 407 while (iGPS.hasNext()) { 408 iGPS.next(); 409 QString prn = iGPS.key(); 410 t_satData* satData = iGPS.value(); 407 411 408 412 if (cmpToT(prn, satData) != success) { 409 413 delete satData; 410 im.remove(); 414 iGPS.remove(); 415 continue; 416 } 417 } 418 419 QMutableMapIterator<QString, t_satData*> iGlo(_epoData->satDataGlo); 420 while (iGlo.hasNext()) { 421 iGlo.next(); 422 QString prn = iGlo.key(); 423 t_satData* satData = iGlo.value(); 424 425 if (cmpToT(prn, satData) != success) { 426 delete satData; 427 iGlo.remove(); 411 428 continue; 412 429 } -
trunk/BNC/bncpppclient.h
r2226 r2231 61 61 t_epoData() {} 62 62 ~t_epoData() { 63 QMapIterator<QString, t_satData*> it(satData); 64 while (it.hasNext()) { 65 it.next(); 66 delete it.value(); 63 QMapIterator<QString, t_satData*> itGPS(satDataGPS); 64 while (itGPS.hasNext()) { 65 itGPS.next(); 66 delete itGPS.value(); 67 } 68 QMapIterator<QString, t_satData*> itGlo(satDataGlo); 69 while (itGlo.hasNext()) { 70 itGlo.next(); 71 delete itGlo.value(); 67 72 } 68 73 } 69 unsigned size() const {return satData.size();} 74 unsigned sizeGPS() const {return satDataGPS.size();} 75 unsigned sizeGlo() const {return satDataGlo.size();} 76 unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size();} 70 77 bncTime tt; 71 QMap<QString, t_satData*> satData; 78 QMap<QString, t_satData*> satDataGPS; 79 QMap<QString, t_satData*> satDataGlo; 72 80 }; 73 81
Note:
See TracChangeset
for help on using the changeset viewer.