ancestry_checker.py 文件源码

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

项目:ytree 作者: brittonsmith 项目源码 文件源码
def common_ids(descendent_ids, ancestor_ids, threshold=0.5):
    r"""
    Determine if at least a given fraction of ancestor's member particles
    are in the descendent.

    Parameters
    ----------
    descendent_ids : list of ints
        Member ids for first halo.
    ancestor_ids : list of int
        Member ids for second halo.
    threshold : float, optional
        Critical fraction of ancestor's particles ending up in the
        descendent to be considered a true ancestor.  Default: 0.5.

    Returns
    -------
    True or False

    """

    common = np.intersect1d(descendent_ids, ancestor_ids)
    return common.size > threshold * ancestor_ids.size
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号