Ticket #40114: patch-UTCTime.cpp.diff
File patch-UTCTime.cpp.diff, 1.5 KB (added by venabled@…, 11 years ago) |
---|
-
lib/geodyn/UTCTime.cpp
old new 364 364 // GPS time to UTC time 365 365 // @param gpst GPST as input 366 366 // @param utc UTC as output 367 void GPST2UTC(const UTCTime& gpst, UTCTime& utc)367 void GPST2UTC(const CommonTime& gpst, UTCTime& utc) 368 368 { 369 UTCTime T; 370 371 double mjdGPST = static_cast<Epoch>(gpst).MJD(); 372 double mjdTAI = mjdGPST+ UTCTime::TAI_GPS/UTCTime::DAY_TO_SECOND; 373 374 // input should be utc 375 double dtu = IERS::TAImUTC(mjdTAI); 376 double mjdUTC = mjdTAI - dtu / UTCTime::DAY_TO_SECOND; 377 378 dtu = IERS::TAImUTC(mjdUTC); 379 mjdUTC = mjdTAI - dtu / UTCTime::DAY_TO_SECOND; 380 381 utc = gpst; // GPST 382 utc += UTCTime::TAI_GPS; // TAI 383 utc += -IERS::TAImUTC(mjdUTC); // UTC 384 369 CommonTime gps_ct = gpst; 370 utc = UTCTime(gps_ct); // utc 385 371 } 372 386 373 // UTC time to GPS time 387 374 // @param utc UTC as input 388 375 // @param gpst GPST as output … … 422 409 // TT time to UTC time 423 410 // @param tt TT as input 424 411 // @param utc UTC as output 425 void TT2UTC(const CommonTime& tt, CommonTime& utc)412 void TT2UTC(const CommonTime& tt, UTCTime& utc) 426 413 { 427 414 UTCTime T(static_cast<YDSTime>(tt).year,static_cast<YDSTime>(tt).doy,static_cast<YDSTime>(tt).sod); 428 415