pdyna.io module
pdyna.io: The collection of I/O functions to various input formats.
- pdyna.io.chemical_from_formula(struct)[source]
Get the chemical formula from the structure object. Only recorded a limited range of structures.
- Parameters:
struct (Structure) – The structure object.
- Returns:
The chemical formula.
- Return type:
str
- pdyna.io.construct_cell(diagdisp, offdiag)[source]
Help function to create an ASE-cell with displacement vector from the lammps coordination system parameters.
- Parameters:
diagdisp (tuple) – The diagonal displacement vector.
offdiag (tuple) – The off-diagonal displacement vector.
- Returns:
The cell matrix and the displacement vector.
- Return type:
tuple
- pdyna.io.lammps_data_to_ase_atoms(data, colnames, cell, celldisp, pbc=False, atomsobj=<class 'ase.atoms.Atoms'>, order=True, specorder=None, prismobj=None, units='metal')[source]
Extract positions and other per-atom parameters and create Atoms Taken directly from ASE
- Parameters:
data (numpy.ndarray) – The LAMMPS data block.
colnames (list) – The column names.
cell (numpy.ndarray) – The lattice matrix.
celldisp (numpy.ndarray) – The lattice displacement.
pbc (bool) – The periodic boundary conditions.
atomsobj (class) – The atoms object class.
order (bool) – Order the atoms.
specorder (list) – The order of atomic species.
prismobj (class) – The prism object.
- Returns:
The atomic structure in ASE.Atoms format.
- Return type:
ase.Atoms
- pdyna.io.process_lammps_data(data, colnames, cell, celldisp, order=True, specorder=None, units='metal')[source]
Extract positions and other per-atom parameters from block of LAMMPS data. Modified from ASE functions
- Parameters:
data (numpy.ndarray) – The LAMMPS data block.
colnames (list) – The column names.
cell (numpy.ndarray) – The lattice matrix.
celldisp (numpy.ndarray) – The lattice displacement.
order (bool) – Order the atoms.
specorder (list) – The order of atomic species.
units (str) – The LAMMPS units.
- Returns:
The atomic symbols, lattices, and atomic positions.
- Return type:
tuple
- pdyna.io.process_lat(m)[source]
Convert lattice matrix to abc and three angles.
- Parameters:
m (numpy.ndarray) – The lattice matrix.
- Returns:
The abc lattice vectors and three angles.
- Return type:
numpy.ndarray
- pdyna.io.process_lat_reverse(cellpar)[source]
Convert abc and three angles to lattice matrix. Modified from ASE functions.
- Parameters:
cellpar (numpy.ndarray) – The abc lattice vectors and three angles.
- Returns:
The lattice matrix.
- Return type:
numpy.ndarray
- pdyna.io.read_ase_md_settings(fdir)[source]
Read the ASE MD input file and extract the simulation settings.
- Parameters:
fdir (str) – The directory path.
- Returns:
The simulation settings
- Return type:
tuple
- pdyna.io.read_ase_traj(filepath)[source]
Read the ASE internal trajectory file and extract the atomic symbols, lattices, and atomic positions. Modified from ASE original trajectory reading functions
- Parameters:
filepath (str) – The ASE trajectory file.
- Returns:
The atomic symbols, lattices, and atomic positions
- Return type:
tuple
- pdyna.io.read_lammps_dir(fdir, allow_multi=False)[source]
Read the LAMMPS input files in the directory and extract the simulation settings.
- Parameters:
fdir (str) – The directory path.
allow_multi (bool) – Allow multiple LAMMPS input files in the directory.
- Returns:
The simulation settings.
- Return type:
dict or list of dict
- pdyna.io.read_lammps_dump(filepath, specorder=None)[source]
Read the LAMMPS trajectory file and extract the atomic symbols, lattices, and atomic positions. Modified from ASE LAMMPS reading functions
- Parameters:
filepath (str) – The LAMMPS trajectory file.
specorder (list) – The order of atomic species.
- Returns:
The atomic symbols, lattices, and atomic positions.
- Return type:
tuple
- pdyna.io.read_lammps_settings(infile)[source]
Read the LAMMPS input file and extract the simulation settings.
- Parameters:
infile (str) – The LAMMPS input file.
- Returns:
The simulation settings
- Return type:
dict
- pdyna.io.read_pdb(filepath)[source]
Read the protein data bank (PDB) trajectory file and extract the atomic symbols, lattices, and atomic positions. Modified from Pymatgen xyz reading functions
- Parameters:
filepath (str) – The PDB file.
- Returns:
The atomic symbols, lattices, and atomic positions.
- Return type:
tuple
- pdyna.io.read_xdatcar(filename, natom)[source]
Read the VASP XDATCAR file and extract the atomic symbols, lattices, and atomic positions.
- Parameters:
filename (str) – The XDATCAR file.
natom (int) – The number of atoms.
- Returns:
The atomic symbols, lattices, and atomic positions.
- Return type:
tuple
- pdyna.io.read_xyz(filepath)[source]
Read the XYZ format trajectory file and extract the atomic symbols, lattices, and atomic positions. Modified from Pymatgen xyz reading functions
- Parameters:
filepath (str) – The XYZ format file.
- Returns:
The atomic symbols, lattices, and atomic positions.
- Return type:
tuple