griddata runtime error — Python / SciPy (Interpolation)

寵の児 提交于 2019-12-01 06:19:17

问题


I use scipy's griddate-function for interpolation.

What does the following error message means which appears when python is executing the griddata-function?

File "C:\Python25\lib\site-packages\scipy\interpolate\ndgriddata.py", line 182, in griddata
ip = LinearNDInterpolator(points, values, fill_value=fill_value)
File "interpnd.pyx", line 192, in interpnd.LinearNDInterpolator.__init__ (scipy\interpolate\interpnd.c:2524)
File "qhull.pyx", line 917, in scipy.spatial.qhull.Delaunay.__init__ (scipy\spatial\qhull.c:4030)
File "qhull.pyx", line 170, in scipy.spatial.qhull._construct_delaunay (scipy\spatial\qhull.c:1269)
RuntimeError: Qhull error

回答1:


This typically means that the point set you passed in cannot be triangulated. Some common cases when this might occur:

  • You have 2D data, but all the points lie along a line. In this case there is no triangulation of the data to non-degenerate triangles.
  • You have 3D data, but all the points lie on a plane, so no decomposition to non-degenerate tetrahedra. And so on to higher dimensions.

In these cases, interpolation does not make sense either, so this failure is not an indication of a bug, but incorrect usage of griddata.

Typically, Qhull prints additional information on what went wrong to stderr, so check the program output to see what it says.




回答2:


This indicates that the qhull (http://www.qhull.org) code which is used by the function is not returning a result because of an error.

Does this always happen, or only for certain inputs?

Can you post an example input which causes the error?



来源:https://stackoverflow.com/questions/6385621/griddata-runtime-error-python-scipy-interpolation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!