Skip to content Skip to sidebar Skip to footer

2d Interpolation Over List Of Points Python

I have an interpolation problem. It should not be too complicated, but I can't find any valid solution. I am working on a 2D wing section, I know the pressure (a scalar) on each p

Solution 1:

It sounds like what's happening is the interp2d function thinks you're pasing it a regular grid. From the numpy Docs:

> Arrays defining the data point coordinates. If the points lie on a regular grid, x can specify the column coordinates and y the row coordinates, for example:

x, y : array_like x = [0,1,2]; y = [0,3]; z = [[1,2,3], [4,5,6]] Otherwise, x and y must specify the full coordinates for each point, for example:

x = [0,1,2,0,1,2]; y = [0,0,0,3,3,3]; z = [1,2,3,4,5,6] If x and y are multi-dimensional, they are flattened before use.

z : array_like The values of the function to interpolate at the data points. If z is a multi-dimensional array, it is flattened before use. The length of a flattened z array is either len(x)*len(y) if x and y specify the column and row coordinates or len(z) == len(x) == len(y) if x and y specify coordinates for each point.

It sounds like you need to force x and y to be explicit to the full coordinates

Post a Comment for "2d Interpolation Over List Of Points Python"