Generalized Coordination Number
This module allows for the computation of the Generalized Coordination Number (GCN) for an atomic system.
The GCN is a descriptor expanding on the better known Coordination Number (CN, the number of neighbours for each atom)
Functions
read_xyz(file_path)
Reads the elements and coordinates of atoms from an xyz file at a given location
Parameters
file_path : str Path to the xyz file with the structure
Returns
Tuple[np.ndarray, np.ndarray] Elements and coordinates array of the system
Raises
FileNotFoundError No file was found at the given location ValueError Some error while reading the file Exception Unexpected errors along the way
Source code in snow/lodispp/pp_io.py
read_xyz_movie(file_path)
Obtains the coordinates and elements for each frame of an xyz trajectory (for now it only supports trajectories where the number of atoms and chemical composition is fixed through the whole trajectory).
Note that it only creates a singe array for the elements rather than a per-frame array.
Parameters
file_path : str Path to the xyz file with the structure
Returns
Tuple[np.ndarray, np.ndarray] Elements array and a (n_frames x 3 x n_atoms) array for the coordinates
Source code in snow/lodispp/pp_io.py
write_movie_xyz(frame, filename, elements, coords, additional_data=None)
Writes atomic data to an XYZ file in OVITO-compatible format.
Parameters
frame: int Frame number. filename: str Name of the output .xyz file. elements: ndarray List of atomic symbols (e.g., ['Au', 'Au', ...]). coords: ndarray) Nx3 array of atomic coordinates. additional_data: list or np.ndarray, optional Additional per-atom data, such as coordination numbers.
Returns:
Type | Description |
---|---|
An xyz file containing the elements and coordinates of each atom and any additional per atom data (e.g. coordination number, agcn, strain...) |
Source code in snow/lodispp/pp_io.py
write_xyz(filename, elements, coords, additional_data=None)
Writes atomic data to an XYZ file in OVITO-compatible format.
Parameters
filename: str Name of the output .xyz file. elements: ndarray List of atomic symbols (e.g., ['Au', 'Au', ...]). coords: ndarray) Nx3 array of atomic coordinates. additional_data: list or np.ndarray, optional Additional per-atom data, such as coordination numbers.
Returns:
Type | Description |
---|---|
An xyz file containing the elements and coordinates of each atom and any additional per atom data (e.g. coordination number, agcn, strain...) |