Changeset 6137 in ntrip for trunk/BNC/src/rinex
- Timestamp:
- Sep 13, 2014, 12:19:37 PM (10 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/reqcanalyze.cpp
r6122 r6137 237 237 for (unsigned iObs = 0; iObs < _currEpo->rnxSat.size(); iObs++) { 238 238 const t_rnxObsFile::t_rnxSat& rnxSat = _currEpo->rnxSat[iObs]; 239 t_ obs obs;239 t_satObs obs; 240 240 t_rnxObsFile::setObsFromRnx(obsFile, _currEpo, rnxSat, obs); 241 241 242 QString prn = QString("%1%2").arg(obs.satSys) 243 .arg(obs.satNum, 2, 10, QChar('0')); 242 QString prn(obs._prn.toString().c_str()); 244 243 245 t_ephGlo* ephGlo = 0; 246 if (obs.satSys == 'R') { 244 t_ephGlo* ephGlo = 0; 245 int slotNum = 0; 246 if (obs._prn.system() == 'R') { 247 247 for (int ie = 0; ie < _ephs.size(); ie++) { 248 248 if (QString(_ephs[ie]->prn().toString().c_str()) == prn) { … … 252 252 } 253 253 if (ephGlo) { 254 obs.slotNum = ephGlo->slotNum();254 slotNum = ephGlo->slotNum(); 255 255 } 256 256 } 257 257 258 t_irc irc = _allObsMap[prn].addObs(obs );258 t_irc irc = _allObsMap[prn].addObs(obs, slotNum); 259 259 260 260 if (irc == success) { … … 339 339 // 340 340 //////////////////////////////////////////////////////////////////////////// 341 t_irc t_reqcAnalyze::t_allObs::addObs(const t_ obs& obs) {342 343 t_oneObs* newObs = new t_oneObs(obs. GPSWeek, obs.GPSWeeks);341 t_irc t_reqcAnalyze::t_allObs::addObs(const t_satObs& obs, int slotNum) { 342 343 t_oneObs* newObs = new t_oneObs(obs._time.gpsw(), obs._time.gpssec()); 344 344 bool okFlag = false; 345 345 346 346 // Availability and Slip Flags 347 347 // --------------------------- 348 double L1 = obs.measdata("L1", 3.0); 349 if (L1 != 0) { 350 newObs->_hasL1 = true; 351 } 352 double L2 = obs.satSys == 'E' ? obs.measdata("L5", 3.0) : obs.measdata("L2", 3.0);; 353 if (L2 != 0) { 354 newObs->_hasL2 = true; 355 } 356 if (obs.slipL1) { 357 newObs->_slipL1 = true; 358 } 359 if (obs.slipL2) { 360 newObs->_slipL2 = true; 348 double L1 = 0.0; 349 double L2 = 0.0; 350 double P1 = 0.0; 351 double P2 = 0.0; 352 353 for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) { 354 const t_frqObs* frqObs = obs._obs[iFrq]; 355 if (frqObs->_rnxType2ch[0] == '1') { 356 if (frqObs->_phaseValid) { 357 L1 = frqObs->_phase; 358 newObs->_hasL1 = true; 359 newObs->_slipL1 = frqObs->_slip; 360 } 361 if (frqObs->_codeValid) { 362 P1 = frqObs->_code; 363 } 364 if (frqObs->_snrValid) { 365 newObs->_SNR1 = frqObs->_snr; 366 } 367 } 368 else if ( (obs._prn.system() != 'E' && frqObs->_rnxType2ch[0] == '2') || 369 (obs._prn.system() == 'E' && frqObs->_rnxType2ch[0] == '5') ) { 370 if (frqObs->_phaseValid) { 371 L2 = frqObs->_phase; 372 newObs->_hasL2 = true; 373 newObs->_slipL2 = frqObs->_slip; 374 } 375 if (frqObs->_codeValid) { 376 P2 = frqObs->_code; 377 } 378 if (frqObs->_snrValid) { 379 newObs->_SNR2 = frqObs->_snr; 380 } 381 } 361 382 } 362 383 … … 366 387 double f1 = 0.0; 367 388 double f2 = 0.0; 368 if (obs. satSys== 'G') {389 if (obs._prn.system() == 'G') { 369 390 f1 = t_CST::freq(t_frequency::G1, 0); 370 391 f2 = t_CST::freq(t_frequency::G2, 0); 371 392 } 372 else if (obs. satSys== 'R') {373 f1 = t_CST::freq(t_frequency::R1, obs.slotNum);374 f2 = t_CST::freq(t_frequency::R2, obs.slotNum);375 } 376 else if (obs. satSys== 'E') {393 else if (obs._prn.system() == 'R') { 394 f1 = t_CST::freq(t_frequency::R1, slotNum); 395 f2 = t_CST::freq(t_frequency::R2, slotNum); 396 } 397 else if (obs._prn.system() == 'E') { 377 398 f1 = t_CST::freq(t_frequency::E1, 0); 378 399 f2 = t_CST::freq(t_frequency::E5, 0); … … 382 403 L2 = L2 * t_CST::c / f2; 383 404 384 double P1 = obs.measdata("C1", 3.0);385 405 if (P1 != 0.0) { 386 406 newObs->_MP1 = P1 - L1 - 2.0*f2*f2/(f1*f1-f2*f2) * (L1 - L2); 387 407 okFlag = true; 388 408 } 389 double P2 = obs.satSys == 'E' ? obs.measdata("C5", 3.0) : obs.measdata("C2", 3.0);390 409 if (P2 != 0.0) { 391 410 newObs->_MP2 = P2 - L2 - 2.0*f1*f1/(f1*f1-f2*f2) * (L1 - L2); 392 okFlag = true;393 }394 }395 396 // Signal-to-Noise397 // ---------------398 double S1 = obs.measdata("S1", 3.0);399 if (S1 != 0.0) {400 newObs->_SNR1 = floor(S1/6);401 if (newObs->_SNR1 > 9.0) {402 newObs->_SNR1 = 9.0;403 }404 if (newObs->_SNR1 < 1.0) {405 newObs->_SNR1 = 1.0;406 }407 okFlag = true;408 }409 else {410 if (obs.snrL1 > 0) {411 newObs->_SNR1 = obs.snrL1;412 okFlag = true;413 }414 }415 double S2 = obs.satSys == 'E' ? obs.measdata("S5", 3.0) : obs.measdata("S2", 3.0);416 if (S2 != 0.0) {417 newObs->_SNR2 = floor(S2/6);418 if (newObs->_SNR2 > 9.0) {419 newObs->_SNR2 = 9.0;420 }421 if (newObs->_SNR2 < 1.0) {422 newObs->_SNR2 = 1.0;423 }424 okFlag = true;425 }426 else {427 if (obs.snrL2 > 0) {428 newObs->_SNR2 = obs.snrL2;429 411 okFlag = true; 430 412 } -
trunk/BNC/src/rinex/reqcanalyze.h
r5883 r6137 29 29 #include "rnxobsfile.h" 30 30 #include "rnxnavfile.h" 31 #include "GPSDecoder.h"32 31 #include "ephemeris.h" 32 #include "satObs.h" 33 33 34 34 class t_polarPoint; … … 150 150 } 151 151 } 152 t_irc addObs(const t_ obs& obs);152 t_irc addObs(const t_satObs& obs, int slotNum); 153 153 QVector<t_oneObs*> _oneObsVec; 154 154 }; -
trunk/BNC/src/rinex/rnxobsfile.cpp
r6130 r6137 1038 1038 // Set Observations from RINEX File 1039 1039 //////////////////////////////////////////////////////////////////////////// 1040 void t_rnxObsFile::setObsFromRnx(const t_rnxObsFile* rnxObsFile, 1041 const t_rnxObsFile::t_rnxEpo* epo, 1042 const t_rnxObsFile::t_rnxSat& rnxSat, 1043 t_obs& obs) { 1044 1045 strncpy(obs.StatID, rnxObsFile->markerName().toAscii().constData(), sizeof(obs.StatID)); 1046 1047 obs.satSys = rnxSat.prn.system(); 1048 obs.satNum = rnxSat.prn.number(); 1049 obs.GPSWeek = epo->tt.gpsw(); 1050 obs.GPSWeeks = epo->tt.gpssec(); 1051 1052 for (int iType = 0; iType < rnxObsFile->nTypes(obs.satSys); iType++) { 1053 QString type = rnxObsFile->obsType(obs.satSys, iType); 1040 void t_rnxObsFile::setObsFromRnx(const t_rnxObsFile* rnxObsFile, const t_rnxObsFile::t_rnxEpo* epo, 1041 const t_rnxObsFile::t_rnxSat& rnxSat, t_satObs& obs) { 1042 1043 obs._staID = rnxObsFile->markerName().toAscii().constData(); 1044 obs._prn = rnxSat.prn; 1045 obs._time = epo->tt; 1046 1047 char sys = rnxSat.prn.system(); 1048 1049 for (int iType = 0; iType < rnxObsFile->nTypes(sys); iType++) { 1050 QString type = rnxObsFile->obsType(sys, iType); 1054 1051 if (rnxSat.obs.contains(type)) { 1055 1052 const t_rnxObs& rnxObs = rnxSat.obs[type]; 1056 obs.setMeasdata(type, rnxObsFile->version(), rnxObs.value); 1057 if (type.indexOf("L1") == 0) { 1058 obs.snrL1 = rnxObs.snr; 1059 obs.slipL1 = (rnxObs.lli & 1); 1060 } 1061 else if (type.indexOf("L2") == 0) { 1062 obs.snrL2 = rnxObs.snr; 1063 obs.slipL2 = (rnxObs.lli & 1); 1064 } 1065 else if (type.indexOf("L5") == 0) { 1066 obs.snrL5 = rnxObs.snr; 1067 obs.slipL5 = (rnxObs.lli & 1); 1068 } 1069 } 1070 } 1071 } 1072 1053 string type2ch(type.mid(1).toAscii().data()); 1054 1055 1056 t_frqObs* frqObs = 0; 1057 for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) { 1058 if (obs._obs[iFrq]->_rnxType2ch == type2ch) { 1059 frqObs = obs._obs[iFrq]; 1060 break; 1061 } 1062 } 1063 if (frqObs == 0) { 1064 frqObs = new t_frqObs; 1065 frqObs->_rnxType2ch = type2ch; 1066 obs._obs.push_back(frqObs); 1067 } 1068 1069 switch( type.toAscii().data()[0] ) { 1070 case 'C': 1071 frqObs->_codeValid = true; 1072 frqObs->_code = rnxObs.value; 1073 break; 1074 case 'L': 1075 frqObs->_phaseValid = true; 1076 frqObs->_phase = rnxObs.value; 1077 frqObs->_slip = (rnxObs.lli & 1); 1078 break; 1079 case 'D': 1080 frqObs->_dopplerValid = true; 1081 frqObs->_doppler = rnxObs.value; 1082 break; 1083 case 'S': 1084 frqObs->_snrValid = true; 1085 frqObs->_snr = rnxObs.value; 1086 break; 1087 } 1088 } 1089 } 1090 } 1091 -
trunk/BNC/src/rinex/rnxobsfile.h
r6130 r6137 36 36 #include "bnctime.h" 37 37 #include "t_prn.h" 38 #include " GPSDecoder.h"38 #include "satObs.h" 39 39 40 40 class t_rnxObsHeader { … … 163 163 const t_rnxObsFile::t_rnxEpo* epo, 164 164 const t_rnxObsFile::t_rnxSat& rnxSat, 165 t_ obs& obs);165 t_satObs& obs); 166 166 167 167 static QString type2to3(char sys, const QString& typeV2);
Note:
See TracChangeset
for help on using the changeset viewer.