Changeset 5752 in ntrip for trunk/BNC/src/bncutils.cpp


Ignore:
Timestamp:
Aug 3, 2014, 11:52:30 AM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.