Hi,

Is there any package in Julia for interpolating a 3d grid of datapoints (a typical cloud of non-regularly spaced datapoints)? I need it for plotting purposes only and I do not have a specific algorithm in mind.

Thanks!

Hi,

Is there any package in Julia for interpolating a 3d grid of datapoints (a typical cloud of non-regularly spaced datapoints)? I need it for plotting purposes only and I do not have a specific algorithm in mind.

Thanks!

1 Like

There are several packages, e.g. GitHub - SciML/Surrogates.jl: Surrogate modeling and optimization for scientific machine learning (SciML), GitHub - markmbaum/BasicInterpolators.jl: Basic (+chebyshev) interpolation recipes in Julia, GitHub - RJDennis/ChebyshevApprox.jl: Julia code to approximate continuous functions using Chebyshev polynomials, GitHub - stevengj/FastChebInterp.jl: fast multidimensional Chebyshev interpolation and regression in Julia … most of these do some kind of fit, however, and do not guarantee the fit will go exactly through your original data points (unless they lie at special points, e.g. Chebyshev nodes)

If you want exact interpolation from an arbitrary set of points in 3d, one typically first forms a Delaunay triangularization (tetrahedralization in 3d) of your points, and then does (e.g.) linear interpolation within each simplex (tetrahedron). There are Julia packages for Delaunay triangulation, but I don’t know whether the whole interpolation pipeline is available. You could always call `scipy.interpolate.LinearNDInterpolator`

from Julia via PyCall, however.

(What is the source of your data points?)

2 Likes

How irregular and what kind of interpolation did you have in mind?

Thank you both. I am not a domain expert and thus I really have no preferences on the interpolation method to use for this graphical representation. The (x,y) coordinates are drawn at random (uniformly) and the z coordinate is a function of x and y.

Could you show how the input data looks like or just share a representative portion of it?

Besides what stevengj mentioned above, you may also be interested in

2 Likes

Thank you, it looks quite intuitive. I will definitely take a look. I have also seen several applications of regression trees for spatial interpolation, so I might try that as well and see what happens. Unfortunately I cannot share the data in this instance.

I managed to get the results that I wanted gridding the data via bagging (bootstrap aggregating) and plotting it with PGFPlotsX as a filled contour. I will post some code on my GitHub page for those who are interested!

1 Like