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

Adam Machnik amachnik@gmail....
Tue Sep 21 07:21:09 CDT 2010


The triangulation seems not exactly the same:

[[23 16 22 13]
 [23 25 16 22]
 [23 14 22 13]
 [23 14 16 13]
 [23 17 14 16]
 [23 25 22 26]
 [23 25 16 26]
 [23 17 16 26]
 [23 17 14 26]
 [19 14 22 13]
 [19 10 22 13]
 [19 23 14 20]
 [19 10 14 13]
 [19 11 10 14]
 [19 23 22 20]
 [19 23 14 22]
 [19 11 14 20]
 [19 11 10 20]
 [21 10 22 13]
 [21 19 10 18]
 [21 12 10 13]
 [21  9 12 10]
 [21 19 10 22]
 [21  9 10 18]
 [21  9 12 18]
 [21 16 22 13]
 [21 15 12 16]
 [21 12 16 13]
 [21 25 16 22]
 [21 25 16 24]
 [21 15 16 24]
 [21 15 12 24]
 [ 1 12 10 13]
 [ 1  4 10 13]
 [ 1  9 12  0]
 [ 1  4 12 13]
 [ 1  3  4 12]
 [ 1  9 12 10]
 [ 1  3 12  0]
 [ 1  3  4  0]
 [ 5 10 14 13]
 [ 5  4 10 13]
 [ 5 11 10  2]
 [ 5  4 14 13]
 [ 5  1  4  2]
 [ 5 11 10 14]
 [ 5  1 10  2]
 [ 5  1  4 10]
 [ 7 12 16 13]
 [ 7  4 12 13]
 [ 7 15 12  6]
 [ 7 15 12 16]
 [ 7  3 12  6]
 [ 7  3  4 12]
 [ 7 14 16 13]
 [ 7  4 14 13]
 [ 7 17 14  8]
 [ 7 17 14 16]
 [ 7  5 14  8]
 [ 7  5  4 14]]


On Tue, Sep 21, 2010 at 2:03 PM, Pauli Virtanen <pav@iki.fi> wrote:
> Tue, 21 Sep 2010 13:54:45 +0200, Adam Machnik wrote:
>> I have downloaded from SVN the latest `griddata` implementation for
>> 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]])
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>


More information about the SciPy-Dev mailing list