Confusion on Creating Gridded Interpolations

So, just to clarify the wording here; there is no “how interpolations work in julia”. It’s how they work in whatever package you happen to try here.
And secondly, you do not have a grid. It seems you would like to construct such a grid by interpolating from a set of scattered observations, but this is the output, not the input.

So, I would suggest you start by interpolate the value at a single coordinate. When you have this, you can then proceed to do so 25000 times to fill up your desired grid.

  1. So as far as I can tell, you want exactly ScatteredInterpolations.jl
  2. Construct the interpolation object using only observations in the format Home · ScatteredInterpolation.jl At this point, you have only used the 2x31 known data points.
  3. Finally, constructing the output, which in your case you seem to want a grid. So then evaluate this interpolation object however you want. You want a grid? well first decide on your evaluated_xs and evaluated_ys (presumably n and m in length) and then just compute your interpolation for the n*m points.
using ScatteredInterpolation

xs = [187.0, 313.0, 157.0, 343.0, 132.0, 368.0, 157.0, 343.0, 187.0, 313.0, 85.0, 415.0, 46.0, 454.0, 85.0, 415.0, 250.0, 250.0, 57.0, 443.0, 129.0, 371.0, 164.0, 336.0, 250.0, 250.0, 250.0, 180.0, 320.0, 118.0, 382.0]
ys = [57.0, 57.0, 134.0, 134.0, 250.0, 250.0, 366.0, 366.0, 443.0, 443.0, 129.0, 129.0, 250.0, 250.0, 371.0, 371.0, 132.0, 368.0, 313.0, 313.0, 415.0, 415.0, 403.0, 403.0, 417.0, 454.0, 475.0, 466.0, 466.0, 433.0, 433.0] 
samples = [-19.995152, -46.38638, -28.329832, 81.12224, -67.002556, 21.798035, 32.538525, 38.022156, -14.682513, -56.849937, -20.680933, 95.41259, 22.357513, 36.404854, -37.628937, -3.4352758, -25.271269, 36.05853, 26.666668, -29.088951, -7.4670925, -47.769047, -29.178823, -43.958958, 29.638771, -10.448129, 5.71033, -25.612432, 37.268364, -22.657557, -2.0058606]

points = hcat(xs, ys)'

itp = interpolate(Multiquadratic(), points, samples)
interpolated = evaluate(itp, [186.0, 60.0]) # evaluate it for how ever many coordinates that you want
5 Likes