Changeset 7288 in ntrip for trunk/BNC/src/PPP/pppSatObs.cpp


Ignore:
Timestamp:
Sep 20, 2015, 10:39:48 PM (9 years ago)
Author:
stuerze
Message:

phase biases added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppSatObs.cpp

    r7262 r7288  
    1111 * Created:    29-Jul-2014
    1212 *
    13  * Changes:   
     13 * Changes:
    1414 *
    1515 * -----------------------------------------------------------------------*/
     
    5353}
    5454
    55 // 
     55//
    5656////////////////////////////////////////////////////////////////////////////
    5757void t_pppSatObs::prepareObs(const t_satObs& pppSatObs) {
     
    122122      break;
    123123    }
    124     satPosOld = _xcSat; 
     124    satPosOld = _xcSat;
    125125  }
    126126  if (totOK) {
    127127    _signalPropagationTime = prange / t_CST::c - _xcSat[3];
    128     _model._satClkM = _xcSat[3] * t_CST::c; 
     128    _model._satClkM = _xcSat[3] * t_CST::c;
    129129  }
    130130  else {
     
    133133}
    134134
    135 // 
    136 ////////////////////////////////////////////////////////////////////////////
    137 void t_pppSatObs::lcCoeff(t_lc::type tLC, 
     135//
     136////////////////////////////////////////////////////////////////////////////
     137void t_pppSatObs::lcCoeff(t_lc::type tLC,
    138138                          map<t_frequency::type, double>& codeCoeff,
    139139                          map<t_frequency::type, double>& phaseCoeff) const {
     
    147147  switch (tLC) {
    148148  case t_lc::l1:
    149     phaseCoeff[_fType1] = 1.0; 
    150     return;
    151   case t_lc::l2: 
    152     phaseCoeff[_fType2] = 1.0; 
    153     return;
    154   case t_lc::lIF: 
     149    phaseCoeff[_fType1] = 1.0;
     150    return;
     151  case t_lc::l2:
     152    phaseCoeff[_fType2] = 1.0;
     153    return;
     154  case t_lc::lIF:
    155155    phaseCoeff[_fType1] =  f1 * f1 / (f1 * f1 - f2 * f2);
    156156    phaseCoeff[_fType2] = -f2 * f2 / (f1 * f1 - f2 * f2);
    157157    return;
    158   case t_lc::MW: 
     158  case t_lc::MW:
    159159    phaseCoeff[_fType1] =  f1 / (f1 - f2);
    160160    phaseCoeff[_fType2] = -f2 / (f1 - f2);
     
    162162    codeCoeff[_fType2]  = -f2 / (f1 + f2);
    163163    return;
    164   case t_lc::CL: 
     164  case t_lc::CL:
    165165    phaseCoeff[_fType1] =  0.5;
    166166    codeCoeff[_fType1]  =  0.5;
    167167    return;
    168   case t_lc::c1: 
    169     codeCoeff[_fType1] = 1.0; 
    170     return;
    171   case t_lc::c2: 
    172     codeCoeff[_fType2] = 1.0; 
    173     return;
    174   case t_lc::cIF: 
     168  case t_lc::c1:
     169    codeCoeff[_fType1] = 1.0;
     170    return;
     171  case t_lc::c2:
     172    codeCoeff[_fType2] = 1.0;
     173    return;
     174  case t_lc::cIF:
    175175    codeCoeff[_fType1] =  f1 * f1 / (f1 * f1 - f2 * f2);
    176176    codeCoeff[_fType2] = -f2 * f2 / (f1 * f1 - f2 * f2);
    177177    return;
    178   case t_lc::dummy: 
    179   case t_lc::maxLc: 
    180     return;
    181   }
    182 }
    183 
    184 // 
     178  case t_lc::dummy:
     179  case t_lc::maxLc:
     180    return;
     181  }
     182}
     183
     184//
    185185////////////////////////////////////////////////////////////////////////////
    186186bool t_pppSatObs::isValid(t_lc::type tLC) const {
     
    189189  return valid;
    190190}
    191 // 
     191//
    192192////////////////////////////////////////////////////////////////////////////
    193193double t_pppSatObs::obsValue(t_lc::type tLC, bool* valid) const {
     
    225225}
    226226
    227 // 
     227//
    228228////////////////////////////////////////////////////////////////////////////
    229229double t_pppSatObs::lambda(t_lc::type tLC) const {
     
    251251}
    252252
    253 // 
     253//
    254254////////////////////////////////////////////////////////////////////////////
    255255double t_pppSatObs::sigma(t_lc::type tLC) const {
     
    268268    retVal += it->second * it->second * OPT->_sigmaL1 * OPT->_sigmaL1;
    269269  }
    270  
    271   retVal = sqrt(retVal);   
     270
     271  retVal = sqrt(retVal);
    272272
    273273  // De-Weight GLONASS
     
    290290}
    291291
    292 // 
     292//
    293293////////////////////////////////////////////////////////////////////////////
    294294double t_pppSatObs::maxRes(t_lc::type tLC) const {
     
    312312
    313313
    314 // 
     314//
    315315////////////////////////////////////////////////////////////////////////////
    316316t_irc t_pppSatObs::cmpModel(const t_pppStation* station) {
     
    323323  // ------------------------------
    324324  ColumnVector rSat = _xcSat.Rows(1,3);
    325   ColumnVector rhoV = rSat - station->xyzApr(); 
     325  ColumnVector rhoV = rSat - station->xyzApr();
    326326  _model._rho = rhoV.norm_Frobenius();
    327327
     
    361361      t_frequency::type frqType = static_cast<t_frequency::type>(ii);
    362362      bool found;
    363       _model._antPCO[ii] = PPP_CLIENT->antex()->rcvCorr(station->antName(), frqType, 
     363      _model._antPCO[ii] = PPP_CLIENT->antex()->rcvCorr(station->antName(), frqType,
    364364                                                        _model._eleSat, _model._azSat, found);
    365365    }
     
    377377  // -----------
    378378  const t_satCodeBias* satCodeBias = PPP_CLIENT->obsPool()->satCodeBias(_prn);
    379   if (satCodeBias) { 
     379  if (satCodeBias) {
    380380    for (unsigned ii = 0; ii < satCodeBias->_bias.size(); ii++) {
    381381      const t_frqCodeBias& bias = satCodeBias->_bias[ii];
     
    389389  }
    390390
     391  // Phase Biases
     392  // -----------
     393  // TODO: consideration of fix indicators, yaw angle and jump counter
     394  const t_satPhaseBias* satPhaseBias = PPP_CLIENT->obsPool()->satPhaseBias(_prn);
     395  if (satPhaseBias) {
     396    for (unsigned ii = 0; ii < satPhaseBias->_bias.size(); ii++) {
     397      const t_frqPhaseBias& bias = satPhaseBias->_bias[ii];
     398      for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
     399        const t_frqObs* obs = _obs[iFreq];
     400        if (obs && obs->_rnxType2ch == bias._rnxType2ch) {
     401          _model._phaseBias[iFreq]  = bias._value;
     402        }
     403      }
     404    }
     405  }
     406
    391407  // Tidal Correction
    392408  // ----------------
     
    424440}
    425441
    426 // 
     442//
    427443////////////////////////////////////////////////////////////////////////////
    428444void t_pppSatObs::printModel() const {
     
    442458  for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
    443459    if (_obs[iFreq]) {
    444       LOG << "PCO           : " << t_frequency::toString(t_frequency::type(iFreq)) << setw(12) << setprecision(3) << _model._antPCO[iFreq]    << endl
    445           << "BIAS CODE     : " << t_frequency::toString(t_frequency::type(iFreq)) << setw(12) << setprecision(3) << _model._codeBias[iFreq]  << endl
    446           << "BIAS PHASE    : " << t_frequency::toString(t_frequency::type(iFreq)) << setw(12) << setprecision(3) << _model._phaseBias[iFreq]  << endl
    447           << "IONO CODEDELAY: " << t_frequency::toString(t_frequency::type(iFreq)) << setw(12) << setprecision(3) << _model._ionoCodeDelay[iFreq] << endl;
     460      string frqStr = t_frequency::toString(t_frequency::type(iFreq));
     461      if (_prn.system() == frqStr[0]) {
     462      LOG << "PCO           : " << frqStr << setw(12) << setprecision(3) << _model._antPCO[iFreq]    << endl
     463          << "BIAS CODE     : " << frqStr << setw(12) << setprecision(3) << _model._codeBias[iFreq]  << endl
     464          << "BIAS PHASE    : " << frqStr << setw(12) << setprecision(3) << _model._phaseBias[iFreq]  << endl
     465          << "IONO CODEDELAY: " << frqStr << setw(12) << setprecision(3) << _model._ionoCodeDelay[iFreq] << endl;
     466      }
    448467    }
    449468  }
     
    456475
    457476  }
    458   LOG << "OBS-CMP MW: " << _prn.toString() << " " 
     477  LOG << "OBS-CMP MW: " << _prn.toString() << " "
    459478      << setw(12) << setprecision(3) << obsValue(t_lc::MW) << " "
    460479      << setw(12) << setprecision(3) << cmpValue(t_lc::MW) << " "
     
    462481}
    463482
    464 // 
     483//
    465484////////////////////////////////////////////////////////////////////////////
    466485double t_pppSatObs::cmpValueForBanc(t_lc::type tLC) const {
     
    468487}
    469488
    470 // 
     489//
    471490////////////////////////////////////////////////////////////////////////////
    472491double t_pppSatObs::cmpValue(t_lc::type tLC) const {
     
    478497  // Non-Dispersive Part
    479498  // -------------------
    480   double nonDisp = _model._rho    + _model._recClkM - _model._satClkM 
    481                  + _model._sagnac + _model._antEcc  + _model._tropo 
     499  double nonDisp = _model._rho    + _model._recClkM - _model._satClkM
     500                 + _model._sagnac + _model._antEcc  + _model._tropo
    482501                 + _model._tide;
    483502
     
    506525}
    507526
    508 // 
     527//
    509528////////////////////////////////////////////////////////////////////////////
    510529void t_pppSatObs::setRes(t_lc::type tLC, double res) {
     
    512531}
    513532
    514 // 
     533//
    515534////////////////////////////////////////////////////////////////////////////
    516535double t_pppSatObs::getRes(t_lc::type tLC) const {
Note: See TracChangeset for help on using the changeset viewer.