Changeset 6026 in ntrip for trunk/BNC/src/PPP
- Timestamp:
- Aug 21, 2014, 10:58:55 AM (10 years ago)
- Location:
- trunk/BNC/src/PPP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppSatObs.cpp
r6025 r6026 103 103 } 104 104 105 // Used frequency types 106 // -------------------- 107 _fType1 = t_lc::toFreq(_prn.system(),t_lc::l1); 108 _fType2 = t_lc::toFreq(_prn.system(),t_lc::l2); 109 105 110 // Check whether all required frequencies available 106 111 // ------------------------------------------------ … … 161 166 phaseCoeff.clear(); 162 167 163 t_frequency::type fType1 = t_lc::toFreq(_prn.system(),t_lc::l1); 164 t_frequency::type fType2 = t_lc::toFreq(_prn.system(),t_lc::l2); 165 166 double f1 = t_CST::freq(fType1, _channel); 167 double f2 = t_CST::freq(fType2, _channel); 168 double f1 = t_CST::freq(_fType1, _channel); 169 double f2 = t_CST::freq(_fType2, _channel); 168 170 169 171 switch (tLC) { 170 172 case t_lc::l1: 171 phaseCoeff[ fType1] = 1.0;173 phaseCoeff[_fType1] = 1.0; 172 174 return; 173 175 case t_lc::l2: 174 phaseCoeff[ fType2] = 1.0;176 phaseCoeff[_fType2] = 1.0; 175 177 return; 176 178 case t_lc::lIF: 177 phaseCoeff[ fType1] = f1 * f1 / (f1 * f1 - f2 * f2);178 phaseCoeff[ fType2] = -f2 * f2 / (f1 * f1 - f2 * f2);179 phaseCoeff[_fType1] = f1 * f1 / (f1 * f1 - f2 * f2); 180 phaseCoeff[_fType2] = -f2 * f2 / (f1 * f1 - f2 * f2); 179 181 return; 180 182 case t_lc::MW: 181 phaseCoeff[ fType1] = f1 / (f1 - f2);182 phaseCoeff[ fType2] = -f2 / (f1 - f2);183 codeCoeff[ fType1] = -f1 / (f1 + f2);184 codeCoeff[ fType2] = -f2 / (f1 + f2);183 phaseCoeff[_fType1] = f1 / (f1 - f2); 184 phaseCoeff[_fType2] = -f2 / (f1 - f2); 185 codeCoeff[_fType1] = -f1 / (f1 + f2); 186 codeCoeff[_fType2] = -f2 / (f1 + f2); 185 187 return; 186 188 case t_lc::CL: 187 phaseCoeff[ fType1] = 0.5;188 codeCoeff[ fType1] = 0.5;189 phaseCoeff[_fType1] = 0.5; 190 codeCoeff[_fType1] = 0.5; 189 191 return; 190 192 case t_lc::c1: 191 codeCoeff[ fType1] = 1.0;193 codeCoeff[_fType1] = 1.0; 192 194 return; 193 195 case t_lc::c2: 194 codeCoeff[ fType2] = 1.0;196 codeCoeff[_fType2] = 1.0; 195 197 return; 196 198 case t_lc::cIF: 197 codeCoeff[ fType1] = f1 * f1 / (f1 * f1 - f2 * f2);198 codeCoeff[ fType2] = -f2 * f2 / (f1 * f1 - f2 * f2);199 codeCoeff[_fType1] = f1 * f1 / (f1 * f1 - f2 * f2); 200 codeCoeff[_fType2] = -f2 * f2 / (f1 * f1 - f2 * f2); 199 201 return; 200 202 case t_lc::dummy: … … 202 204 return; 203 205 } 206 } 207 208 // 209 //////////////////////////////////////////////////////////////////////////// 210 bool t_pppSatObs::isValid(t_lc::type tLC) const { 211 212 map<t_frequency::type, double> codeCoeff; 213 map<t_frequency::type, double> phaseCoeff; 214 lcCoeff(tLC, codeCoeff, phaseCoeff); 215 216 map<t_frequency::type, double>::const_iterator it; 217 for (it = codeCoeff.begin(); it != codeCoeff.end(); it++) { 218 t_frequency::type tFreq = it->first; 219 if (_obs[tFreq] == 0) { 220 return false; 221 } 222 } 223 for (it = phaseCoeff.begin(); it != phaseCoeff.end(); it++) { 224 t_frequency::type tFreq = it->first; 225 if (_obs[tFreq] == 0) { 226 return false; 227 } 228 } 229 230 return true; 231 } 232 233 // 234 //////////////////////////////////////////////////////////////////////////// 235 double t_pppSatObs::obsValue(t_lc::type tLC) const { 236 237 if (!_validObs2 && t_lc::need2ndFreq(tLC)) { 238 return 0.0; 239 } 240 241 return this->lc(tLC, _rawL1, _rawL2, _rawC1, _rawC2); 204 242 } 205 243 … … 359 397 // 360 398 //////////////////////////////////////////////////////////////////////////// 361 double t_pppSatObs::obsValue(t_lc::type tLC) const {362 363 if (!_validObs2 && t_lc::need2ndFreq(tLC)) {364 return 0.0;365 }366 367 return this->lc(tLC, _rawL1, _rawL2, _rawC1, _rawC2);368 }369 370 //371 ////////////////////////////////////////////////////////////////////////////372 399 double t_pppSatObs::cmpValueForBanc(t_lc::type tLC) const { 373 400 return cmpValue(tLC) - _model._rho - _model._sagnac - _model._recClkM; … … 396 423 397 424 return this->lc(tLC, L1, L2, C1, C2); 398 }399 400 //401 ////////////////////////////////////////////////////////////////////////////402 double t_pppSatObs::lc(t_lc::type tLC,403 double L1, double L2, double C1, double C2,404 ColumnVector* coeff) const {405 406 if (coeff) {407 coeff->ReSize(4);408 (*coeff) = 0.0;409 }410 411 if (tLC == t_lc::l1) {412 if (coeff) (*coeff)(1) = 1.0;413 return L1;414 }415 else if (tLC == t_lc::l2) {416 if (coeff) (*coeff)(2) = 1.0;417 return L2;418 }419 else if (tLC == t_lc::c1) {420 if (coeff) (*coeff)(3) = 1.0;421 return C1;422 }423 else if (tLC == t_lc::c2) {424 if (coeff) (*coeff)(4) = 1.0;425 return C2;426 }427 else if (tLC == t_lc::lIF || tLC == t_lc::cIF) {428 double a1 = _f1 * _f1 / (_f1 * _f1 - _f2 * _f2);429 double a2 = -_f2 * _f2 / (_f1 * _f1 - _f2 * _f2);430 if (tLC == t_lc::lIF) {431 if (coeff) {432 (*coeff)(1) = a1;433 (*coeff)(2) = a2;434 }435 return a1 * L1 + a2 * L2;436 }437 else {438 if (coeff) {439 (*coeff)(3) = a1;440 (*coeff)(4) = a2;441 }442 return a1 * C1 + a2 * C2;443 }444 }445 else if (tLC == t_lc::MW) {446 double a1 = _f1 / (_f1 - _f2);447 double a2 = -_f2 / (_f1 - _f2);448 double a3 = -_f1 / (_f1 + _f2);449 double a4 = -_f2 / (_f1 + _f2);450 if (coeff) {451 (*coeff)(1) = a1;452 (*coeff)(2) = a2;453 (*coeff)(3) = a3;454 (*coeff)(4) = a4;455 }456 return a1 * L1 + a2 * L2 + a3 * C1 + a4 * C2;457 }458 else if (tLC == t_lc::CL) {459 if (coeff) {460 (*coeff)(1) = 0.5;461 (*coeff)(3) = 0.5;462 }463 return (C1 + L1) / 2.0;464 }465 466 return 0.0;467 425 } 468 426 -
trunk/BNC/src/PPP/pppSatObs.h
r6023 r6026 112 112 113 113 bool _valid; 114 t_frequency::type _fType1; 115 t_frequency::type _fType2; 114 116 t_prn _prn; 115 117 bncTime _time;
Note:
See TracChangeset
for help on using the changeset viewer.