Skip to content

Commit

Permalink
Improve inference
Browse files Browse the repository at this point in the history
Improve OrbitalData inference
  • Loading branch information
charleskawczynski committed Sep 11, 2024
1 parent cc49082 commit 180b1bd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Insolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ end

function OrbitalData()
datapath = joinpath(artifact"laskar2004", "INSOL.LA2004.BTL.csv")
x, _ = readdlm(datapath, ',', Float64, header = true)
t_range = (x[1, 1] * 1e3):1e3:(x[end, 1] * 1e3) # array of every 1 kyr to range of years
# We add type annotations here to fix some inference failures.
Tx = Tuple{Matrix{Float64}, Matrix{AbstractString}}
x, _ = readdlm(datapath, ',', Float64, header = true)::Tx
t_range = ((x[1, 1] * 1000):1000:(x[end, 1] * 1000)) # array of every 1 kyr to range of years
e_spline_etp =
cubic_spline_interpolation(t_range, x[:, 2], extrapolation_bc = NaN)
cubic_spline_interpolation(t_range, x[:, 2]; extrapolation_bc = NaN)
γ_spline_etp =
cubic_spline_interpolation(t_range, x[:, 3], extrapolation_bc = NaN)
cubic_spline_interpolation(t_range, x[:, 3]; extrapolation_bc = NaN)
ϖ_spline_etp =
cubic_spline_interpolation(t_range, x[:, 4], extrapolation_bc = NaN)
cubic_spline_interpolation(t_range, x[:, 4]; extrapolation_bc = NaN)

E = typeof(e_spline_etp)
G = typeof(γ_spline_etp)
Expand Down

0 comments on commit 180b1bd

Please sign in to comment.