Changeset 3371 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 03/01/04 15:33:06 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MTime.cc
r3148 r3371 317 317 return kTRUE; 318 318 319 } 320 321 // -------------------------------------------------------------------------- 322 // 323 // Conversion from Universal Time to Greenwich mean sidereal time, 324 // with rounding errors minimized. 325 // 326 // The result is the Greenwich Mean Sidereal Time (radians) 327 // 328 // There is no restriction on how the UT is apportioned between the 329 // date and ut1 arguments. Either of the two arguments could, for 330 // example, be zero and the entire date+time supplied in the other. 331 // However, the routine is designed to deliver maximum accuracy when 332 // the date argument is a whole number and the ut argument lies in 333 // the range 0 to 1, or vice versa. 334 // 335 // The algorithm is based on the IAU 1982 expression (see page S15 of 336 // the 1984 Astronomical Almanac). This is always described as giving 337 // the GMST at 0 hours UT1. In fact, it gives the difference between 338 // the GMST and the UT, the steady 4-minutes-per-day drawing-ahead of 339 // ST with respect to UT. When whole days are ignored, the expression 340 // happens to equal the GMST at 0 hours UT1 each day. 341 // 342 // In this routine, the entire UT1 (the sum of the two arguments date 343 // and ut) is used directly as the argument for the standard formula. 344 // The UT1 is then added, but omitting whole days to conserve accuracy. 345 // 346 // The extra numerical precision delivered by the present routine is 347 // unlikely to be important in an absolute sense, but may be useful 348 // when critically comparing algorithms and in applications where two 349 // sidereal times close together are differenced. 350 // 351 Double_t MTime::GetGmst() const 352 { 353 const Double_t ut = (Double_t)(fNanoSec/1e6+(Long_t)fTime)/kDay; 354 355 // Julian centuries since J2000. 356 const Double_t t = (ut -(51544.5-fMjd)) / 36525.0; 357 358 // GMST at this UT1 359 const Double_t r1 = 24110.54841+(8640184.812866+(0.093104-6.2e-6*t)*t)*t; 360 const Double_t r2 = 86400.0*ut; 361 362 const Double_t sum = (r1+r2)/(24*3600); 363 364 return fmod(sum, 1)*TMath::TwoPi()+TMath::TwoPi(); 319 365 } 320 366 -
trunk/MagicSoft/Mars/mbase/MTime.h
r3148 r3371 56 56 Set(tm); 57 57 } 58 MTime(Double_t d);58 MTime(Double_t mjd); 59 59 MTime(const MTime& t) : fMjd(t.fMjd), fTime(t.fTime), fNanoSec(t.fNanoSec) 60 60 { … … 85 85 void SetMjd(Double_t m); 86 86 Double_t GetMjd() const; 87 Double_t GetGmst() const; 87 88 TString GetString() const; 88 89 TString GetStringFmt(const char *fmt=0) const;
Note:
See TracChangeset
for help on using the changeset viewer.