- Timestamp:
- Apr 9, 2008, 12:50:05 PM (17 years ago)
- Location:
- trunk/BNS
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/bns.cpp
r803 r804 240 240 vv(1), vv(2), vv(3)); 241 241 242 ColumnVector dx = xx - xB; 243 dx(4) *= 299792458.0; 242 ColumnVector dx = xx.Rows(1,3) - xB.Rows(1,3); 243 double dClk = (xx(4) - xB(4)) * 299792458.0; 244 ColumnVector rsw(3); 245 246 XYZ_to_RSW(xB, vv, dx, rsw); 244 247 245 248 cout.setf(ios::showpoint | ios::fixed); 246 249 cout << GPSweek << " " 247 250 << setprecision(1) << GPSweeks << " " << ep->prn.toAscii().data() 248 << setw(8) << setprecision(3) << dx.t(); 249 } 251 << setw(8) << setprecision(3) << dClk 252 << setw(8) << setprecision(3) << rsw.t(); 253 } -
trunk/BNS/bns.pro
r784 r804 2 2 # Switch to debug configuration 3 3 # ----------------------------- 4 CONFIG -= release5 CONFIG += debug4 ### CONFIG -= release 5 ### CONFIG += debug 6 6 7 7 RESOURCES += bns.qrc -
trunk/BNS/bnsutils.cpp
r802 r804 94 94 } 95 95 96 // 96 // Satellite Position computed using broadcast ephemeris 97 97 //////////////////////////////////////////////////////////////////////////// 98 void satellitePosition( double GPSweeks, const gpsEph* ep,98 void satellitePosition(int GPSweek, double GPSweeks, const gpsEph* ep, 99 99 double& X, double& Y, double& Z, double& dt, 100 100 double& vX, double& vY, double& vZ) { 101 101 102 const static double secPerWeek = 7 * 86400.0; 102 103 const static double omegaEarth = 7292115.1467e-11; 103 104 const static double gmWGS = 398.6005e12; … … 112 113 double n0 = sqrt(gmWGS/(a0*a0*a0)); 113 114 double tk = GPSweeks - ep->TOE; 115 if (GPSweek != ep->GPSweek) { 116 tk += (GPSweek - ep->GPSweek) * secPerWeek; 117 } 114 118 double n = n0 + ep->Delta_n; 115 119 double M = ep->M0 + n*tk; … … 141 145 142 146 double tc = GPSweeks - ep->TOC; 147 if (GPSweek != ep->GPSweek) { 148 tc += (GPSweek - ep->GPSweek) * secPerWeek; 149 } 143 150 dt = ep->clock_bias + ep->clock_drift*tc + ep->clock_driftrate*tc*tc 144 151 - 4.442807633e-10 * ep->e * sqrt(a0) *sin(E); … … 168 175 vZ = sini *doty + yp*cosi *doti; 169 176 } 177 178 // Transformation xyz --> radial, along track, out-of-plane 179 //////////////////////////////////////////////////////////////////////////// 180 void XYZ_to_RSW(const ColumnVector& rr, const ColumnVector& vv, 181 const ColumnVector& xyz, ColumnVector& rsw) { 182 183 ColumnVector cross = crossproduct(rr, vv); 184 185 rsw.ReSize(3); 186 rsw(1) = DotProduct(xyz, rr) / rr.norm_Frobenius(); 187 rsw(2) = DotProduct(xyz, vv) / vv.norm_Frobenius(); 188 rsw(3) = DotProduct(xyz, cross) / cross.norm_Frobenius(); 189 } -
trunk/BNS/bnsutils.h
r802 r804 2 2 #ifndef BNSUTILS_H 3 3 #define BNSUTILS_H 4 5 #include <newmat.h> 4 6 5 7 #include <QString> … … 17 19 void currentGPSWeeks(int& week, double& sec); 18 20 19 void satellitePosition( double GPSweeks, const gpsEph* ep,21 void satellitePosition(int GPSweek, double GPSweeks, const gpsEph* ep, 20 22 double& X, double& Y, double& Z, double&, 21 23 double& vX, double& vY, double& vZ); 24 25 void XYZ_to_RSW(const ColumnVector& rr, const ColumnVector& vv, 26 const ColumnVector& xyz, ColumnVector& rsw); 22 27 #endif
Note:
See TracChangeset
for help on using the changeset viewer.