Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAI-to-UTC transformation prior to 1972 #21

Closed
MicheleCeresoli opened this issue Jan 4, 2024 · 1 comment
Closed

TAI-to-UTC transformation prior to 1972 #21

MicheleCeresoli opened this issue Jan 4, 2024 · 1 comment
Assignees
Labels
bug Something isn't working update A feature or routine that has to be updated.

Comments

@MicheleCeresoli
Copy link
Member

The UTC timescale is officially defined starting on 1 January 1960. As discussed in skyfielders/python-skyfield#679, prior to the introduction of leapseconds on 1 January 1972, the relationship between TAI and UTC is governed by linear offsets, which are reported in:

https://hpiers.obspm.fr/eop-pc/index.php?index=TAI-UTC_tab&lang=en

At the moment, if someone attempts to convert from TAI to UTC or viceversa prior to 1972 the following error is thrown:

julia> ep = Epoch("1961-01-01T12:00:00 UTC")
1961-01-01T12:00:00.0000 UTC

julia> convert(TAI, ep)
ERROR: EpochConversionError: cannot convert Epoch from the timescale CoordinatedUniversalTime to InternationalAtomicTime.

Stacktrace:
 [1] convert(to::InternationalAtomicTime, e::Epoch{CoordinatedUniversalTime, Float64}; system::TimeSystem{Float64})
   @ Tempo ~/.julia/packages/Tempo/Ba1ZM/src/epoch.jl:233
 [2] convert(to::InternationalAtomicTime, e::Epoch{CoordinatedUniversalTime, Float64})
   @ Tempo ~/.julia/packages/Tempo/Ba1ZM/src/epoch.jl:225
 [3] top-level scope
   @ REPL[9]:1

caused by: BoundsError: attempt to access 28-element Vector{Float64} at index [0]

The proposal is to implement within the tai2utc conversion, the linear offsets from 1961 to 1972. On the other hand, when attempting the UTC-to-TAI conversion prior to 1961, either a null offset (with a warning) or an error should be returned.

@MicheleCeresoli MicheleCeresoli added bug Something isn't working update A feature or routine that has to be updated. labels Jan 4, 2024
@MicheleCeresoli MicheleCeresoli self-assigned this Jan 4, 2024
@andreapasquale94
Copy link
Member

Agreed not to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working update A feature or routine that has to be updated.
Projects
None yet
Development

No branches or pull requests

2 participants