Skip to content

Commit

Permalink
Added EOP interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
MicheleCeresoli committed Jan 5, 2024
1 parent 2272c97 commit 61813c8
Showing 1 changed file with 55 additions and 48 deletions.
103 changes: 55 additions & 48 deletions src/eop/retrieval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@
Interpolate and retrieve the EOP nutation correction in longitude `δΔψ`, in radians,
at time `t` expressed in `TT` Julian centuries since J2000 for the IERS convention `m`.
"""
function eop_δΔψ(m::IERSAModels, t::Number)
# TODO: complete me
return 0
function eop_δΔψ(::IERS2010A, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut2010.δΔψ, t)
end

function eop_δΔψ(m::IERS1996, t::Number)
# TODO complete me
return 0
function eop_δΔψ(::IERS2003A, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut2003.δΔψ, t)
end

function eop_δΔψ(::IERS1996, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut1996.δΔψ, t)
end

eop_δΔψ(::IERSModel, ::Number) = 0
Expand All @@ -24,14 +29,19 @@ eop_δΔψ(::IERSModel, ::Number) = 0
Interpolate and retrieve the EOP nutation correction in obliquity `δΔϵ`, in radians,
at time `t` expressed in `TT` Julian centuries since J2000 for the IERS convention `m`.
"""
function eop_δΔϵ(m::IERSAModels, t::Number)
# TODO: complete me
return 0
function eop_δΔϵ(::IERS2010A, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut2010.δΔϵ, t)
end

function eop_δΔϵ(::IERS2003A, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut2003.δΔϵ, t)
end

function eop_δΔϵ(m::IERS1996, t::Number)
# TODO complete me
return 0
function eop_δΔϵ(::IERS1996, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut1996.δΔϵ, t)
end

eop_δΔϵ(::IERSModel, ::Number) = 0
Expand All @@ -43,14 +53,19 @@ eop_δΔϵ(::IERSModel, ::Number) = 0
Interpolate and retrieve the CIP `δX` correction, in radians, at time `t` expressed in
`TT` Julian centuries since J2000 for the IERS convention `m`.
"""
function eop_δX(m::IERSAModels, t::Number)
# TODO: complete me
return 0
function eop_δX(::IERS2010A, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut2010.δX, t)
end

function eop_δX(m::IERS1996, t::Number)
# TODO complete me
return 0
function eop_δX(::IERS2003A, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut2003.δX, t)
end

function eop_δX(::IERS1996, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut1996.δX, t)
end

eop_δX(::IERSModel, ::Number) = 0
Expand All @@ -62,14 +77,19 @@ eop_δX(::IERSModel, ::Number) = 0
Interpolate and retrieve the CIP `δY` correction, in radians, at time `t` expressed in
`TT` Julian centuries since J2000 for the IERS convention `m`.
"""
function eop_δY(m::IERSAModels, t::Number)
# TODO: complete me
return 0
function eop_δY(::IERS2010A, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut2010.δY, t)
end

function eop_δY(::IERS2003A, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut2003.δY, t)
end

function eop_δY(m::IERS1996, t::Number)
# TODO complete me
return 0
function eop_δY(::IERS1996, t::Number)
eop_check_init()
return interpolate(IERS_EOP.nut1996.δY, t)
end

eop_δY(::IERSModel, ::Number) = 0
Expand All @@ -81,9 +101,9 @@ eop_δY(::IERSModel, ::Number) = 0
Interpolate and retrieve the pole `xₚ` coordinate, in radians, at time `t` expressed in
`TT` Julian centuries since J2000 for the IERS convention `m`.
"""
function eop_xp(m::IERSModel, t::Number)
# TODO: complete me
return 0
function eop_xp(::IERSModel, t::Number)
eop_check_init()
return interpolate(IERS_EOP.xp, t)
end

eop_xp(::CPND, ::Number) = 0
Expand All @@ -95,35 +115,22 @@ eop_xp(::CPND, ::Number) = 0
Interpolate and retrieve the pole `yₚ` coordinate, in radians, at time `t` expressed in
`TT` Julian centuries since J2000 for the IERS convention `m`.
"""
function eop_yp(m::IERSModel, t::Number)
# TODO: complete me
return 0
function eop_yp(::IERSModel, t::Number)
eop_check_init()
return interpolate(IERS_EOP.yp, t)
end

eop_yp(::CPND, ::Number) = 0


"""
eop_Δut1(t::Number)
offset_tt2ut1(t::Number)
Interpolate and retrieve the `ΔUT1` value, in seconds, at time `t` expressed in `TT` Julian
centuries since J2000, for the IERS convention `m`.
Return the TT-to-UT1 offset, in seconds, at `t` expressed in TT seconds since J2000.
"""
function eop_Δut1(t::Number)
return 0
end


function offset_tt2ut1(seconds)

# Retrieve Leapseconds
dAT = Tempo.offset_tai2utc(seconds - 32.184)

# Retrieve ΔUT1
dUT1 = eop_Δut1(seconds/Tempo.CENTURY2SEC)

return dUT1 + dAT - 32.184

function offset_tt2ut1(t)
eop_check_init()
return interpolate(IERS_EOP.ut1_tt, t/Tempo.CENTURY2SEC)
end


0 comments on commit 61813c8

Please sign in to comment.