Open fredrikpaues opened 2 years ago
Would this work?
julia> itp = LinearInterpolation([1, 2 - eps(2.0), 2, 3], [Inf, 1.0, 1.0, 0.5], extrapolation_bc=Line())
4-element extrapolate(interpolate((::Vector{Float64},), ::Vector{Float64}, Gridded(Linear())), Line()) with element type Float64:
Inf
NaN
1.0
0.5
julia> itp(2)
1.0
Good idea! That ought to work. Thanks!
Cross-referencing https://github.com/JuliaMath/Interpolations.jl/issues/459
I have been frustrated by the code below returning NaN---presumably as the first two nodes (
[Inf, 1.0]
) are used to interpolate the queried value (2
). Is there some way to change which nodes are used when querying a value on the grid?