1  #ifndef PPPSATOBS_H


2  #define PPPSATOBS_H


3 


4  #include <string>


5  #include <map>


6  #include <newmat.h>


7  #include "pppInclude.h"


8  #include "satObs.h"


9  #include "bnctime.h"


10 


11  namespace BNC_PPP {


12 


13  class t_pppStation;


14 


15  class t_pppSatObs {


16  public:


17  t_pppSatObs(const t_satObs& satObs);


18  ~t_pppSatObs();


19  bool isValid() const {return _valid;};


20  bool isValid(t_lc::type tLC) const;


21  bool isReference() const {return _reference;};


22  void setAsReference() {_reference = true;};


23  void resetReference() {_reference = false;};


24  const t_prn& prn() const {return _prn;}


25  const ColumnVector& xc() const {return _xcSat;}


26  const bncTime& time() const {return _time;}


27  t_irc cmpModel(const t_pppStation* station);


28  double obsValue(t_lc::type tLC, bool* valid = 0) const;


29  double cmpValue(t_lc::type tLC) const;


30  double cmpValueForBanc(t_lc::type tLC) const;


31  double rho() const {return _model._rho;}


32  double sagnac() const {return _model._sagnac;}


33  double eleSat() const {return _model._eleSat;}


34  bool modelSet() const {return _model._set;}


35  void printModel() const;


36  void printObsMinusComputed() const;


37  void lcCoeff(t_lc::type tLC,


38  std::map<t_frequency::type, double>& codeCoeff,


39  std::map<t_frequency::type, double>& phaseCoeff,


40  std::map<t_frequency::type, double>& ionoCoeff) const;


41  double lambda(t_lc::type tLC) const;


42  double sigma(t_lc::type tLC) const;


43  double maxRes(t_lc::type tLC) const;


44  bool outlier() const {return _outlier;}


45  void setOutlier() {_outlier = true;}


46  void resetOutlier() {_outlier = false;}


47  void setRes(t_lc::type tLC, double res);


48  double getRes(t_lc::type tLC) const;


49  void setPseudoObsIono(t_frequency::type freq, double stecRefSat);


50  void setPseudoObsTropo();


51  double getIonoCodeDelay(t_frequency::type freq) {return _model._ionoCodeDelay[freq];}


52 


53  // RINEX


54  bool slip() const {


55  for (unsigned ii = 1; ii < t_frequency::max; ii++) {


56  if (_obs[ii] && _obs[ii]>_slip) {


57  return true;


58  }


59  }


60  return false;


61  }


62 


63  // RTCM


64  int slipCounter() const {


65  int cnt = 1;


66  for (unsigned ii = 1; ii < t_frequency::max; ii++) {


67  if (_obs[ii] && _obs[ii]>_slipCounter > cnt) {


68  cnt = _obs[ii]>_slipCounter;


69  }


70  }


71  return cnt;


72  }


73 


74  int biasJumpCounter() const {


75  int jmp = 1;


76  for (unsigned ii = 1; ii < t_frequency::max; ii++) {


77  if (_obs[ii] && _obs[ii]>_biasJumpCounter > jmp) {


78  jmp = _obs[ii]>_biasJumpCounter;


79  }


80  }


81  return jmp;


82  }


83 


84  private:


85  class t_model {


86  public:


87  t_model() {reset();}


88  ~t_model() {}


89  void reset() {


90  _set = false;


91  _rho = 0.0;


92  _eleSat = 0.0;


93  _azSat = 0.0;


94  _elTx = 0.0;


95  _azTx = 0.0;


96  _recClkM = 0.0;


97  _satClkM = 0.0;


98  _sagnac = 0.0;


99  _antEcc = 0.0;


100  _tropo = 0.0;


101  _tropo0 = 0.0;


102  _tideEarth = 0.0;


103  _tideOcean = 0.0;


104  _windUp = 0.0;


105  _rel = 0.0;


106  for (unsigned ii = 0; ii < t_frequency::max; ii++) {


107  _antPCO[ii] = 0.0;


108  _codeBias[ii] = 0.0;


109  _phaseBias[ii] = 0.0;


110  _ionoCodeDelay[ii] = 0.0;


111  }


112  }


113  bool _set;


114  double _rho;


115  double _eleSat;


116  double _azSat;


117  double _elTx;


118  double _azTx;


119  double _recClkM;


120  double _satClkM;


121  double _sagnac;


122  double _antEcc;


123  double _tropo;


124  double _tropo0;


125  double _tideEarth;


126  double _tideOcean;


127  double _windUp;


128  double _rel;


129  double _antPCO[t_frequency::max];


130  double _codeBias[t_frequency::max];


131  double _phaseBias[t_frequency::max];


132  double _ionoCodeDelay[t_frequency::max];


133  };


134 


135  void prepareObs(const t_satObs& satObs);


136 


137  bool _valid;


138  bool _reference;


139  t_frequency::type _fType1;


140  t_frequency::type _fType2;


141  t_prn _prn;


142  bncTime _time;


143  int _channel;


144  t_frqObs* _obs[t_frequency::max];


145  ColumnVector _xcSat;


146  ColumnVector _vvSat;


147  t_model _model;


148  bool _outlier;


149  std::map<t_lc::type, double> _res;


150  double _signalPropagationTime;


151  double _stecRefSat;


152  double _stecSat;


153  double _tropo0;


154  };


155 


156  }


157 


158  #endif

