ramannoodle.io.vasp¶
Functions for interacting with VASP files.
Submodules¶
ramannoodle.io.vasp.outcar module¶
Functions for interacting with VASP OUTCAR files.
- ramannoodle.io.vasp.outcar.read_phonons(filepath)¶
Read phonons from a VASP OUTCAR file.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- Return type:
- ramannoodle.io.vasp.outcar.read_polarizability_dataset(filepaths)¶
Read polarizability dataset from OUTCAR files.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
IncompatibleFileException – File is incompatible with the dataset.
- Return type:
- ramannoodle.io.vasp.outcar.read_positions(filepath)¶
Read fractional positions from a VASP OUTCAR file.
- Parameters:
- Return type:
- Returns:
(fractional) Array with shape (N,3) where N is the number of atoms.
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- ramannoodle.io.vasp.outcar.read_positions_and_polarizability(filepath)¶
Read fractional positions and polarizability from a VASP OUTCAR file.
The polarizability returned by VASP is, in fact, a dielectric tensor. However, this is inconsequential to the calculation of Raman spectra.
- Parameters:
- Return type:
tuple[ndarray[Any,dtype[float64]],ndarray[Any,dtype[float64]]]- Returns:
positions – (fractional) Array with shape (N,3) where N is the number of atoms.
polarizability – Array with shape (3,3).
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- ramannoodle.io.vasp.outcar.read_ref_structure(filepath)¶
Read reference structure from a VASP OUTCAR file.
If the file contains multiple structures (such as those generated by a molecular dynamics run), the initial structure will be considered the reference structure.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
SymmetryException – Structural symmetry determination failed.
- Return type:
- ramannoodle.io.vasp.outcar.read_structure_and_polarizability(filepath)¶
Read lattice, fractional positions, atomic numbers, polarizability from OUTCAR.
The polarizability returned by VASP is, in fact, a dielectric tensor. However, this is inconsequential to the calculation of Raman spectra.
- Parameters:
- Return type:
tuple[ndarray[Any,dtype[float64]],list[int],ndarray[Any,dtype[float64]],ndarray[Any,dtype[float64]]]- Returns:
lattice – (Å) Array with shape (3,3).
atomic_numbers – List of length N where N is the number of atoms.
positions – (fractional) Array with shape (N,3) where N is the number of atoms.
polarizability – Array with shape (3,3).
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- ramannoodle.io.vasp.outcar.read_trajectory(filepath)¶
Read molecular dynamics trajectory from a VASP OUTCAR file.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- Return type:
ramannoodle.io.vasp.poscar module¶
Functions for interacting with VASP POSCAR files.
- ramannoodle.io.vasp.poscar.read_positions(filepath)¶
Read fractional positions from a VASP POSCAR file.
- Parameters:
- Return type:
- Returns:
(fractional) Array with shape (N,3) where N is the number of atoms.
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- ramannoodle.io.vasp.poscar.read_ref_structure(filepath)¶
Read reference structure from a VASP POSCAR file.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
SymmetryException – Structural symmetry determination failed.
- Return type:
- ramannoodle.io.vasp.poscar.read_structure(filepath)¶
Read lattice, atomic numbers, and fractional positions from a VASP POSCAR file.
- ramannoodle.io.vasp.poscar.write_structure(lattice, atomic_numbers, positions, filepath, overwrite=False, label='POSCAR written by ramannoodle')¶
Write structure to a VASP POSCAR file.
- Parameters:
lattice (
ndarray[Any,dtype[float64]]) – (Å) Array with shape (3,3).atomic_numbers (
list[int]) – List of length N where N is the number of atoms.positions (
ndarray[Any,dtype[float64]]) – (fractional) Array with shape (N,3).overwrite (
bool) – Overwrite the file if it exists.label (
str) – POSCAR label (first line).
- Return type:
ramannoodle.io.vasp.vasprun module¶
Functions for interacting with vasprun.xml files.
- ramannoodle.io.vasp.vasprun.read_phonons(filepath)¶
Read phonons from a vasprun.xml file.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- Return type:
- ramannoodle.io.vasp.vasprun.read_polarizability_dataset(filepaths)¶
Read polarizability dataset from OUTCAR files.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
IncompatibleFileException – File is incompatible with the dataset.
- Return type:
- ramannoodle.io.vasp.vasprun.read_positions(filepath)¶
Read fractional positions from a vasprun.xml file.
- Parameters:
- Return type:
- Returns:
(fractional) Array with shape (N,3) where N is the number of atoms.
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- ramannoodle.io.vasp.vasprun.read_positions_and_polarizability(filepath)¶
Read fractional positions and polarizability from a vasprun.xml file.
The polarizability returned by VASP is, in fact, a dielectric tensor. However, this is inconsequential to the calculation of Raman spectra.
- Parameters:
- Return type:
tuple[ndarray[Any,dtype[float64]],ndarray[Any,dtype[float64]]]- Returns:
positions – (fractional) Array with shape (N,3) where N is the number of atoms.
polarizability – Array with shape (3,3).
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- ramannoodle.io.vasp.vasprun.read_ref_structure(filepath)¶
Read reference structure from a vasprun.xml file.
If the file contains multiple structures (such as those generated by a molecular dynamics run), the initial structure will be considered the reference structure.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
SymmetryException – Structural symmetry determination failed.
- Return type:
- ramannoodle.io.vasp.vasprun.read_structure_and_polarizability(filepath)¶
Read lattice, positions, atomic numbers, and polarizability from a vasprun.xml.
The polarizability returned by VASP is, in fact, a dielectric tensor. However, this is inconsequential to the calculation of Raman spectra.
- Parameters:
- Return type:
tuple[ndarray[Any,dtype[float64]],list[int],ndarray[Any,dtype[float64]],ndarray[Any,dtype[float64]]]- Returns:
lattice – (Å) Array with shape (3,3).
atomic numbers – List of length N where N is the number of atoms.
positions – (fractional) Array with shape (N,3) where N is the number of atoms.
polarizability – Array with shape (3,3).
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- ramannoodle.io.vasp.vasprun.read_trajectory(filepath)¶
Read molecular dynamics trajectory from a vasprun.xml file.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- Return type:
ramannoodle.io.vasp.xdatcar module¶
Functions for interacting with VASP XDATCAR files.
- ramannoodle.io.vasp.xdatcar.read_positions_ts(filepath)¶
Read fractional positions time series from a VASP XDATCAR file.
- Parameters:
- Return type:
- Returns:
(fractional) Array with shape (S,N,3) where S is the number of configurations and N is the number of atoms.
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- ramannoodle.io.vasp.xdatcar.read_trajectory(filepath, timestep)¶
Read trajectory from a VASP XDATCAR file.
Timestep must be manually specified, as XDATCAR’s do not contain the timestep.
- Parameters:
- Raises:
FileNotFoundError – File not found.
InvalidFileException – Invalid file.
- Return type:
- ramannoodle.io.vasp.xdatcar.write_trajectory(lattice, atomic_numbers, positions_ts, filepath, overwrite=False, label='XDATCAR written by ramannoodle')¶
Write trajectory to a VASP XDATCAR file.
- Parameters:
lattice (
ndarray[Any,dtype[float64]]) – (Å) Array with shape (3,3).atomic_numbers (
list[int]) – List of length N where N is the number of atoms.positions_ts (
ndarray[Any,dtype[float64]]) – (fractional) Array with shape (S,N,3) where S is the number of configurations.overwrite (
bool) – Overwrite the file if it exists.label (
str) – XDATCAR label (first line).
- Return type: