# [SciPy-Dev] Problem with N-dimensional interpolation using a new griddata function for N>=3

Pauli Virtanen pav@iki...
Tue Sep 21 07:03:46 CDT 2010

```Tue, 21 Sep 2010 13:54:45 +0200, Adam Machnik wrote:
> working in N-D
> with irregular grids (scipy v0.9.0dev6812). It works great for 2D
> problems. However for 3D (and more) I have a problem: the NaN values
> appears always in the same position, and it does not depend on the
> scalar field being interpolated. Here is a small example of simple 3x3x3
> regular grid and a constant scalar field of 1.0 values, that is
> interpolated at the input data points.

Works for me.

grid_z1= [[[ 1.  1.  1.]
[ 1.  1.  1.]
[ 1.  1.  1.]]
[[ 1.  1.  1.]
[ 1.  1.  1.]
[ 1.  1.  1.]]
[[ 1.  1.  1.]
[ 1.  1.  1.]
[ 1.  1.  1.]]]

Do you get the same triangulation?

>>> from scipy.spatial import Delaunay
>>> Delaunay(points).vertices
array([[ 1, 12, 10, 13],
[ 1,  9, 12, 10],
[ 1,  4, 10, 13],
[ 1,  4, 12, 13],
[ 1,  3,  4, 12],
[ 1,  9, 10,  0],
[ 1,  9, 12,  0],
[ 1,  3, 12,  0],
[ 1,  3,  4,  0],
[21, 12, 10, 13],
[21, 22, 12, 13],
[21,  9, 12, 10],
[21, 22, 10, 13],
[21, 19, 22, 10],
[21,  9, 10, 18],
[21,  9, 12, 18],
[21, 19, 10, 18],
[21, 19, 22, 18],
[15,  4, 12, 13],
[15, 16, 12, 13],
[15,  3,  4,  6],
[15, 16,  4, 13],
[15,  7, 16,  4],
[15,  3,  4, 12],
[15,  7,  4,  6],
[15,  7, 16,  6],
[25, 22, 12, 13],
[25, 16, 12, 13],
[25, 21, 22, 24],
[25, 16, 22, 13],
[25, 15, 16, 24],
[25, 21, 12, 24],
[25, 21, 22, 12],
[25, 15, 12, 24],
[25, 15, 16, 12],
[23, 16, 22, 13],
[23, 25, 16, 26],
[23, 14, 16, 13],
[23, 17, 14, 16],
[23, 25, 16, 22],
[23, 17, 16, 26],
[23, 17, 14, 26],
[23, 22, 10, 13],
[23, 14, 10, 13],
[23, 11, 14, 20],
[23, 19, 10, 20],
[23, 19, 22, 10],
[23, 11, 10, 20],
[23, 11, 14, 10],
[ 5, 16,  4, 13],
[ 5, 14, 16, 13],
[ 5,  7, 16,  8],
[ 5,  7, 16,  4],
[ 5, 17, 16,  8],
[ 5, 17, 14, 16],
[ 5,  4, 10, 13],
[ 5, 11, 14, 10],
[ 5, 14, 10, 13],
[ 5,  1, 10,  2],
[ 5,  1,  4, 10],
[ 5, 11, 10,  2]])

```