def interpolate_xml_array(data, low_res_coords, full_res_size):
"""Interpolate arbitrary size dataset to a full sized grid."""
from scipy.interpolate import griddata
grid_x, grid_y = np.mgrid[0:full_res_size[0], 0:full_res_size[1]]
x, y = low_res_coords
return griddata(np.vstack((np.asarray(y), np.asarray(x))).T,
data,
(grid_x, grid_y),
method='linear')
评论列表
文章目录