Changeset 6157 in ntrip
- Timestamp:
- Sep 14, 2014, 10:53:36 AM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/combination/bnccomb.cpp
r6156 r6157 357 357 // --------------------- 358 358 cmbCorr* newCorr = new cmbCorr(); 359 newCorr->_prn = clkCorr._prn;359 newCorr->_prn = prn; 360 360 newCorr->_time = clkCorr._time; 361 361 newCorr->_iod = clkCorr._iod; … … 490 490 while (itCorr.hasNext()) { 491 491 cmbCorr* corr = itCorr.next(); 492 if (corr-> acName == AC->name) {492 if (corr->_acName == AC->name) { 493 493 AC->numObs += 1; 494 494 if (AC->name == _masterOrbitAC) { … … 532 532 } 533 533 534 QMap<QString, t_corr*> resCorr;534 QMap<QString, cmbCorr*> resCorr; 535 535 536 536 // Perform the actual Combination using selected Method … … 553 553 if (pp->type == cmbParam::clkSat) { 554 554 if (resCorr.find(pp->prn) != resCorr.end()) { 555 resCorr[pp->prn]-> dClk = pp->xx / t_CST::c;555 resCorr[pp->prn]->_dClk = pp->xx / t_CST::c; 556 556 } 557 557 } … … 578 578 //////////////////////////////////////////////////////////////////////////// 579 579 t_irc bncComb::processEpoch_filter(QTextStream& out, 580 QMap<QString, t_corr*>& resCorr,580 QMap<QString, cmbCorr*>& resCorr, 581 581 ColumnVector& dx) { 582 582 … … 628 628 out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str() 629 629 << " Maximum Residuum " << maxRes << ' ' 630 << corrs()[maxResIndex-1]-> acName << ' ' << corrs()[maxResIndex-1]->prn;630 << corrs()[maxResIndex-1]->_acName << ' ' << corrs()[maxResIndex-1]->_prn; 631 631 632 632 if (maxRes > _MAXRES) { … … 634 634 cmbParam* pp = _params[iPar-1]; 635 635 if (pp->type == cmbParam::offACSat && 636 pp->AC == corrs()[maxResIndex-1]-> acName &&637 pp->prn == corrs()[maxResIndex-1]-> prn) {636 pp->AC == corrs()[maxResIndex-1]->_acName && 637 pp->prn == corrs()[maxResIndex-1]->_prn) { 638 638 QQ_sav.Row(iPar) = 0.0; 639 639 QQ_sav.Column(iPar) = 0.0; … … 658 658 //////////////////////////////////////////////////////////////////////////// 659 659 void bncComb::printResults(QTextStream& out, 660 const QMap<QString, t_corr*>& resCorr) {661 662 QMapIterator<QString, t_corr*> it(resCorr);660 const QMap<QString, cmbCorr*>& resCorr) { 661 662 QMapIterator<QString, cmbCorr*> it(resCorr); 663 663 while (it.hasNext()) { 664 664 it.next(); 665 t_corr* corr = it.value();666 const t_eph* eph = corr-> eph;665 cmbCorr* corr = it.value(); 666 const t_eph* eph = corr->_eph; 667 667 if (eph) { 668 668 ColumnVector xc(4); … … 673 673 << _resTime.timestr().c_str() << " "; 674 674 out.setFieldWidth(3); 675 out << "Full Clock " << corr-> prn << " " << corr->iod << " ";675 out << "Full Clock " << corr->_prn << " " << corr->_iod << " "; 676 676 out.setFieldWidth(14); 677 out << (xc(4) + corr-> dClk) * t_CST::c << endl;677 out << (xc(4) + corr->_dClk) * t_CST::c << endl; 678 678 out.setFieldWidth(0); 679 679 } … … 686 686 // Send results to RTNet Decoder and directly to PPP Client 687 687 //////////////////////////////////////////////////////////////////////////// 688 void bncComb::dumpResults(const QMap<QString, t_corr*>& resCorr) {688 void bncComb::dumpResults(const QMap<QString, cmbCorr*>& resCorr) { 689 689 690 690 QString outLines; … … 699 699 year, month, day, hour, minute, sec); 700 700 701 QMapIterator<QString, t_corr*> it(resCorr);701 QMapIterator<QString, cmbCorr*> it(resCorr); 702 702 while (it.hasNext()) { 703 703 it.next(); 704 t_corr* corr = it.value();704 cmbCorr* corr = it.value(); 705 705 706 706 ColumnVector xc(4); 707 707 ColumnVector vv(3); 708 corr-> eph->getCrd(_resTime, xc, vv, false);708 corr->_eph->getCrd(_resTime, xc, vv, false); 709 709 710 710 // Correction Phase Center --> CoM … … 713 713 if (_antex) { 714 714 double Mjd = _resTime.mjd() + _resTime.daysec()/86400.0; 715 if (_antex->satCoMcorrection(corr-> prn, Mjd, xc.Rows(1,3), dx) != success) {715 if (_antex->satCoMcorrection(corr->_prn, Mjd, xc.Rows(1,3), dx) != success) { 716 716 dx = 0; 717 cout << "antenna not found " << corr-> prn.toAscii().data() << endl;718 } 719 } 720 721 outLines += corr-> prn;717 cout << "antenna not found " << corr->_prn.toAscii().data() << endl; 718 } 719 } 720 721 outLines += corr->_prn; 722 722 QString hlp; 723 723 hlp.sprintf(" APC 3 %15.4f %15.4f %15.4f" … … 740 740 " %10.5f INTERNAL", 741 741 messageType, updateInt, _resTime.gpsw(), _resTime.gpssec(), 742 corr-> prn.toAscii().data(),743 corr-> iod,744 corr-> dClk * t_CST::c,745 corr-> rao[0],746 corr-> rao[1],747 corr-> rao[2],748 corr->dotDClk * t_CST::c,749 corr-> dotRao[0],750 corr-> dotRao[1],751 corr-> dotRao[2],752 corr->dotDotDClk * t_CST::c);742 corr->_prn.toAscii().data(), 743 corr->_iod, 744 corr->_dClk * t_CST::c, 745 corr->_orbCorr->_xr[0], 746 corr->_orbCorr->_xr[1], 747 corr->_orbCorr->_xr[2], 748 0.0, 749 corr->_orbCorr->_dotXr[0], 750 corr->_orbCorr->_dotXr[1], 751 corr->_orbCorr->_dotXr[2], 752 0.0); 753 753 corrLines << line; 754 754 … … 767 767 // Send new Corrections to PPP etc. 768 768 // -------------------------------- 769 emit newCorrections(corrLines);769 //// emit newCorrections(corrLines); 770 770 } 771 771 … … 774 774 t_irc bncComb::createAmat(Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP, 775 775 const ColumnVector& x0, 776 QMap<QString, t_corr*>& resCorr) {776 QMap<QString, cmbCorr*>& resCorr) { 777 777 778 778 unsigned nPar = _params.size(); … … 799 799 while (itCorr.hasNext()) { 800 800 cmbCorr* corr = itCorr.next(); 801 QString prn = corr-> prn;801 QString prn = corr->_prn; 802 802 803 803 ++iObs; 804 804 805 if (corr-> acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {806 resCorr[prn] = new t_corr(*corr);805 if (corr->_acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) { 806 resCorr[prn] = new cmbCorr(*corr); 807 807 } 808 808 809 809 for (int iPar = 1; iPar <= _params.size(); iPar++) { 810 810 cmbParam* pp = _params[iPar-1]; 811 AA(iObs, iPar) = pp->partial(corr-> acName, prn);812 } 813 814 ll(iObs) = corr-> dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);811 AA(iObs, iPar) = pp->partial(corr->_acName, prn); 812 } 813 814 ll(iObs) = corr->_dClk * t_CST::c - DotProduct(AA.Row(iObs), x0); 815 815 } 816 816 … … 864 864 //////////////////////////////////////////////////////////////////////////// 865 865 t_irc bncComb::processEpoch_singleEpoch(QTextStream& out, 866 QMap<QString, t_corr*>& resCorr,866 QMap<QString, cmbCorr*>& resCorr, 867 867 ColumnVector& dx) { 868 868 … … 882 882 while (it.hasNext()) { 883 883 cmbCorr* corr = it.next(); 884 QString prn = corr-> prn;884 QString prn = corr->_prn; 885 885 bool foundMaster = false; 886 886 QVectorIterator<cmbCorr*> itHlp(corrs()); 887 887 while (itHlp.hasNext()) { 888 888 cmbCorr* corrHlp = itHlp.next(); 889 QString prnHlp = corrHlp-> prn;890 QString ACHlp = corrHlp-> acName;889 QString prnHlp = corrHlp->_prn; 890 QString ACHlp = corrHlp->_acName; 891 891 if (ACHlp == _masterOrbitAC && prn == prnHlp) { 892 892 foundMaster = true; … … 907 907 while (itCorr.hasNext()) { 908 908 cmbCorr* corr = itCorr.next(); 909 QString prn = corr-> prn;910 QString AC = corr-> acName;909 QString prn = corr->_prn; 910 QString AC = corr->_acName; 911 911 if (numObsPrn.find(prn) == numObsPrn.end()) { 912 912 numObsPrn[prn] = 1; … … 990 990 out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str() 991 991 << " Maximum Residuum " << maxRes << ' ' 992 << corrs()[maxResIndex-1]-> acName << ' ' << corrs()[maxResIndex-1]->prn;992 << corrs()[maxResIndex-1]->_acName << ' ' << corrs()[maxResIndex-1]->_prn; 993 993 994 994 if (maxRes > _MAXRES) { … … 1005 1005 out << _resTime.datestr().c_str() << ' ' 1006 1006 << _resTime.timestr().c_str() << " " 1007 << corr-> acName << ' ' << corr->prn;1007 << corr->_acName << ' ' << corr->_prn; 1008 1008 out.setFieldWidth(6); 1009 out << " dClk = " << corr-> dClk * t_CST::c << " res = " << vv[ii] << endl;1009 out << " dClk = " << corr->_dClk * t_CST::c << " res = " << vv[ii] << endl; 1010 1010 out.setFieldWidth(0); 1011 1011 } … … 1029 1029 while (im.hasNext()) { 1030 1030 cmbCorr* corr = im.next(); 1031 QString prn = corr-> prn;1031 QString prn = corr->_prn; 1032 1032 if (_eph.find(prn) == _eph.end()) { 1033 out << "checkOrbit: missing eph (not found) " << corr-> prn << endl;1033 out << "checkOrbit: missing eph (not found) " << corr->_prn << endl; 1034 1034 delete corr; 1035 1035 im.remove(); 1036 1036 } 1037 else if (corr-> eph == 0) {1038 out << "checkOrbit: missing eph (zero) " << corr-> prn << endl;1037 else if (corr->_eph == 0) { 1038 out << "checkOrbit: missing eph (zero) " << corr->_prn << endl; 1039 1039 delete corr; 1040 1040 im.remove(); 1041 1041 } 1042 1042 else { 1043 if ( corr-> eph == _eph[prn]->last || corr->eph == _eph[prn]->prev ) {1043 if ( corr->_eph == _eph[prn]->last || corr->_eph == _eph[prn]->prev ) { 1044 1044 switchToLastEph(_eph[prn]->last, corr); 1045 1045 } 1046 1046 else { 1047 out << "checkOrbit: missing eph (deleted) " << corr-> prn << endl;1047 out << "checkOrbit: missing eph (deleted) " << corr->_prn << endl; 1048 1048 delete corr; 1049 1049 im.remove(); … … 1061 1061 while (it.hasNext()) { 1062 1062 cmbCorr* corr = it.next(); 1063 QString prn = corr-> prn;1063 QString prn = corr->_prn; 1064 1064 if (meanRao.find(prn) == meanRao.end()) { 1065 1065 meanRao[prn].ReSize(4); 1066 meanRao[prn].Rows(1,3) = corr-> rao;1066 meanRao[prn].Rows(1,3) = corr->_orbCorr->_xr; 1067 1067 meanRao[prn](4) = 1; 1068 1068 } 1069 1069 else { 1070 meanRao[prn].Rows(1,3) += corr-> rao;1070 meanRao[prn].Rows(1,3) += corr->_orbCorr->_xr; 1071 1071 meanRao[prn](4) += 1; 1072 1072 } … … 1085 1085 while (it.hasNext()) { 1086 1086 cmbCorr* corr = it.next(); 1087 QString prn = corr-> prn;1087 QString prn = corr->_prn; 1088 1088 if (meanRao[prn](4) != 0) { 1089 1089 meanRao[prn] /= meanRao[prn](4); 1090 1090 meanRao[prn](4) = 0; 1091 1091 } 1092 corr-> diffRao = corr->rao- meanRao[prn].Rows(1,3);1092 corr->_diffRao = corr->_orbCorr->_xr - meanRao[prn].Rows(1,3); 1093 1093 if (maxDiff.find(prn) == maxDiff.end()) { 1094 1094 maxDiff[prn] = corr; 1095 1095 } 1096 1096 else { 1097 double normMax = maxDiff[prn]-> diffRao.norm_Frobenius();1098 double norm = corr-> diffRao.norm_Frobenius();1097 double normMax = maxDiff[prn]->_diffRao.norm_Frobenius(); 1098 double norm = corr->_diffRao.norm_Frobenius(); 1099 1099 if (norm > normMax) { 1100 1100 maxDiff[prn] = corr; … … 1113 1113 while (im.hasNext()) { 1114 1114 cmbCorr* corr = im.next(); 1115 QString prn = corr-> prn;1115 QString prn = corr->_prn; 1116 1116 if (numCorr[prn] < 2) { 1117 1117 delete corr; … … 1119 1119 } 1120 1120 else if (corr == maxDiff[prn]) { 1121 double norm = corr-> diffRao.norm_Frobenius();1121 double norm = corr->_diffRao.norm_Frobenius(); 1122 1122 if (norm > MAX_DISPLACEMENT) { 1123 1123 out << _resTime.datestr().c_str() << " " 1124 1124 << _resTime.timestr().c_str() << " " 1125 1125 << "Orbit Outlier: " 1126 << corr-> acName.toAscii().data() << " "1127 << prn.toAscii().data() << " "1128 << corr-> iod << " "1129 << norm << endl;1126 << corr->_acName.toAscii().data() << " " 1127 << prn.toAscii().data() << " " 1128 << corr->_iod << " " 1129 << norm << endl; 1130 1130 delete corr; 1131 1131 im.remove(); … … 1139 1139 } 1140 1140 } 1141 1142 return success;1143 }1144 1145 //1146 ////////////////////////////////////////////////////////////////////////////1147 t_irc bncComb::mergeOrbitCorr(const cmbCorr* orbitCorr, cmbCorr* clkCorr) {1148 1149 clkCorr->iod = orbitCorr->iod; // is it always correct?1150 clkCorr->eph = orbitCorr->eph;1151 clkCorr->tRao = orbitCorr->tRao;1152 clkCorr->rao = orbitCorr->rao;1153 clkCorr->dotRao = orbitCorr->dotRao;1154 1141 1155 1142 return success; … … 1185 1172 while (it.hasNext()) { 1186 1173 cmbCorr* corr = it.next(); 1187 if (acName == corr-> acName) {1174 if (acName == corr->_acName) { 1188 1175 delete corr; 1189 1176 it.remove(); -
trunk/BNC/src/combination/bnccomb.h
r6155 r6157 75 75 delete _clkCorr; 76 76 } 77 t_prn_prn;77 QString _prn; 78 78 bncTime _time; 79 79 int _iod; 80 80 const t_eph* _eph; 81 t_orbCorr* _orbCorr; 82 t_clkCorr* _clkCorr; 83 QString _acName; 81 t_orbCorr* _orbCorr; // used for input 82 t_clkCorr* _clkCorr; // used for input 83 QString _acName; 84 double _dClk; // used for output 84 85 ColumnVector _diffRao; 85 QString ID() {return _acName + "_" + QString(_prn.toString().c_str());}86 QString ID() {return _acName + "_" + _prn;} 86 87 }; 87 88 … … 109 110 void switchToLastEph(const t_eph* lastEph, cmbCorr* corr); 110 111 t_irc checkOrbits(QTextStream& out); 111 t_irc mergeOrbitCorr(const cmbCorr* orbitCorr, cmbCorr* clkCorr);112 QVector<cmbCorr*>& corrs() {return _buffer[_resTime].corrs;} 112 113 113 114 QList<cmbAC*> _ACs; -
trunk/BNC/src/satObs.h
r6141 r6157 59 59 class t_orbCorr { 60 60 public: 61 t_orbCorr(); 61 t_orbCorr() { 62 _xr.ReSize(3); _xr = 0.0; 63 _dotXr.ReSize(3); _dotXr = 0.0; 64 } 62 65 t_orbCorr(const std::string& str); 63 66 t_prn prn() const {return _prn;} … … 69 72 bncTime _time; 70 73 char _system; 71 double _xr[3];72 double _dotXr[3];74 ColumnVector _xr; 75 ColumnVector _dotXr; 73 76 }; 74 77
Note:
See TracChangeset
for help on using the changeset viewer.