From 4b284c783bfd55b4dc9a4ce8020111350370688b Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Tue, 10 Sep 2024 13:55:24 -0400 Subject: [PATCH] Improve inference Improve OrbitalData inference --- src/Insolation.jl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Insolation.jl b/src/Insolation.jl index 1a14c3c..cb16efe 100644 --- a/src/Insolation.jl +++ b/src/Insolation.jl @@ -28,14 +28,21 @@ 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 + Tx = Tuple{Matrix{Float64}, Matrix{AbstractString}} + x, _ = readdlm(datapath, ',', Float64, header = true)::Tx + T = StepRangeLen{ + Float64, + Base.TwicePrecision{Float64}, + Base.TwicePrecision{Float64}, + Int, + } + t_range = ((x[1, 1] * 1e3):1e3:(x[end, 1] * 1e3))::T # 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)