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

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


Hello,
I am concerned in the difference in triangulation. I think that on
such a simple grid there should be no difference from qhull results.
FYI: I have tested the scipy.spatial module on my workstation. There
is one test that fails.
However it was already reported in the mailinglist, and it does not
seem to be the problem.
What can I do else ?

Adam

>>> import scipy
>>> scipy.spatial.test()
Running unit tests for scipy.spatial
NumPy version 1.5.0
NumPy is installed in /UTIL/PYTHON26/lib/python2.6/site-packages/numpy
SciPy version 0.9.0.dev6812
SciPy is installed in /UTIL/PYTHON26/lib/python2.6/site-packages/scipy
Python version 2.6.4 (r264:75706, Nov  9 2009, 15:41:41) [GCC 3.4.6
20060404 (Red Hat 3.4.6-9)]
nose version 0.11.1
............................................................................................................................F..................................................................................................................................................
======================================================================
FAIL: Tests pdist(X, 'minkowski') on iris data. (float32)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/UTIL/PYTHON26/lib/python2.6/site-packages/scipy/spatial/tests/test_distance.py",
line 838, in test_pdist_minkowski_3_2_iris_float32
    self.assertTrue(within_tol(Y_test1, Y_right, eps))
AssertionError:
    """Fail the test unless the expression is true."""
>>  if not False: raise self.failureException, None


----------------------------------------------------------------------
Ran 271 tests in 15.020s

FAILED (failures=1)
<nose.result.TextTestResult run=271 errors=0 failures=1>
>>>


On Tue, Sep 21, 2010 at 2:21 PM, Adam Machnik <amachnik@gmail.com> wrote:
> 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