filters.py 文件源码

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

项目:pypiv 作者: jr7 项目源码 文件源码
def outlier_from_local_median(piv, treshold=2.0):
    """Outlier detection algorithm for mask creation.

    The calculated residual is compared to a threshold which produces a mask.
    The mask consists of nan values at the outlier positions.
    This mask can be interpolated to remove the outliers.

    :param object piv: Piv Class Object
    :param double threshold: threshold for identifying outliers

    """
    u_res = get_normalized_residual(piv.u)
    v_res = get_normalized_residual(piv.v)
    res_total = np.sqrt(u_res**2 + v_res**2)
    mask =  res_total > treshold
    piv.u[mask] = np.nan
    piv.v[mask] = np.nan
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号