PAOFLOW.writers.write2xsf#
Functions#
|
Write crystal structure and optional 3-D volumetric data in XSF format. |
Module Contents#
- PAOFLOW.writers.write2xsf.write2xsf(data_controller, filename, data=None)[source]#
Write crystal structure and optional 3-D volumetric data in XSF format.
- Parameters:
data_controller (DataController) – Object providing
data_arraysanddata_attributes. Required arrays:atoms(list of element symbols),a_vectors(shape(3, 3)in units ofalat),tau(shape(natoms, 3)in Bohr radii). Required attribute:alat(lattice constant in Bohr radii).filename (str) – Absolute or relative path of the XSF output file.
data (Optional[np.ndarray]) – Volumetric scalar field on a real-space grid of shape
(nr1, nr2, nr2). IfNone, only the crystal structure block is written. Complex arrays are converted to \(|\psi|^2\) before writing.
- Returns:
Creates (or overwrites) the file at
filename.- Return type:
None
Notes
The file is written in the XCrySDen Structure Format (XSF), which is supported by XCrySDen and VESTA for structure and charge-density visualisation. The structure block includes primitive cell vectors (in Bohr radii) and atomic positions with atomic numbers obtained from the
mendeleevlibrary.When
datais provided, aBEGIN_BLOCK_DATAGRID_3Dsection is appended. The grid is extended by one point in each direction (periodic boundary) to satisfy XSF convention, i.e. the grid size written is(nr1+1, nr2+1, nr3+1).