refstruct.py 文件源码

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

项目:capriqorn 作者: bio-phys 项目源码 文件源码
def selectShell(ref_coords, coords, R, sw):
    """
    Return indices of the particles within the spherical shell of
    inner radius (R-sw) and outer radius R, ie the shell.

    Parameters
    ----------
    ref_coords : array_like (n_atoms, n_dim)
        Reference atoms positions
    coords : array_like (n_atoms, n_dim)
        atoms positions
    R : float
        distance to any atoms

    Returns
    -------
    array
        particle indices within shell
    """
    if R < sw:
        raise RuntimeError("selection radius smaller then shell width")
    body_query = get_selection(coords, ref_coords, R=R)
    core_query = get_selection(coords, ref_coords, R=R - sw)
    query = np.logical_xor(body_query, core_query)
    return np.where(query)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号