soprano.measure#
measure.py
Contains utility functions for measuring distances and other quantities at the level of a single ase.Atoms object.
Functions
|
Return the distance in number of bonds between two atoms. |
|
Return the distance between two atoms, in Angstroms. |
- soprano.measure.bondDistance(s, i, j, bond_matrix=None)[source]#
Return the distance in number of bonds between two atoms. Returns -1 if the two atoms are not connected. Requires NetworkX to be installed to work.
Parameters:s (ase.Atoms): the structure on which to compute the distancei (int): index of the first atomj (int): index of the second atombond_matrix (np.ndarray): pre-computed bond matrix to use. If notprovided, will be calculated with defaultparametersReturns:r (int): computed bond distance
- soprano.measure.euclideanDistance(s, i, j, periodic=True)[source]#
Return the distance between two atoms, in Angstroms.
Parameters:s (ase.Atoms): the structure on which to compute the distancei (int): index of the first atomj (int): index of the second atomperiodic (bool): whether to account for periodic boundaries whencomputing the distance; default is TrueReturns:r (float): computed distance