python interp2d奇怪的检查器

时间:2018-11-30 22:59:58

标签: python scipy interpolation

我正在使用scipy.interpolate.interp2d内插大小为105乘109的数组(2d值)。

 function=interp2d(2d_x_coords,2d_y_cords,2d_values)
 interpolated=float(function(2d_x_finer_coords,2d_y_fner_coords))

我遇到一个问题,即插值在大多数位置都具有正确的值,但是在插值的某些区域中,当数据应介于(0到〜300)之间时,会有棋盘格和条纹的正负数很大。

2d_values是一个相对连续的字段,在一些位置上相邻坐标之间的跳变较大,并且是纬度和经度坐标的地图投影,因此坐标不是规则的网格,而是像平面地图一样失真。

the picture on the right is 2d_values and the picture on the left is interpolated

this is the code used to perform this

1 个答案:

答案 0 :(得分:0)

使用griddata可以产生很好的结果,而不会出现任何问题。