3D extrapolation in python (basically scipy.griddata extrapolates)

I use the griddata function in scipy to interpolate three-dimensional and four-dimensional data. He works like a champion, except that he returns the NaN group because some of the points I need are outside the range of the input. Given that Nd data only works with linear mode interpolation, this should be tied to griddata extrapolating instead of just returning NaN. Has anyone done this or found a workaround? To clarify: I have unstructured data, so I can not use any functions that require a regular grid. Thank you Alex

+6
source share
1 answer

Not quite sure if this will work for you, and it is not yet available, but there is a "pad" array function in the version for creating numpy ...

https://github.com/numpy/numpy/blob/master/numpy/lib/arraypad.py

One option is "linear_ramp", which extrapolates (gaskets) outward, starting from the edge value and linearly increasing / decreasing to the specified final value.

This is a pure python function, so you can just copy it into your path and import (untested by me though)

-1
source

Source: https://habr.com/ru/post/919065/


All Articles