Changeset 10373 in ntrip for trunk/BNC/src/PPP/pppClient.cpp
- Timestamp:
- Mar 1, 2024, 4:12:31 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppClient.cpp
r10356 r10373 67 67 } 68 68 } 69 _offGps = 0.0; 69 70 _offGlo = 0.0; 70 71 _offGal = 0.0; … … 255 256 ColumnVector& xyzc, bool print) { 256 257 t_lc::type tLC = t_lc::dummy; 258 char sysBancroft = 'G'; 257 259 int numBancroft = obsVector.size(); 260 261 _usedSystems['G'] = _usedSystems['R'] = _usedSystems['E'] = _usedSystems['C'] = 0; 262 for (unsigned jj = 0; jj < obsVector.size(); jj++) { 263 const t_pppSatObs* satObs = obsVector[jj]; 264 char sys = satObs->prn().system(); 265 _usedSystems[sys]++; 266 } 267 268 if ((numBancroft = _usedSystems.value('G')) >= _opt->_minObs) { 269 sysBancroft = 'G'; 270 } 271 else if ((numBancroft = _usedSystems.value('E')) >= _opt->_minObs) { 272 sysBancroft = 'E'; 273 } 274 else if ((numBancroft = _usedSystems.value('C')) >= _opt->_minObs) { 275 sysBancroft = 'C'; 276 } 277 else if ((numBancroft = _usedSystems.value('R')) >= _opt->_minObs) { 278 sysBancroft = 'R'; 279 } 280 else { 281 LOG << "t_pppClient::cmpBancroft not enough observations: " << endl; 282 return failure; 283 } 258 284 259 285 while (_running) { … … 262 288 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 263 289 const t_pppSatObs* satObs = obsVector.at(ii); 290 if (satObs->prn().system() == sysBancroft) { 264 291 if (tLC == t_lc::dummy) { 265 292 if (satObs->isValid(t_lc::cIF)) { … … 282 309 } 283 310 } 311 } 284 312 if (iObs + 1 < _opt->_minObs) { 285 313 LOG << "t_pppClient::cmpBancroft not enough observations: " << iObs + 1 << endl; … … 300 328 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 301 329 const t_pppSatObs* satObs = obsVector.at(ii); 302 if (satObs->isValid() && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle) ) { 330 char sys = satObs->prn().system(); 331 if (satObs->isValid() && sys == sysBancroft && 332 (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle) ) { 303 333 ColumnVector rr = satObs->xc().Rows(1,3) - xyzc.Rows(1,3); 304 334 double res = rr.NormFrobenius() - satObs->obsValue(tLC) … … 316 346 if (!_epoTimeRover.undef()) LOG << string(_epoTimeRover); 317 347 LOG << "\n---------------------------------------------------------------\n"; 318 LOG << string(epoTime) << " BANCROFT " << ": "348 LOG << string(epoTime) << " BANCROFT " << sysBancroft << ": " 319 349 << setw(14) << setprecision(3) << xyzc[0] << ' ' 320 350 << setw(14) << setprecision(3) << xyzc[1] << ' ' … … 334 364 335 365 return success; 366 } 367 // Compute A Priori Gps Clock Offset 368 ////////////////////////////////////////////////////////////////////////////// 369 double t_pppClient::cmpOffGps(vector<t_pppSatObs*>& obsVector) { 370 371 t_lc::type tLC = t_lc::dummy; 372 double offGps = 0.0; 373 374 if (_opt->useSystem('G')) { 375 while (obsVector.size() > 0) { 376 offGps = 0.0; 377 double maxRes = 0.0; 378 int maxResIndex = -1; 379 unsigned nObs = 0; 380 t_prn maxResPrn; 381 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 382 const t_pppSatObs* satObs = obsVector.at(ii); 383 if (satObs->prn().system() == 'G') { 384 if (tLC == t_lc::dummy) { 385 tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1; 386 } 387 if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) { 388 double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC); 389 ++nObs; 390 offGps += ll; 391 if (fabs(ll) > fabs(maxRes)) { 392 maxRes = ll; 393 maxResIndex = ii; 394 maxResPrn = satObs->prn(); 395 } 396 } 397 } 398 } 399 400 if (nObs > 0) { 401 offGps = offGps / nObs; 402 } 403 else { 404 offGps = 0.0; 405 } 406 407 if (fabs(maxRes) > 100.0) { 408 LOG << "t_pppClient::cmpOffGps outlier " << maxResPrn.toString() << " " << maxRes << endl; 409 delete obsVector.at(maxResIndex); 410 obsVector.erase(obsVector.begin() + maxResIndex); 411 } 412 else { 413 break; 414 } 415 } 416 } 417 return offGps; 336 418 } 337 419 … … 636 718 } 637 719 720 _offGps = cmpOffGps(_obsRover); 638 721 _offGlo = cmpOffGlo(_obsRover); 639 722 _offGal = cmpOffGal(_obsRover);
Note:
See TracChangeset
for help on using the changeset viewer.