我试图使用scipy.interpolate.interp1d
将经度和纬度值绘制为地图图像的x坐标和y坐标像素。我有样本值:Python scipy.interpolate.interp1d不适用于大浮点值
y = [0, 256, 512, 768, 1024, 1280, 1536]
lat = [615436414755, 615226949459, 615017342897, 614807595000, 614597705702, 614387674936, 614177502635]
x = [0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304]
lon = [235986328125, 236425781250, 236865234375, 237304687500, 237744140625, 238183593750, 238623046875, 239062500000, 239501953125, 239941406250]
当我通过像这样的功能:
xInterpolation = interp1d(xDegree, xPixel)
yInterpolation = interp1d(yDegree, yPixel)
return (int(xInterpolation(lon)),int(yInterpolation(lat)))
我得到的值错误:
ValueError("A value in x_new is above the interpolation " ValueError: A value in x_new is above the interpolation range.
不管我什么价值,它抛出价值错误,我甚至尝试给出输入列表中相同的纬度或经度值,但这也不起作用。有人知道这里发生了什么吗?或者如果我使用错误的插值。
不,它不在插值范围之上。我已经仔细检查过,并在问题中提到了这条信息。 – Omayr
@Omayr那么,你可以给你的问题提供所有阵列的样本吗? – ShabashP