Changeset 9635 in ntrip for trunk/BNC/src/combination
- Timestamp:
- Feb 24, 2022, 5:08:42 PM (3 years ago)
- Location:
- trunk/BNC/src/combination
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/combination/bnccomb.cpp
r9546 r9635 18 18 #include <iomanip> 19 19 #include <sstream> 20 #include <map> 20 21 21 22 #include "bnccomb.h" … … 472 473 } 473 474 474 // Check satellite code biases475 // ----------------------------476 if (!_satCodeBiases.contains(acName)) {477 delete newCorr;478 continue;479 }480 else {481 QMap<t_prn, t_satCodeBias>& storage = _satCodeBiases[acName];482 if (!storage.contains(clkCorr._prn)) {483 delete newCorr;484 continue;485 }486 else {487 newCorr->_satCodeBias = storage[clkCorr._prn];488 }489 }490 491 475 // Check the Ephemeris 492 476 //-------------------- … … 520 504 continue; 521 505 } 506 } 507 508 // Check satellite code biases 509 // ---------------------------- 510 if (!_satCodeBiases.contains(acName)) { 511 delete newCorr; 512 continue; 513 } 514 else { 515 QMap<t_prn, t_satCodeBias>& storage = _satCodeBiases[acName]; 516 if (!storage.contains(clkCorr._prn)) { 517 delete newCorr; 518 continue; 519 } 520 else { 521 t_satCodeBias& satCodeBias = storage[clkCorr._prn]; 522 QMap<t_frequency::type, double> codeBias; 523 for (unsigned ii = 1; ii < t_lcRefSig::cIF; ii++) { 524 t_frequency::type frqType = t_lcRefSig::toFreq(sys, static_cast<t_lcRefSig::type>(ii)); 525 char frqNum = t_frequency::toString(frqType)[1]; 526 char attrib = t_lcRefSig::toAttrib(sys, static_cast<t_lcRefSig::type>(ii)); 527 QString obsType = QString("%1%2").arg(frqNum).arg(attrib); 528 for (unsigned ii = 0; ii < satCodeBias._bias.size(); ii++) { 529 const t_frqCodeBias& bias = satCodeBias._bias[ii]; 530 if (obsType.toStdString() == bias._rnxType2ch) { 531 codeBias[frqType] = bias._value; 532 } 533 } 534 } 535 map<t_frequency::type, double> codeCoeff; 536 double channel = double(newCorr->_eph->slotNum()); 537 t_lcRefSig::coeff(sys, t_lcRefSig::cIF, channel, codeCoeff); 538 map<t_frequency::type, double>::const_iterator it; 539 for (it = codeCoeff.begin(); it != codeCoeff.end(); it++) { 540 t_frequency::type frqType = it->first; 541 newCorr->_codeBiasIF += it->second * codeBias[frqType]; 542 } 543 } 544 cout << acName.toStdString() << " " << clkCorr._prn.toString().c_str() << " _codeBiasIF: " << newCorr->_codeBiasIF << endl; 522 545 } 523 546 … … 597 620 QTextStream out(&_log, QIODevice::WriteOnly); 598 621 599 out << endl<< "Combination: " << sys <<endl600 << "--------------------------------" << endl;622 out << "\n" << "Combination: " << sys << "\n" 623 << "--------------------------------" << "\n"; 601 624 602 625 // Observation Statistics … … 617 640 } 618 641 } 619 out << AC->name.toLatin1().data() << ": " << AC->numObs[sys] << endl;642 out << AC->name.toLatin1().data() << ": " << AC->numObs[sys] << "\n"; 620 643 } 621 644 … … 629 652 ++_masterMissingEpochs[sys]; 630 653 if (_masterMissingEpochs[sys] < switchMasterAfterGap) { 631 out << "Missing Master, Epoch skipped" << endl;654 out << "Missing Master, Epoch skipped" << "\n"; 632 655 _buffer[sys].remove(_resTime); 633 656 emit newMessage(_log, false); … … 644 667 << AC->name.toLatin1().data() << " " 645 668 << _resTime.datestr().c_str() << " " 646 << _resTime.timestr().c_str() << endl;669 << _resTime.timestr().c_str() << "\n"; 647 670 _masterOrbitAC[sys] = AC->name; 648 671 break; … … 682 705 out.setRealNumberPrecision(4); 683 706 out << pp->toString(sys) << " " 684 << pp->xx << " +- " << sqrt(_QQ[sys](pp->index,pp->index)) << endl;707 << pp->xx << " +- " << sqrt(_QQ[sys](pp->index,pp->index)) << "\n"; 685 708 out.setFieldWidth(0); 686 709 } … … 762 785 } 763 786 764 out << " Outlier" << endl;787 out << " Outlier" << "\n"; 765 788 _QQ[sys] = QQ_sav; 766 789 corrs(sys).remove(maxResIndex-1); 767 790 } 768 791 else { 769 out << " OK" << endl;792 out << " OK" << "\n"; 770 793 out.setRealNumberNotation(QTextStream::FixedNotation); 771 794 out.setRealNumberPrecision(4); … … 776 799 << corr->_acName << ' ' << corr->_prn.mid(0,3); 777 800 out.setFieldWidth(10); 778 out << " res = " << vv[ii] << endl;801 out << " res = " << vv[ii] << "\n"; 779 802 out.setFieldWidth(0); 780 803 } … … 807 830 out << "Full Clock " << corr->_prn.mid(0,3) << " " << corr->_iod << " "; 808 831 out.setFieldWidth(14); 809 out << (xc(4) + corr->_dClkResult) * t_CST::c << endl;832 out << (xc(4) + corr->_dClkResult) * t_CST::c << "\n"; 810 833 out.setFieldWidth(0); 811 834 } 812 835 else { 813 out << "bncComb::printResuls bug" << endl;836 out << "bncComb::printResuls bug" << "\n"; 814 837 } 815 838 } … … 958 981 } 959 982 960 ll(iObs) = corr->_clkCorr._dClk * t_CST::c - DotProduct(AA.Row(iObs), x0); 983 ll(iObs) = (corr->_clkCorr._dClk * t_CST::c - corr->_codeBiasIF) - DotProduct(AA.Row(iObs), x0); 961 984 } 962 985 … … 1117 1140 } 1118 1141 catch (Exception& exc) { 1119 out << exc.what() << endl;1142 out << exc.what() << "\n"; 1120 1143 return failure; 1121 1144 } … … 1130 1153 1131 1154 if (maxRes > _MAXRES) { 1132 out << " Outlier" << endl;1155 out << " Outlier" << "\n"; 1133 1156 delete corrs(sys)[maxResIndex-1]; 1134 1157 corrs(sys).remove(maxResIndex-1); 1135 1158 } 1136 1159 else { 1137 out << " OK" << endl;1160 out << " OK" << "\n"; 1138 1161 out.setRealNumberNotation(QTextStream::FixedNotation); 1139 1162 out.setRealNumberPrecision(3); … … 1144 1167 << corr->_acName << ' ' << corr->_prn.mid(0,3); 1145 1168 out.setFieldWidth(6); 1146 out << " res = " << vv[ii] << endl;1169 out << " res = " << vv[ii] << "\n"; 1147 1170 out.setFieldWidth(0); 1148 1171 } … … 1172 1195 1173 1196 if (ephLast == 0) { 1174 out << "checkOrbit: missing eph (not found) " << corr->_prn.mid(0,3) << endl;1197 out << "checkOrbit: missing eph (not found) " << corr->_prn.mid(0,3) << "\n"; 1175 1198 delete corr; 1176 1199 im.remove(); 1177 1200 } 1178 1201 else if (corr->_eph == 0) { 1179 out << "checkOrbit: missing eph (zero) " << corr->_prn.mid(0,3) << endl;1202 out << "checkOrbit: missing eph (zero) " << corr->_prn.mid(0,3) << "\n"; 1180 1203 delete corr; 1181 1204 im.remove(); … … 1186 1209 } 1187 1210 else { 1188 out << "checkOrbit: missing eph (deleted) " << corr->_prn.mid(0,3) << endl;1211 out << "checkOrbit: missing eph (deleted) " << corr->_prn.mid(0,3) << "\n"; 1189 1212 delete corr; 1190 1213 im.remove(); … … 1268 1291 << prn.mid(0,3).toLatin1().data() << " " 1269 1292 << corr->_iod << " " 1270 << norm << endl;1293 << norm << "\n"; 1271 1294 delete corr; 1272 1295 im.remove(); … … 1301 1324 out << "Provider ID changed: AC " << AC->name.toLatin1().data() << " " 1302 1325 << _resTime.datestr().c_str() << " " 1303 << _resTime.timestr().c_str() << endl;1326 << _resTime.timestr().c_str() << "\n"; 1304 1327 break; 1305 1328 } -
trunk/BNC/src/combination/bnccomb.h
r9530 r9635 4 4 5 5 #include <fstream> 6 #include <map> 6 7 #include <newmat.h> 7 8 #include "bncephuser.h" 8 9 #include "satObs.h" 10 #include "bncconst.h" 9 11 #include "../RTCM3/clock_and_orbit/clock_orbit_rtcm.h" 10 12 #include "../RTCM3/clock_and_orbit/clock_orbit_igs.h" … … 80 82 _iod = 0; 81 83 _dClkResult = 0.0; 84 _codeBiasIF = 0.0; 82 85 } 83 86 ~cmbCorr() {} … … 90 93 t_satCodeBias _satCodeBias; 91 94 QString _acName; 95 double _codeBiasIF; 92 96 double _dClkResult; 93 97 ColumnVector _diffRao; … … 106 110 QVector<cmbCorr*> corrs; 107 111 }; 112 113 class t_lcRefSig { 114 public: 115 enum type {dummy = 0, c1, c2, cIF}; 116 117 static t_frequency::type toFreq(char sys, type tt) { 118 switch (tt) { 119 case c1: 120 if (sys == 'G') return t_frequency::G1; 121 else if (sys == 'R') return t_frequency::R1; 122 else if (sys == 'E') return t_frequency::E1; 123 else if (sys == 'C') return t_frequency::C2; 124 else if (sys == 'J') return t_frequency::J1; 125 else if (sys == 'S') return t_frequency::S1; 126 else return t_frequency::dummy; 127 case c2: 128 if (sys == 'G') return t_frequency::G2; 129 else if (sys == 'R') return t_frequency::R2; 130 else if (sys == 'E') return t_frequency::E5; 131 else if (sys == 'C') return t_frequency::C6; 132 else if (sys == 'J') return t_frequency::J2; 133 else if (sys == 'S') return t_frequency::S5; 134 else return t_frequency::dummy; 135 case dummy: 136 case cIF: 137 return t_frequency::dummy; 138 } 139 return t_frequency::dummy; 140 } 141 142 static char toAttrib(char sys, type LC) { 143 switch (LC) { 144 case c1: 145 if (sys == 'G') return 'W'; 146 else if (sys == 'R') return 'P'; 147 else if (sys == 'E') return 'C'; 148 else if (sys == 'C') return 'I'; 149 else if (sys == 'J') return 'C'; 150 else if (sys == 'S') return 'C'; 151 break; 152 case c2: 153 if (sys == 'G') return 'W'; 154 else if (sys == 'R') return 'P'; 155 else if (sys == 'E') return 'Q'; 156 else if (sys == 'C') return 'I'; 157 else if (sys == 'J') return 'L'; 158 else if (sys == 'S') return 'Q'; 159 break; 160 case dummy: 161 case cIF: 162 return '_'; 163 break; 164 } 165 return '_'; 166 } 167 168 static void coeff(char sys, type tLC, double channel, std::map<t_frequency::type, double>& codeCoeff) { 169 codeCoeff.clear(); 170 t_frequency::type fType1 = toFreq(sys, c1); 171 t_frequency::type fType2 = toFreq(sys, c2); 172 double f1 = t_CST::freq(fType1, channel); 173 double f2 = t_CST::freq(fType2, channel); 174 switch (tLC) { 175 case c1: 176 codeCoeff[fType1] = 1.0; 177 return; 178 case c2: 179 codeCoeff[fType2] = 1.0; 180 return; 181 case cIF: 182 codeCoeff[fType1] = f1 * f1 / (f1 * f1 - f2 * f2); 183 codeCoeff[fType2] = -f2 * f2 / (f1 * f1 - f2 * f2); 184 return; 185 case t_lcRefSig::dummy: 186 return; 187 } 188 return; 189 } 190 }; 191 108 192 109 193 void processEpoch(char sys); … … 134 218 e_method _method; 135 219 int _cmbSampl; 220 QString _cmbRefAttributes; 136 221 QMap<QString, QMap<t_prn, t_orbCorr> > _orbCorrections; 137 222 QMap<QString, QMap<t_prn, t_satCodeBias> > _satCodeBiases;
Note:
See TracChangeset
for help on using the changeset viewer.