def replace_field(f, mask):
"""Interpolates positions in field according to mask with a 2D cubic interpolator"""
lx, ly = f.shape
x, y = np.mgrid[0:lx, 0:ly]
C = CT_intp((x[~mask],y[~mask]),f[~mask], fill_value=0)
return C(x, y)
评论列表
文章目录