Contact Identification

This module defines a class and function for identifying contacts.

class Contacts(atoms, unitcell=None)[source]

A class for contact identification. Contacts are identified using the coordinates of atoms at the time of instantiation.

atoms must be an Atomic instance. When an orthorhombic unitcell array is given


Returns atoms, or coordinate array, provided at instantiation..


Returns unitcell array, or None if one was not provided.

select(radius, center)

Select atoms radius radius (Å) of center, which can be point(s) in 3-d space (numpy.ndarray with shape (n_atoms, 3)) or a set of atoms, e.g. Selection.

iterNeighbors(atoms, radius, atoms2=None, unitcell=None)[source]

Yield pairs of atoms that are within radius of each other and the distance between them. If atoms2 is also provided, one atom from atoms and another from atoms2 will be yielded. If one of atoms or atoms2 is a coordinate array, pairs of indices and distances will be yielded. When orthorhombic unitcell dimensions are provided, periodic boundary conditions will be taken into account (see KDTree and also wrapAtoms() for details). If atoms is a Frame instance and unitcell is not provided, unitcell information from frame will be if available.

findNeighbors(atoms, radius, atoms2=None, unitcell=None)[source]

Returns list of neighbors that are within radius of each other and the distance between them. See iterNeighbors() for more details.