iotools Package¶
iotools
Package¶
-
class
abipy.iotools.
ETSF_Reader
(path)[source]¶ Bases:
pymatgen.io.abinit.netcdf.ETSF_Reader
Provides high-level API to read data from netcdf files written following the ETSF-IO specifications described in [Caliste2008]
-
read_structure
()[source]¶ Overrides the
read_structure
method so that we always return an instance of AbiPyabipy.core.structure.Structure
object
-
visualizer
Module¶
Classes used to execute a visualizer within the Python interpreter.
-
class
abipy.iotools.visualizer.
Visualizer
(filepath)[source]¶ Bases:
object
Handle the visualization of data.
-
is_macosx_app
= False¶
-
Error
¶ alias of
abipy.iotools.visualizer.VisualizerError
-
property
cmdarg
¶ Arguments that must be used to visualize the file.
-
property
is_available
¶ True is the visualizer is available on the local machine.
-
classmethod
get_available
(ext=None)[source]¶ List of visualizers available on the local host. If ext is not None, only the visualizers supporting this extension are returned.
-
classmethod
from_file
(filepath)[source]¶ Initialize a subclass of
Visualizer
from filepath, the application is chosen automatically depending on the file extension.- Raises
VisualizerError –
-
xsf
Module¶
Tools for writing Xcrysden files.
-
abipy.iotools.xsf.
xsf_write_structure_and_data_to_path
(filepath, structure, datar, **kwargs)[source]¶ Simplified interface to xsf routines to write structure and data to filepath.
-
abipy.iotools.xsf.
xsf_write_structure
(file, structures)[source]¶ Write the crystalline structure in the Xcrysden format (XSF)
- Parameters
file – file-like object.
structures –
Structure
or list ofStructure
objects.
-
abipy.iotools.xsf.
xsf_write_data
(file, structure, data, add_replicas=True, cplx_mode=None)[source]¶ Write data in the Xcrysden format (XSF)
- Parameters
file – file-like object.
structure –
Structure
object.data – array-like object in C-order, i.e data[nx, ny, nz]
add_replicas – If True, data is padded with redundant data points. in order to have a periodic 3D array of shape: (nx+1, ny+1, nz+1).
cplx_mode –
string defining the data to print when data is a complex array. Possible choices are (case-insensitive):
”re” for real part.
”im” for imaginary part.
”abs” for the absolute value
-
abipy.iotools.xsf.
bxsf_write
(file, structure, nsppol, nband, ndivs, ucdata_sbk, fermie, unit='eV')[source]¶ Write band structure data in the Xcrysden format (XSF)
- Parameters
file – file-like object.
structure –
Structure
object.nsppol – Number of spins.
nband – Number of bands.
ndivs – Number of divisions of the full k-mesh.
ucdata_sbk – Array [nsppol, nband, ndivs[0], ndivs[1], mpdvis[2]] with energies in the unic cell mesh in unit unit.
fermie – Fermi energy.
of input ucdata_sbk and fermie. Energies will be converted to Hartree before writing. (unit=Unit) –
Note
The k-points must span the reciprocal unit cell, not the Brillouin zone.
The mesh must be closed and centered on Gamma.
Energies are written in row-major (i.e. C) order.
# Energies are in Hartree.
See also http://www.xcrysden.org/doc/XSF.html