JuliaAstro / AstroTime.jl

Astronomical time keeping in Julia
https://juliaastro.github.io/AstroTime.jl/stable/
Other
39 stars 10 forks source link

porting utctai #34

Closed prakharcode closed 6 years ago

prakharcode commented 6 years ago

The function is straightforward to implement. Leapseconds makes it quite easier.

Regarding this test leap = UTCEpoch(2016, 12, 31, 23, 59, 60). I'm a bit unsure, here's what I think, should I subtract the drift from the seconds part because 60 is going out of range. @helgee

helgee commented 6 years ago

60 is not out of range. When a leap second is applied the preceding minute is by definition one second longer: https://en.wikipedia.org/wiki/Leap_second

helgee commented 6 years ago

A UTC clock would read:

prakharcode commented 6 years ago

I figured I would need to submit a PR for dtf2d before utctai. Since it correctly converts the leapseconds. The remote kernel file also provides the instruction:

DELTA_AT is always an integral number of seconds. The value of DELTA_AT was 10 seconds in January 1972, and increases by one each time a leap second is declared.

should I propose for 'dtf2d` first?

helgee commented 6 years ago

should I propose for 'dtf2d` first?

Yes, you are correct. We will need that function first.