IO¶
Ramannoodle includes functions for reading and writing files used by quantum chemistry software. Currently, ramannoodle includes build-in interfaces with VASP. Ramannoodle also includes an interface with pymatgen, allowing spectra to be calculated using a wide array of DFT packages.
File IO¶
IO operations are implemented in ramannoodle as functions. These are organized into packages and modules under ramannoodle.io. For example, VASP POSCAR IO functions are contained in ramannoodle.io.vasp.poscar while OUTCAR files can be read with functions in ramannoodle.io.vasp.outcar. Using this structure, files of various types can be interacted with in an intuitive and readable way:
import ramannoodle as rn
phonons = rn.io.vasp.outcar.read_phonons(...)
rn.io.vasp.poscar.write_structure(...)
Ramannoodle also includes generic versions of IO functions in ramannoodle.io.generic. These functions use parameters to specify the desired file format:
import ramannoodle as rn
phonons = rn.io.generic.read_phonons(..., file_format = "outcar")
rn.io.generic.write_structure(..., file_format = "poscar")
These generic functions are less flexible than those first mentioned, and therefore these generic functions are best used only when necessary. One such case is loading files directly into polarizability models:
import ramannoodle as rn
model = rn.pmodel.InterpolationModel(...)
model.add_dof_from_files(..., file_format = "outcar")
InterpolationModel.add_dof_from_files() and other methods like it rely on these generic methods, as apparent from the file_format argument.
Supported file formats¶
The following table reviews which file types and properties are currently supported by ramannoodle’s IO functions:
File format ( |
positions |
polarizability |
|||
|---|---|---|---|---|---|
POSCAR ( |
read/write |
read/write |
|||
OUTCAR ( |
read1 |
read |
read |
read1 |
read |
XDATCAR ( |
read1/write |
read2/write |
read1/write |
||
vasprun.xml ( |
read1 |
read |
read |
read1 |
read |
1 Uses initial structure.
2 Not available in ramannoodle.io.generic
Pymatgen integration¶
Ramannoodle includes interfaces with pymatgen. By taking advantage of pymatgen’s IO functionality, one can use ramannoodle with a wide variety of popular DFT software packages. ramannoodle.io.pymatgen contains various useful functions for loading pymatgen data into ramannoodle. In addition InterpolationModel and ARTModel implement add_dof_from_pymatgen() and add_art_from_pymatgen() methods, allowing one to build up these models using pymatgen objects.