atoms_around_point¶
-
mdtools.select.
atoms_around_point
(ag, point, cutoff, warn_empty=False, verbose=False, **kwargs)[source]¶ Select
Atoms
from a MDAnalysisAtomGroup
instance that are within a cutoff of a point in space.- Parameters
ag (MDAnalysis.core.groups.AtomGroup) – MDAnalysis
AtomGroup
,UpdatingAtomGroup
orUniverse
from which theAtoms
will be selected.point (array_like) – Array of shape
(3,)
containing the coordinates in Angstrom of a point in space. AllAtoms
of ag that are within cutoff of that point will be selected.cutoff (scalar) – Select all
Atoms
that are within cutoff of point. Must be greater than zero.warn_empty (bool, optional) – If
True
, raise aRuntimeWarning
if the createdAtomGroup
contains noAtoms
and is not anUpdatingAtomGroup
.verbose (bool, optional) – If
True
, print some basic information about the created MDAnalysisAtomGroup
to standard output.kwargs (dict, optional) – Additional keyword arguments to pass to
MDAnalysis.core.groups.AtomGroup.select_atoms()
.
- Returns
selection – A MDAnalysis
AtomGroup
containing the selectedAtoms
.- Return type
See also
Notes
This function uses the MDAnalysis selection syntax point x y z distance. It is just a convinient wrapper around
mdtools.select.atoms()
that allows you to simply parse an array like point and a cutoff without the need to assemble them to a MDAnalysis selection string yourself.