1

If have the same issue as described in the previous question:

Speedup scipy griddata for multiple interpolations between two irregular grids .

I have a non-changing mesh with changing values. Each time step I want to interpolate the values using griddata.

However, it appears to be slow. So the question is, if, to save computation, one can make use of the fact that the grid is not changing.

I like the answer by Jaime, but I was wondering how the interpolate function would look like for cubic interpolation?

Felix Schneider
  • 146
  • 2
  • 7
  • 1
    It seems that `griddata` now [can take a Delaunay triangulation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html) rather than a list of points. Creating the triangulation is likely what takes up the most time in each call, so avoiding that should already speed up things considerably. Reproducing the cubic interpolation schemes appears to be a **very** involved task, given the amount of Cython code implementing it, see [here](https://github.com/scipy/scipy/blob/v1.1.0/scipy/interpolate/interpnd.pyx#L780) if you are feeling adventurous... Good luck! – Jaime Oct 25 '18 at 12:05
  • In the griddata [documentation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html) I cannot find any hint on passing a Delaunay triangulation. However the function CloughTocher2DInterpolator seems to accept it. However, I do not find any information on the format in which I should pass the Delaunay triangulation to griddata / or CloughTocher2DInterpolator. – Felix Schneider Oct 25 '18 at 14:45

0 Answers0