Changeset 5752 in ntrip


Ignore:
Timestamp:
Aug 3, 2014, 11:52:30 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/options.h

    r5750 r5752  
    1111class t_options {
    1212 public:
     13  class t_optBias {
     14   public:
     15    t_optBias(char system, t_lc::type tLC) : _system(system), _tLC(tLC) {}
     16    char       _system;
     17    t_lc::type _tLC;
     18  };
     19
    1320  t_options();
    1421  ~t_options();
     
    1724  bool useGlonass();
    1825  bool xyzAprRoverSet();
     26  bool estTropo();
    1927  std::vector<t_lc::type> LCs();
    2028  double maxRes(t_lc::type tLC);
     
    3947  std::vector<t_lc::type> _lcGLONASS;
    4048  std::vector<t_lc::type> _lcGalileo;
     49  std::vector<t_optBias>  _estBias;
    4150
    4251  ColumnVector _xyzAprRover;
  • trunk/BNC/src/PPP/parlist.cpp

    r5743 r5752  
    77#include "parlist.h"
    88#include "satobs.h"
     9
    910#include "station.h"
    10 #include "tropo.h"
    11 #include "iono.h"
    12 #include "utils.h"
    13 #include "genconst.h"
     11#include "bncutils.h"
     12#include "bncconst.h"
     13#include "pppClient.h"
    1414
    1515using namespace BNC;
     
    3333   case crdX:
    3434     _epoSpec = true;
    35      _sigma0  = OPT->sigmaCrd();
     35     _sigma0  = OPT->_sigCrd[0];
    3636     break;
    3737   case crdY:
    3838     _epoSpec = true;
    39      _sigma0  = OPT->sigmaCrd();
     39     _sigma0  = OPT->_sigCrd[1];
    4040     break;
    4141   case crdZ:
    4242     _epoSpec = true;
    43      _sigma0  = OPT->sigmaCrd();
     43     _sigma0  = OPT->_sigCrd[2];
    4444     break;
    4545   case clkR:
     
    5757             offGG = PPP_CLIENT->offGG();
    5858           }
    59            _x0 = nint((obs->obsValue(tLC) - offGG - obs->cmpValue(tLC)) / obs->lambda(tLC));
     59           _x0 = floor((obs->obsValue(tLC) - offGG - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
    6060           break;
    6161         }
     
    7272   case trp:
    7373     _epoSpec = false;
    74      _sigma0  = OPT->sigmaTropo();
    75      _noise   = OPT->noiseTropo();
    76      break;
    77    case iono:
    78      if (OPT->noiseIono() > 0.0) {
    79        _epoSpec = false;
    80      }
    81      else {
    82        _epoSpec = true;
    83      }
    84      _sigma0  = OPT->sigmaIono();
    85      _noise   = OPT->noiseIono();
     74     _sigma0  = OPT->_sigTropo;
     75     _noise   = OPT->_noiseTropo;
    8676     break;
    8777   case bias:
     
    10090//
    10191////////////////////////////////////////////////////////////////////////////
    102 double t_param::partial(const bncTime& epoTime, const t_satObs* obs,
     92double t_param::partial(const bncTime& /* epoTime */, const t_satObs* obs,
    10393                        const t_lc::type& tLC) const {
    10494
     
    144134    return 0.0;
    145135  case trp:
    146     return t_tropo::mf(OPT->tropoMF(), epoTime, sta->ellApr()[0],
    147                        sta->ellApr()[1], sta->ellApr()[2], obs->eleSat());
    148   case iono:
    149     if (obs->prn() == _prn) {
    150       return t_iono::dLCdI(tLC, obs->prn().system(), obs->channel());
    151     }
    152     else {
    153       return 0.0;
    154     }
     136    return 1.0 / sin(obs->eleSat());
    155137  case bias:
    156138    if (tLC == _tLC && obs->prn().system() == _prn.system()) {
     
    191173    ss << "TRP        ";
    192174    break;
    193   case iono:
    194     ss << "IONO " << _prn.toString();
    195     break;
    196175  case bias:
    197176    ss << "BIAS " << _prn.system() << ' ' << left << setw(3) << t_lc::toString(_tLC);
     
    237216    }
    238217
    239     else if (par->type() == t_param::amb || par->type() == t_param::iono) {
     218    else if (par->type() == t_param::amb) {
    240219      if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 3600.0)) {
    241220        remove = true;
     
    298277  // Receiver Biases
    299278  // ---------------
    300   for (unsigned ii = 0; ii < OPT->estBias().size(); ii++) {
    301     const t_options::t_optBias& optBias = OPT->estBias()[ii];
     279  for (unsigned ii = 0; ii < OPT->_estBias.size(); ii++) {
     280    const t_options::t_optBias& optBias = OPT->_estBias[ii];
    302281    required.push_back(new t_param(t_param::bias, t_prn(optBias._system, 1), optBias._tLC));
    303282  }
     
    316295      const t_satObs* satObs = obsVector[jj];
    317296      required.push_back(new t_param(t_param::amb, satObs->prn(), tLC, &obsVector));
    318     }
    319   }
    320 
    321   // Stochastic Ionosphere
    322   //----------------------
    323   if (OPT->estIono()) {
    324     for (unsigned jj = 0; jj < obsVector.size(); jj++) {
    325       const t_satObs* satObs = obsVector[jj];
    326       required.push_back(new t_param(t_param::iono, satObs->prn(), t_lc::dummy));
    327297    }
    328298  }
     
    365335  }
    366336
    367   return t_irc::success;
     337  return success;
    368338}
    369339
     
    398368          << setw(8)  << setprecision(4) << sqrt(QQ[ind][ind]);
    399369      if (par->type() == t_param::amb) {
    400         LOG << " el = " << setw(6) << setprecision(2) << par->ambEleSat() * t_genConst::rho_deg
     370        LOG << " el = " << setw(6) << setprecision(2) << par->ambEleSat() * 180.0 / M_PI
    401371            << " epo = " << setw(4) << par->ambNumEpo();
    402372      }
  • trunk/BNC/src/PPP/parlist.h

    r5743 r5752  
    1414class t_param {
    1515 public:
    16   enum e_type {crdX, crdY, crdZ, clkR, amb, offGG, trp, iono, bias};
     16  enum e_type {crdX, crdY, crdZ, clkR, amb, offGG, trp, bias};
    1717
    1818  t_param(e_type type, const t_prn& prn, t_lc::type tLC,
  • trunk/BNC/src/bncutils.cpp

    r5310 r5752  
    285285}
    286286
     287// Jacobian XYZ --> NEU
     288////////////////////////////////////////////////////////////////////////////
     289void jacobiXYZ_NEU(const double* Ell, Matrix& jacobi) {
     290
     291  Tracer tracer("jacobiXYZ_NEU");
     292
     293  double sinPhi = sin(Ell[0]);
     294  double cosPhi = cos(Ell[0]);
     295  double sinLam = sin(Ell[1]);
     296  double cosLam = cos(Ell[1]);
     297
     298  jacobi(1,1) = - sinPhi * cosLam;
     299  jacobi(1,2) = - sinPhi * sinLam;
     300  jacobi(1,3) =   cosPhi;
     301                           
     302  jacobi(2,1) = - sinLam;       
     303  jacobi(2,2) =   cosLam;
     304  jacobi(2,3) =   0.0;         
     305                           
     306  jacobi(3,1) = cosPhi * cosLam;
     307  jacobi(3,2) = cosPhi * sinLam;
     308  jacobi(3,3) = sinPhi;
     309}
     310
     311// Jacobian Ell --> XYZ
     312////////////////////////////////////////////////////////////////////////////
     313void jacobiEll_XYZ(const double* Ell, Matrix& jacobi) {
     314
     315  Tracer tracer("jacobiEll_XYZ");
     316
     317  double sinPhi = sin(Ell[0]);
     318  double cosPhi = cos(Ell[0]);
     319  double sinLam = sin(Ell[1]);
     320  double cosLam = cos(Ell[1]);
     321  double hh     = Ell[2];
     322
     323  double bell =  t_CST::aell*(1.0-1.0/t_CST::fInv);
     324  double e2   = (t_CST::aell*t_CST::aell-bell*bell)/(t_CST::aell*t_CST::aell) ;
     325  double nn   =  t_CST::aell/sqrt(1.0-e2*sinPhi*sinPhi) ;
     326
     327  jacobi(1,1) = -(nn+hh) * sinPhi * cosLam;
     328  jacobi(1,2) = -(nn+hh) * cosPhi * sinLam;
     329  jacobi(1,3) = cosPhi * cosLam;
     330
     331  jacobi(2,1) = -(nn+hh) * sinPhi * sinLam;
     332  jacobi(2,2) =  (nn+hh) * cosPhi * cosLam;
     333  jacobi(2,3) = cosPhi * sinLam;
     334
     335  jacobi(3,1) = (nn*(1.0-e2)+hh) * cosPhi;
     336  jacobi(3,2) = 0.0;
     337  jacobi(3,3) = sinPhi;
     338}
     339
     340// Covariance Matrix in NEU
     341////////////////////////////////////////////////////////////////////////////
     342void covariXYZ_NEU(const SymmetricMatrix& QQxyz, const double* Ell,
     343                   SymmetricMatrix& Qneu) {
     344
     345  Tracer tracer("covariXYZ_NEU");
     346
     347  Matrix CC(3,3);
     348  jacobiXYZ_NEU(Ell, CC);
     349  Qneu << CC * QQxyz * CC.t();
     350}
     351
     352// Covariance Matrix in XYZ
     353////////////////////////////////////////////////////////////////////////////
     354void covariNEU_XYZ(const SymmetricMatrix& QQneu, const double* Ell,
     355                   SymmetricMatrix& Qxyz) {
     356
     357  Tracer tracer("covariNEU_XYZ");
     358
     359  Matrix CC(3,3);
     360  jacobiXYZ_NEU(Ell, CC);
     361  Qxyz << CC.t() * QQneu * CC;
     362}
     363
    287364// Fourth order Runge-Kutta numerical integrator for ODEs
    288365////////////////////////////////////////////////////////////////////////////
  • trunk/BNC/src/bncutils.h

    r5310 r5752  
    5858void neu2xyz(const double* Ell, const double* neu, double* xyz);
    5959
     60void jacobiXYZ_NEU(const double* Ell, Matrix& jacobi);
     61
     62void jacobiEll_XYZ(const double* Ell, Matrix& jacobi);
     63
     64void covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell,
     65                   SymmetricMatrix& Qneu);
     66
     67void covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell,
     68                   SymmetricMatrix& Qxyz);
     69
    6070ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx,
    6171                         double* acc,
  • trunk/BNC/src/src.pri

    r5745 r5752  
    6161          PPP/pppThread.h PPP/pppClient.h                             \
    6262          PPP/obspool.h PPP/station.h PPP/filter.h PPP/ephpool.h      \
    63           PPP/satobs.h PPP/satbias.h
     63          PPP/satobs.h PPP/satbias.h PPP/parlist.h
    6464
    6565HEADERS       += serial/qextserialbase.h serial/qextserialport.h
     
    9292          PPP/pppThread.cpp PPP/pppClient.cpp                         \
    9393          PPP/obspool.cpp PPP/station.cpp PPP/filter.cpp PPP/ephpool.cpp \
    94           PPP/satobs.cpp PPP/satbias.cpp
     94          PPP/satobs.cpp PPP/satbias.cpp PPP/parlist.cpp
    9595
    9696SOURCES       += serial/qextserialbase.cpp serial/qextserialport.cpp
Note: See TracChangeset for help on using the changeset viewer.