Changeset 2582 in ntrip
- Timestamp:
- Aug 29, 2010, 3:45:01 PM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmodel.cpp
r2580 r2582 960 960 QQ << (SS.t() * SS); 961 961 } 962 963 // Phase Wind-Up Correction 964 /////////////////////////////////////////////////////////////////////////// 965 double bncModel::windUp(const QString& prn, const ColumnVector& rSat, 966 const ColumnVector& rRec) { 967 968 double Mjd = _time.mjd() + _time.daysec() / 86400.0; 969 970 // First time - initialize to zero 971 // ------------------------------- 972 if (!_windUpTime.contains(prn)) { 973 _windUpTime[prn] = Mjd; 974 _windUpSum[prn] = 0.0; 975 } 976 977 // Compute the correction for new time 978 // ----------------------------------- 979 else if (_windUpTime[prn] != Mjd) { 980 _windUpTime[prn] = Mjd; 981 982 // Unit Vector GPS Satellite --> Receiver 983 // -------------------------------------- 984 ColumnVector rho = rRec - rSat; 985 rho /= rho.norm_Frobenius(); 986 987 // GPS Satellite unit Vectors sz, sy, sx 988 // ------------------------------------- 989 ColumnVector sz = -rSat / rSat.norm_Frobenius(); 990 991 ColumnVector xSun = Sun(Mjd); 992 xSun /= xSun.norm_Frobenius(); 993 994 ColumnVector sy = crossproduct(sz, xSun); 995 ColumnVector sx = crossproduct(sy, sz); 996 997 // Effective Dipole of the GPS Satellite Antenna 998 // --------------------------------------------- 999 ColumnVector dipSat = sx - rho * DotProduct(rho,sx) 1000 - crossproduct(rho, sy); 1001 1002 // Receiver unit Vectors rx, ry 1003 // ---------------------------- 1004 ColumnVector rx(3); 1005 ColumnVector ry(3); 1006 1007 double recEll[3]; xyz2ell(rRec.data(), recEll) ; 1008 double neu[3]; 1009 1010 neu[0] = 1.0; 1011 neu[1] = 0.0; 1012 neu[2] = 0.0; 1013 neu2xyz(recEll, neu, rx.data()); 1014 1015 neu[0] = 0.0; 1016 neu[1] = -1.0; 1017 neu[2] = 0.0; 1018 neu2xyz(recEll, neu, ry.data()); 1019 1020 // Effective Dipole of the Receiver Antenna 1021 // ---------------------------------------- 1022 ColumnVector dipRec = rx - rho * DotProduct(rho,rx) 1023 + crossproduct(rho, ry); 1024 1025 // Resulting Effect 1026 // ---------------- 1027 double alpha = DotProduct(dipSat,dipRec) / 1028 (dipSat.norm_Frobenius() * dipRec.norm_Frobenius()); 1029 1030 if (alpha > 1.0) alpha = 1.0; 1031 if (alpha < -1.0) alpha = -1.0; 1032 1033 double dphi = acos(alpha) / 2.0 / M_PI; // in cycles 1034 1035 if ( DotProduct(rho, crossproduct(dipSat, dipRec)) < 0.0 ) { 1036 dphi = -dphi; 1037 } 1038 1039 _windUpSum[prn] = floor(_windUpSum[prn] - dphi + 0.5) + dphi; 1040 } 1041 1042 return _windUpSum[prn]; 1043 } -
trunk/BNC/bncmodel.h
r2283 r2582 92 92 SymmetricMatrix& QQ, ColumnVector& dx); 93 93 94 bncTime _time; 95 QByteArray _staID; 96 QVector<bncParam*> _params; 97 SymmetricMatrix _QQ; 98 ColumnVector _xcBanc; 99 ColumnVector _ellBanc; 100 bool _static; 101 bool _usePhase; 102 bool _estTropo; 103 QByteArray _log; 104 QFile* _nmeaFile; 105 QTextStream* _nmeaStream; 106 bool _useGlonass; 94 double windUp(const QString& prn, const ColumnVector& rSat, 95 const ColumnVector& rRec); 96 97 bncTime _time; 98 QByteArray _staID; 99 QVector<bncParam*> _params; 100 SymmetricMatrix _QQ; 101 ColumnVector _xcBanc; 102 ColumnVector _ellBanc; 103 bool _static; 104 bool _usePhase; 105 bool _estTropo; 106 QByteArray _log; 107 QFile* _nmeaFile; 108 QTextStream* _nmeaStream; 109 bool _useGlonass; 110 QMap<QString, double> _windUpTime; 111 QMap<QString, double> _windUpSum; 107 112 }; 108 113 -
trunk/BNC/bnctides.h
r2579 r2582 5 5 #include "bnctime.h" 6 6 7 void tides(const bncTime& time, ColumnVector& xyz); 7 ColumnVector Sun(double Mjd_TT); 8 9 void tides(const bncTime& time, ColumnVector& xyz); 8 10 9 11 #endif -
trunk/BNC/bncutils.cpp
r2556 r2582 249 249 } 250 250 251 // North, East, Up Components -> Rectangular Coordinates 252 //////////////////////////////////////////////////////////////////////////// 253 void neu2xyz(const double* Ell, const double* neu, double* xyz) { 254 255 double sinPhi = sin(Ell[0]); 256 double cosPhi = cos(Ell[0]); 257 double sinLam = sin(Ell[1]); 258 double cosLam = cos(Ell[1]); 259 260 xyz[0] = - sinPhi*cosLam * neu[0] 261 - sinLam * neu[1] 262 + cosPhi*cosLam * neu[2]; 263 264 xyz[1] = - sinPhi*sinLam * neu[0] 265 + cosLam * neu[1] 266 + cosPhi*sinLam * neu[2]; 267 268 xyz[2] = + cosPhi * neu[0] 269 + sinPhi * neu[2]; 270 } 271 251 272 // Fourth order Runge-Kutta numerical integrator for ODEs 252 273 //////////////////////////////////////////////////////////////////////////// -
trunk/BNC/bncutils.h
r2556 r2582 51 51 void xyz2neu(const double* Ell, const double* xyz, double* neu); 52 52 53 void neu2xyz(const double* Ell, const double* neu, double* xyz); 54 53 55 ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, 54 56 double* acc,
Note:
See TracChangeset
for help on using the changeset viewer.