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