Interpolations.jl icon indicating copy to clipboard operation
Interpolations.jl copied to clipboard

Documentation: what exactly is meant by "irregular grid"?

Open scheidan opened this issue 3 years ago • 1 comments

Maybe this is just a problem of wording

The Readme and the documentation tells me that "Currently this package supports [...] irregular grids." I interpreted this (wrongly as it turns out) that I can interpolate points arbitrarily scattered. It seems I'm not alone with this: this issue #552 clarifies that "irregular" means "rectilinear", and not arbitrary irregular.

Writing explicitly: "Currently this package supports interpolation on Cartesian and rectilinear grids" would have helped a lot.

For reference: Wikipedia for Regular grids Wikipedia for Unstructured grid or irregular grid

scheidan avatar Jul 20 '23 10:07 scheidan

Unclear to me what is supported. On v0.14.7 this happens:

julia> cubic_spline_interpolation([1,2,5],[4,2,4])
ERROR: MethodError: no method matching cubic_spline_interpolation(::Vector{Int64}, ::Vector{Int64})

Closest candidates are:
  cubic_spline_interpolation(::AbstractRange, ::AbstractVector; bc, extrapolation_bc)
   @ Interpolations ~/.julia/packages/Interpolations/nDwIa/src/convenience-constructors.jl:12
  cubic_spline_interpolation(::Tuple{Vararg{AbstractRange, N}}, ::AbstractArray{T, N}; bc, extrapolation_bc) where {N, T}
   @ Interpolations ~/.julia/packages/Interpolations/nDwIa/src/convenience-constructors.jl:29

Stacktrace:
 [1] top-level scope
   @ REPL[17]:1

julia> linear_interpolation([1,2,5],[4,2,4])
3-element extrapolate(interpolate((::Vector{Int64},), ::Vector{Int64}, Gridded(Linear())), Throw()) with element type Float64:
 Ratios.SimpleRatio{Int64}(4, 1)
 Ratios.SimpleRatio{Int64}(2, 1)
 Ratios.SimpleRatio{Int64}(12, 3)

sob727 avatar Aug 04 '23 11:08 sob727