首页 > 解决方案 > 如何在 Python 中为 LinearNDInterpolator 使用 Qhull 选项?

问题描述

我正在尝试计算插值:

import scipy.interpolate as si

import scipy

f = si.LinearNDInterpolator(Q, h)

它给了我以下错误

QhullError: qhull precision warning: 
The initial hull is narrow (cosine of min. angle is 1.0000000000000000).
Is the input lower dimensional (e.g., on a plane in 3-d)?  Qhull may
produce a wide facet.  Options 'QbB' (scale to unit box) or 'Qbb' (scale
last coordinate) may remove this warning.  Use 'Pp' to skip this warning.

我的问题是如何将选项更改为 QbB

标签: pythonscipyqhull

解决方案


LinearNDInterpolator有关键字rescale,这可能会有所帮助。

关于 Qhull 选项,您可以在实际执行三角剖分时指定它们,通过scipy.spatial.Delaunay. 然后,您可以将三角测量对象提供给LinearNDInterpolator.


推荐阅读