def bilin_interp(grid2d, ith, ir, dth, dr, nth, nr):
'''
This function finds an interpolated value in the 2d plume grid, and returns
the value. It's much faster than scipy.interpolate.interp2d
Takes as arguments the 2d grid of plume perturbations, the index in theta,
the index in radius, step size in theta and radius, and number of points
in theta and radius.
'''
value = grid2d[ith,ir]*(1-dth)*(1-dr) + grid2d[ith+1,ir]*dth*(1-dr)
value += grid2d[ith,ir+1]*(1-dth)*dr + grid2d[ith+1,ir+1]*dth*dr
return value
评论列表
文章目录