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
评论列表
文章目录