JuliaMath / JuliaMath/Interpolations.jl
Interpolate: BoundsError thrown in the interior
- Dominant language
- Julia
- Stars
- 575
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am using version 1.0.0.
When using Interpolations, I am thrown a BoundsError for an evoluation inside the domain of the grid. I saw there were some already opened issues such as #244) #245 but I could not see the solution error. I would be very grateful if someone could help me. It works for some interior values `(0.2)` or `(0.6898956231658479641)` but not for some others `(0.09697441557910233)` as you can see below - with no clear pattern for me.
Many thanks!
`using Interpolations
D_row = ([0.1, 1.05, 2.0],)
Sb= [0.006167227715362695, 0.03223397506618452, 0.052729713214987387]
Sb_func = interpolate(D_row, Sb, Gridded(Linear()))
Sb_func(0.09697441557910233)`
with error:
`BoundsError: attempt to access 3-element interpolate((::Array{Float64,1},), ::Array{Float64,1}, Gridded(Linear())) with element type Float64 at index [0.09697441557910233]
Stacktrace:
[1] throw_boundserror(::Interpolations.GriddedInterpolation{Float64,1,Float64,Gridded{Linear},Tuple{Array{Float64,1}}}, ::Tuple{Float64}) at .\abstractarray.jl:484
[2] (::Interpolations.GriddedInterpolation{Float64,1,Float64,Gridded{Linear},Tuple{Array{Float64,1}}})(::Float64) at C:\Users\arquie\.julia\packages\Interpolations\gioj0\src\gridded\indexing.jl:3
[3] top-level scope at In[8]:5`
Wherease `Sb_func(0.2)` or `Sb_func(0.6898956231658479641)` works perfectly.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.