quickest_path.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:crowddynamics 作者: jaantollander 项目源码 文件源码
def fill_missing(mask, x, y, u, v):
    """Fill missing value with by interpolating the values from nearest
    neighbours"""
    # Construct the interpolators from the boundary values surrounding the
    # missing values.
    boundaries = find_boundaries(u.mask, mode='outer')
    points = np.stack((y[boundaries], x[boundaries])).T
    ip_u = NearestNDInterpolator(points, u[boundaries], rescale=False)
    ip_v = NearestNDInterpolator(points, v[boundaries], rescale=False)

    # Interpolate only missing values.
    missing = (y[mask], x[mask])
    u[mask] = ip_u(missing)
    v[mask] = ip_v(missing)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号