Changeset 5750 in ntrip
- Timestamp:
- Aug 3, 2014, 11:30:39 AM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/options.h
r5748 r5750 14 14 ~t_options(); 15 15 bool dualFreqRequired(); 16 bool biasRequired(); 16 17 bool useGlonass(); 17 18 bool xyzAprRoverSet(); … … 47 48 double _maxResC1; 48 49 double _maxResL1; 50 bool _eleWgtCode; 51 bool _eleWgtPhase; 49 52 }; 50 53 -
trunk/BNC/src/PPP/ppp.h
r5749 r5750 31 31 class t_obs { 32 32 public: 33 t_obs() { 34 _code = 0.0; 35 _codeValid = false; 36 _phase = 0.0; 37 _phaseValid = false; 38 _doppler = 0.0; 39 _dopplerValid = false; 40 _snr = 0.0; 41 _snrValid = false; 42 _slip = false; 43 _slipCounter = 0; 44 _biasJumpCounter = 0; 45 } 33 46 std::string _rnxType2ch; 34 47 double _code; -
trunk/BNC/src/PPP/satobs.cpp
r5743 r5750 44 44 #include <newmatio.h> 45 45 #include "satobs.h" 46 #include " genconst.h"46 #include "bncconst.h" 47 47 #include "ephpool.h" 48 48 #include "station.h" 49 #include "utils.h" 50 #include "tropo.h" 51 #include "antex.h" 49 #include "bncutils.h" 50 #include "bncantex.h" 52 51 #include "obspool.h" 52 #include "pppClient.h" 53 #include "bncmodel.h" 53 54 54 55 using namespace BNC; … … 57 58 // Constructor 58 59 //////////////////////////////////////////////////////////////////////////// 59 t_satObs::t_obs::t_obs(const t_obs& obs) { 60 _type = obs._rnxType2ch; 61 _code = obs._code; 62 _codeValid = obs._codeValid; 63 _phase = obs._phase; 64 _phaseValid = obs._phaseValid; 65 _doppler = obs._doppler; 66 _dopplerValid = obs._dopplerValid; 67 _snr = obs._snr; 68 _snrValid = obs._snrValid; 69 _slip = obs._slip; 70 _slipCounter = obs._slipCounter; 71 _biasJumpCounter = -1; 72 } 73 74 // Constructor 75 //////////////////////////////////////////////////////////////////////////// 76 t_satObs::t_satObs(const t_satObs& satObs) { 77 _prn = satObs._prn; 78 _time = satObs._time; 60 t_satObs::t_satObs(const t_pppSatObs& pppSatObs) { 61 _prn = pppSatObs._prn; 62 _time = pppSatObs._time; 79 63 _outlier = false; 80 for ( int ii = 0; ii < satObs._numObs; ii++) {81 const t_obs& obs = satObs._obs[ii];64 for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) { 65 const t_obs& obs = pppSatObs._obs[ii]; 82 66 t_obsType obsType = string(obs._rnxType2ch).substr(0,2); 83 67 _allObs[obsType] = new t_obs(obs); … … 145 129 // Copy raw observations 146 130 // --------------------- 147 _f1 = t_ genConst::f1(_prn.system(), _channel);131 _f1 = t_CST::f1(_prn.system(), _channel); 148 132 _rawC1 = _validObs1->_code; 149 _rawL1 = _validObs1->_phase * t_ genConst::c / _f1;133 _rawL1 = _validObs1->_phase * t_CST::c / _f1; 150 134 if (dualFreq) { 151 _f2 = t_ genConst::f2(_prn.system(), _channel);135 _f2 = t_CST::f2(_prn.system(), _channel); 152 136 _rawC2 = _validObs2->_code; 153 _rawL2 = _validObs2->_phase * t_ genConst::c / _f2;137 _rawL2 = _validObs2->_phase * t_CST::c / _f2; 154 138 } 155 139 else { … … 168 152 double prange = obsValue(tLC); 169 153 for (int ii = 1; ii <= 10; ii++) { 170 bncTime ToT = _time - prange / t_ genConst::c - _xcSat[3];171 if (PPP_CLIENT->ephPool()->getCrd(_prn, ToT, _xcSat, _vvSat) != t_irc::success) {154 bncTime ToT = _time - prange / t_CST::c - _xcSat[3]; 155 if (PPP_CLIENT->ephPool()->getCrd(_prn, ToT, _xcSat, _vvSat) != success) { 172 156 _valid = false; 173 157 return; 174 158 } 175 159 ColumnVector dx = _xcSat - satPosOld; 176 dx[3] *= t_ genConst::c;160 dx[3] *= t_CST::c; 177 161 if (dx.norm_Frobenius() < 1.e-4) { 178 162 totOK = true; … … 182 166 } 183 167 if (totOK) { 184 _model._satClkM = _xcSat[3] * t_ genConst::c;168 _model._satClkM = _xcSat[3] * t_CST::c; 185 169 } 186 170 else { … … 214 198 // Satellite Clocks 215 199 // ---------------- 216 _model._satClkM = _xcSat[3] * t_ genConst::c;200 _model._satClkM = _xcSat[3] * t_CST::c; 217 201 218 202 // Receiver Clocks 219 203 // --------------- 220 _model._recClkM = station->dClk() * t_ genConst::c;204 _model._recClkM = station->dClk() * t_CST::c; 221 205 222 206 // Sagnac Effect (correction due to Earth rotation) … … 225 209 Omega[0] = 0.0; 226 210 Omega[1] = 0.0; 227 Omega[2] = t_ genConst::omega / t_genConst::c;211 Omega[2] = t_CST::omega / t_CST::c; 228 212 _model._sagnac = DotProduct(Omega, crossproduct(rSat, station->xyzApr())); 229 213 … … 250 234 // Tropospheric Delay 251 235 // ------------------ 252 t_tropo::dtrop(_time, station->ellApr()[0], station->ellApr()[1], 253 station->ellApr()[2], _model._eleSat, OPT->tropoModel(), 254 OPT->tropoMF(), false, _model._tropo); 236 _model._tropo = bncModel::delay_saast(station->xyzApr(), station->ellApr()[2]); 255 237 256 238 // Phase Wind-Up … … 264 246 bool biasL1flg = false; 265 247 bool biasL2flg = false; 266 int nsdfix = 0;267 248 const t_satBias* satBias = PPP_CLIENT->obsPool()->satBias(_prn); 268 249 if (satBias) { 269 nsdfix = satBias->nx();270 250 map<t_biasType, double>::const_iterator it; 271 251 for (it = satBias->biases().begin(); it != satBias->biases().end(); it++) { … … 273 253 if (_validObs1) { 274 254 _validObs1->_biasJumpCounter = satBias->jumpCount(); 275 if ("C" + _validObs1->_ type== biasType) {255 if ("C" + _validObs1->_rnxType2ch == biasType) { 276 256 _model._biasC1 = it->second; 277 257 biasC1flg = true; 278 258 } 279 else if ("L" + _validObs1->_ type== biasType) {259 else if ("L" + _validObs1->_rnxType2ch == biasType) { 280 260 _model._biasL1 = it->second; 281 261 biasL1flg = true; … … 284 264 if (_validObs2) { 285 265 _validObs2->_biasJumpCounter = satBias->jumpCount(); 286 if ("C" + _validObs2->_ type== biasType) {266 if ("C" + _validObs2->_rnxType2ch == biasType) { 287 267 _model._biasC2 = it->second; 288 268 biasC2flg = true; 289 269 } 290 else if ("L" + _validObs2->_ type== biasType) {270 else if ("L" + _validObs2->_rnxType2ch == biasType) { 291 271 _model._biasL2 = it->second; 292 272 biasL2flg = true; … … 299 279 _valid = false; 300 280 } 301 if (nsdfix < OPT->minSDFix()) {302 _valid = false;303 }304 281 } 305 282 … … 320 297 _model._set = true; 321 298 322 return t_irc::success;299 return success; 323 300 } 324 301 … … 329 306 LOG << "MODEL for Satellite " << _prn.toString() << endl 330 307 << "RHO: " << setw(12) << setprecision(3) << _model._rho << endl 331 << "ELE: " << setw(12) << setprecision(3) << _model._eleSat * t_genConst::rho_deg<< endl332 << "AZI: " << setw(12) << setprecision(3) << _model._azSat * t_genConst::rho_deg<< endl308 << "ELE: " << setw(12) << setprecision(3) << _model._eleSat * 180.0 / M_PI << endl 309 << "AZI: " << setw(12) << setprecision(3) << _model._azSat * 180.0 / M_PI << endl 333 310 << "SATCLK: " << setw(12) << setprecision(3) << _model._satClkM << endl 334 311 << "RECCLK: " << setw(12) << setprecision(3) << _model._recClkM << endl … … 350 327 351 328 LOG << "WIND L3:" << setw(12) << setprecision(3) 352 << lc(t_lc::lIF, _model._windUp * t_ genConst::c / _f1,353 _model._windUp * t_ genConst::c / _f2, 0.0, 0.0) << endl;329 << lc(t_lc::lIF, _model._windUp * t_CST::c / _f1, 330 _model._windUp * t_CST::c / _f2, 0.0, 0.0) << endl; 354 331 355 332 LOG << "OBS-CMP P3: " << _prn.toString() << " " … … 403 380 // Add Dispersive Part 404 381 // ------------------- 405 double L1 = nonDisp + _model._antPco1 - _model._biasL1 + _model._windUp * t_ genConst::c / _f1;406 double L2 = nonDisp + _model._antPco2 - _model._biasL2 + _model._windUp * t_ genConst::c / _f2;382 double L1 = nonDisp + _model._antPco1 - _model._biasL1 + _model._windUp * t_CST::c / _f1; 383 double L2 = nonDisp + _model._antPco2 - _model._biasL2 + _model._windUp * t_CST::c / _f2; 407 384 double C1 = nonDisp + _model._antPco1 - _model._biasC1; 408 385 double C2 = nonDisp + _model._antPco2 - _model._biasC2; … … 503 480 _model._biasL2 -= obsBase->_model._biasL2; 504 481 505 return t_irc::success;482 return success; 506 483 } 507 484 … … 511 488 512 489 if (tLC == t_lc::l1) { 513 return t_ genConst::c / _f1;490 return t_CST::c / _f1; 514 491 } 515 492 else if (tLC == t_lc::l2) { 516 return t_ genConst::c / _f2;493 return t_CST::c / _f2; 517 494 } 518 495 else if (tLC == t_lc::lIF) { 519 return t_ genConst::c / (_f1 + _f2);496 return t_CST::c / (_f1 + _f2); 520 497 } 521 498 else if (tLC == t_lc::MW) { 522 return t_ genConst::c / (_f1 - _f2);499 return t_CST::c / (_f1 - _f2); 523 500 } 524 501 else if (tLC == t_lc::CL) { 525 return t_ genConst::c / _f1 / 2.0;502 return t_CST::c / _f1 / 2.0; 526 503 } 527 504 … … 534 511 535 512 ColumnVector sig(4); 536 sig(1) = OPT-> sigmaPhase();537 sig(2) = OPT-> sigmaPhase();538 sig(3) = OPT-> sigmaCode();539 sig(4) = OPT-> sigmaCode();513 sig(1) = OPT->_sigmaL1; 514 sig(2) = OPT->_sigmaL1; 515 sig(3) = OPT->_sigmaC1; 516 sig(4) = OPT->_sigmaC1; 540 517 541 518 ColumnVector coeff(4); … … 547 524 // ----------------------------- 548 525 double cEle = 1.0; 549 if ( (OPT-> eleWgtCode()&& t_lc::includesCode(tLC)) ||550 (OPT-> eleWgtPhase()&& t_lc::includesPhase(tLC)) ) {551 double eleD = eleSat()*180.0/ t_genConst::pi;526 if ( (OPT->_eleWgtCode && t_lc::includesCode(tLC)) || 527 (OPT->_eleWgtPhase && t_lc::includesPhase(tLC)) ) { 528 double eleD = eleSat()*180.0/M_PI; 552 529 double hlp = fabs(90.0 - eleD); 553 530 cEle = (1.0 + hlp*hlp*hlp*0.000004); -
trunk/BNC/src/bncantex.h
r5742 r5750 27 27 28 28 #include <QtCore> 29 #include <string> 29 30 #include <newmat.h> 30 31 #include "bncconst.h" 31 32 #include "bnctime.h" 33 #include "PPP/ppp.h" 32 34 33 35 class bncAntex { … … 39 41 void print() const; 40 42 double pco(const QString& antName, double eleSat, bool& found); 43 double rcvCorr(BNC::t_frequency::type frqType, const std::string& antName, 44 double eleSat, bool& found) const; 41 45 t_irc satCoMcorrection(const QString& prn, double Mjd, 42 46 const ColumnVector& xSat, ColumnVector& dx); -
trunk/BNC/src/bncmodel.cpp
r5656 r5750 342 342 satData->rho = (satData->xx - xRec).norm_Frobenius(); 343 343 344 double tropDelay = delay_saast( satData->eleSat) +344 double tropDelay = delay_saast(xRec, satData->eleSat) + 345 345 trp() / sin(satData->eleSat); 346 346 … … 385 385 // Tropospheric Model (Saastamoinen) 386 386 //////////////////////////////////////////////////////////////////////////// 387 double bncModel::delay_saast( double Ele) {387 double bncModel::delay_saast(const ColumnVector& xyz, double Ele) { 388 388 389 389 Tracer tracer("bncModel::delay_saast"); 390 390 391 double xyz[3];392 xyz[0] = x();393 xyz[1] = y();394 xyz[2] = z();395 391 double ell[3]; 396 xyz2ell(xyz , ell);392 xyz2ell(xyz.data(), ell); 397 393 double height = ell[2]; 398 394 … … 649 645 } 650 646 else if (par->type == bncParam::TROPO) { 651 double aprTrp = delay_saast(M_PI/2.0); 647 ColumnVector xyz(3); xyz(1) = x(); xyz(2) = y(); xyz(3) = z(); 648 double aprTrp = delay_saast(xyz, M_PI/2.0); 652 649 strB << "\n trp = " << par->prn.toAscii().data() 653 650 << setw(7) << setprecision(3) << aprTrp << " " -
trunk/BNC/src/bncmodel.h
r5570 r5750 99 99 SymmetricMatrix& QQ, ColumnVector& dx); 100 100 101 static double delay_saast(const ColumnVector& xyz, double Ele); 102 101 103 private: 102 104 void reset(); … … 113 115 double& maxResGPS, double& maxResGlo); 114 116 double cmpValue(t_satData* satData, bool phase); 115 double delay_saast(double Ele);116 117 void predict(int iPhase, t_epoData* epoData); 117 118 t_irc update_p(t_epoData* epoData);
Note:
See TracChangeset
for help on using the changeset viewer.