Skip to content

Commit

Permalink
Better UT1
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Aug 15, 2018
1 parent 07aff95 commit ef49c84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/offsets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ tai_offset(::GeocentricCoordinateTime, ep) = tai_offset(TT, ep) + LG_RATE * get(
tai_offset(::BarycentricCoordinateTime, ep) = tai_offset(TDB, ep) + LB_RATE * get(ep - EPOCH_77)

function tai_offset(::UniversalTime, ep)
# FIXME: This is not correct
tai_offset(UTC, ep) + getΔUT1(julian(ep))
jd = get(days(ep - UTCEpoch(AstroDates.JULIAN_EPOCH, AstroDates.H12)))
tai_offset(UTC, ep) + getΔUT1(jd)
end

function tai_offset(::CoordinatedUniversalTime, ep)
Expand Down
3 changes: 2 additions & 1 deletion test/epochs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
@test utc.epoch == 587513008
@test utc.offset == 0.5512474363782758
@test ut1.epoch == 587513008
@test_broken ut1.offset == 0.47200339587608653
# EarthOrientation.jl uses a different interpolation scheme than Orekit
@test ut1.offset 0.48504859616502927 atol=1e-6
@test tdb.epoch == 587512939
@test tdb.offset 0.3682890196414874 atol=1e-14
@test tcb.epoch == 587512919
Expand Down

0 comments on commit ef49c84

Please sign in to comment.