Changeset 7288 in ntrip for trunk/BNC/src/PPP


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

phase biases added

Location:
trunk/BNC/src/PPP
Files:
5 edited

Legend:

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

    r7271 r7288  
    129129  for (unsigned ii = 0; ii < biases.size(); ii++) {
    130130    _obsPool->putCodeBias(new t_satCodeBias(*biases[ii]));
     131  }
     132}
     133
     134//
     135//////////////////////////////////////////////////////////////////////////////
     136void t_pppClient::putPhaseBiases(const vector<t_satPhaseBias*>& biases) {
     137  for (unsigned ii = 0; ii < biases.size(); ii++) {
     138    _obsPool->putPhaseBias(new t_satPhaseBias(*biases[ii]));
    131139  }
    132140}
  • trunk/BNC/src/PPP/pppClient.h

    r7248 r7288  
    2121class t_pppClient : public interface_pppClient {
    2222 public:
    23   t_pppClient(const t_pppOptions* opt);                                                     
    24   ~t_pppClient();                                                     
     23  t_pppClient(const t_pppOptions* opt);
     24  ~t_pppClient();
    2525
    26   void putEphemeris(const t_eph* eph);                 
     26  void putEphemeris(const t_eph* eph);
    2727  void putTec(const t_vTec* vTec);
    28   void putOrbCorrections(const std::vector<t_orbCorr*>& corr);
    29   void putClkCorrections(const std::vector<t_clkCorr*>& corr);
    30   void putCodeBiases(const std::vector<t_satCodeBias*>& satBias);   
     28  void putOrbCorrections(const std::vector<t_orbCorr*>& corr);
     29  void putClkCorrections(const std::vector<t_clkCorr*>& corr);
     30  void putCodeBiases(const std::vector<t_satCodeBias*>& biases);
     31  void putPhaseBiases(const std::vector<t_satPhaseBias*>& biases);
    3132  void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output);
    3233
     
    5253  t_irc cmpModel(t_pppStation* station, const ColumnVector& xyzc,
    5354                 std::vector<t_pppSatObs*>& obsVector);
    54   t_irc cmpBancroft(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector, 
     55  t_irc cmpBancroft(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
    5556                    ColumnVector& xyzc, bool print);
    5657  double cmpOffGG(std::vector<t_pppSatObs*>& obsVector);
     
    6566  double                    _offGG;
    6667  std::vector<t_pppSatObs*> _obsRover;
    67   std::ostringstream*       _log; 
    68   t_pppOptions*             _opt; 
     68  std::ostringstream*       _log;
     69  t_pppOptions*             _opt;
    6970  t_tides*                  _tides;
    7071};
  • trunk/BNC/src/PPP/pppObsPool.cpp

    r7249 r7288  
    1111 * Created:    29-Jul-2014
    1212 *
    13  * Changes:   
     13 * Changes:
    1414 *
    1515 * -----------------------------------------------------------------------*/
     
    4444    _satCodeBiases[ii] = 0;
    4545  }
     46  for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
     47    _satPhaseBiases[ii] = 0;
     48  }
    4649  _vTec = 0;
    4750}
     
    7073//
    7174/////////////////////////////////////////////////////////////////////////////
     75void t_pppObsPool::putPhaseBias(t_satPhaseBias* satPhaseBias) {
     76  int iPrn = satPhaseBias->_prn.toInt();
     77  delete _satPhaseBiases[iPrn];
     78  _satPhaseBiases[iPrn] = satPhaseBias;
     79}
     80
     81//
     82/////////////////////////////////////////////////////////////////////////////
    7283void t_pppObsPool::putTec(t_vTec* vTec) {
    7384   delete _vTec;
  • trunk/BNC/src/PPP/pppObsPool.h

    r7249 r7288  
    1010
    1111class t_pppObsPool {
    12  public: 
     12 public:
    1313
    1414  class t_epoch {
     
    2727  ~t_pppObsPool();
    2828  void putCodeBias(t_satCodeBias* satCodeBias);
     29  void putPhaseBias(t_satPhaseBias* satPhaseBias);
    2930  void putTec(t_vTec* _vTec);
    3031
    3132  void putEpoch(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector);
    3233
    33   const t_satCodeBias* satCodeBias(const t_prn& prn) const { 
     34  const t_satCodeBias* satCodeBias(const t_prn& prn) const {
    3435    return _satCodeBiases[prn.toInt()];
     36  }
     37  const t_satPhaseBias* satPhaseBias(const t_prn& prn) const {
     38    return _satPhaseBiases[prn.toInt()];
    3539  }
    3640  const t_vTec* vTec() const {return _vTec;}
     
    4751 private:
    4852  t_satCodeBias*       _satCodeBiases[t_prn::MAXPRN+1];
     53  t_satPhaseBias*      _satPhaseBiases[t_prn::MAXPRN+1];
    4954  t_vTec*              _vTec;
    5055  std::deque<t_epoch*> _epochs;
  • 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.