Hi all,
I’m in need of the equivalent of LinearNDInterpolator
in scipy for julia, in order to do interpolation of irregularly sampled points (not on a grid). There are existing packages such as NaturalNeighbours.jl, but any implementation I’ve seen only works on 2d data so was trying to do my own. Posting here in case someone already has experience with something similar and can share some tips (or perhaps point me to an existing implementation I’ve missed).
Idea is to do a Delaunay triangulation in arbitrary dimensions and then apply barycentric interpolation, same as the scipy function linked above. To do this the complex parts are:
- Constructing the Delaunay triangulation in arbitrary dimensions
- For a given point efficiently finding the vertices of the “triangle” that contains it.
After that the barycentric interpolation is a straightforward step. The first part can be quickly achieved with the Quickhull.jl
package:
using Quickhull
npoints = 1000
points = randn(3,npoints)
tri = delaunay(points)
facets(tri)
But from this point forward I end up being stuck in terms of existing packages. I could go ahead and try to implement the rest, but I feel I might just be missing existing (and efficiently implemented) ways to achieve the remaining step of finding the vertices for the triangle surrounding a given point.
Thanks in advance for any help!