atoms_around_point

mdtools.select.atoms_around_point(ag, point, cutoff, warn_empty=False, verbose=False, **kwargs)[source]

Select Atoms from a MDAnalysis AtomGroup instance that are within a cutoff of a point in space.

Parameters
  • ag (MDAnalysis.core.groups.AtomGroup) – MDAnalysis AtomGroup, UpdatingAtomGroup or Universe from which the Atoms will be selected.

  • point (array_like) – Array of shape (3,) containing the coordinates in Angstrom of a point in space. All Atoms 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 a RuntimeWarning if the created AtomGroup contains no Atoms and is not an UpdatingAtomGroup.

  • verbose (bool, optional) – If True, print some basic information about the created MDAnalysis AtomGroup 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 selected Atoms.

Return type

MDAnalysis.core.groups.AtomGroup

See also

mdtools.select.atoms()

Select Atoms from a MDAnalysis AtomGroup

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.