网格数据运行时错误 -- Python / SciPy(插值)

3
我使用scipy的griddata函数进行插值。
当Python执行griddata函数时,出现的以下错误消息是什么意思?
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
2个回答

7
这通常意味着你传入的点集无法进行三角剖分。一些常见的情况包括:
  • 你有2D数据,但所有点都在一条直线上。在这种情况下,数据无法被剖分为非退化的三角形。
  • 你有3D数据,但所有点都在一个平面上,因此无法分解为非退化的四面体。以此类推到更高维度。
在这些情况下,插值也没有意义,因此这种失败并不表示有错误,而是griddata的使用不正确。
通常,Qhull会向stderr打印有关出错原因的其他信息,请检查程序输出以查看它的内容。

1

这意味着由该函数使用的qhull(http://www.qhull.org)代码由于错误而未返回结果。

这种情况是否总是发生,还是只针对某些输入?

您能否发布导致错误的示例输入?


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接