pyiron_atomistics.sphinx.volumetric_data.SphinxVolumetricData#
- class pyiron_atomistics.sphinx.volumetric_data.SphinxVolumetricData[source]#
Bases:
VolumetricDataGeneral class for parsing and manipulating volumetric static within Sphinx.
The basic idea of the Base class is adapted from the pymatgen vasp VolumetricData class:
http://pymatgen.org/_modules/pymatgen/io/vasp/outputs.html#VolumetricData
Methods
__init__()cylindrical_average_potential(structure, ...)Calculates the cylindrical average about a given point in space
Calculates the distance between a target grid point and another grid point
Distance between a target grid point and the center of a cylinder
from_file(filename[, normalize])Parses volumetric data from a sphinx binary (.sxb) file.
from_hdf(hdf[, group_name])Extract a VolumetricData instance from an HDF5 file.
gauss_f(d[, fwhm])Generates a Gaussian distribution for a given distance and full width half maximum value
get_average_along_axis([ind])Get the lateral average along a certain axis direction.
read_cube_file([filename])Generate data from a CUBE file
spherical_average_potential(structure, ...)Calculates the spherical average about a given point in space
to_hdf(hdf[, group_name])Writes the data as a group to a HDF5 file
write_cube_file([filename, cell_scaling])Write the volumetric data into the CUBE file format
write_vasp_volumetric([filename, normalize])Writes volumetric data into a VASP CHGCAR format
Attributes
The structure related to the volumeric data
Volumtric difference data (3D)
Total volumtric data (3D)
- property atoms#
The structure related to the volumeric data
- Returns:
The structure associated with the data
- Return type:
pyiron_atomistics.atomistics.structure.Atoms
- cylindrical_average_potential(structure, spherical_center, axis_of_cyl, rad=2, fwhm=0.529177)#
Calculates the cylindrical average about a given point in space
- Parameters:
structure (pyiron_atomistics.atomistics.structure.Atoms) – Input structure
spherical_center (list/numpy.ndarray) – position of spherical_center in direct coordinate
rad (float) – radius of sphere to be considered in Angstrom (recommended value: 2)
fwhm (float) – Full width half maximum of gaussian function in Angstrom (recommended value: 0.529177)
axis_of_cyl (int) – Axis of cylinder (0 (x) or 1 (y) or 2 (z))
- Returns:
Cylindrical average at the target center
- Return type:
float
- property diff_data#
Volumtric difference data (3D)
- Type:
numpy.ndarray
- static dist_between_two_grid_points(target_grid_point, n_grid_at_center, lattice, grid_shape)#
Calculates the distance between a target grid point and another grid point
- Parameters:
target_grid_point (numpy.ndarray/list) – Target grid point
n_grid_at_center (numpy.ndarray/list) – coordinate of center of sphere
lattice (numpy.ndarray/list) – lattice vector
grid_shape (tuple/list/numpy.ndarray) – size of grid
- Returns:
Distance between target grid and center of sphere in angstrom
- Return type:
float
- static dist_between_two_grid_points_cyl(target_grid_point, n_grid_at_center, lattice, grid_shape, direction_of_cyl)#
Distance between a target grid point and the center of a cylinder
- Parameters:
target_grid_point (numpy.ndarray/list) – Target grid point
n_grid_at_center (numpy.ndarray/list) – coordinate of center of sphere
lattice (numpy.ndarray/list) – lattice vector
grid_shape (tuple/list/numpy.ndarray) – size of grid
direction_of_cyl (int) – Axis of cylinder (0 (x) or 1 (y) or 2 (z))
- Returns:
Distance between target grid and in-plane center of cylinder
- Return type:
float
- from_file(filename, normalize=True)[source]#
Parses volumetric data from a sphinx binary (.sxb) file.
- Parameters:
filename (str) – Path of file to parse
normalize (boolean) – Flag to normalize by the volume of the cell
- from_hdf(hdf, group_name='volumetric_data')[source]#
Extract a VolumetricData instance from an HDF5 file.
- Parameters:
hdf (pyiron_base.generic.hdfio.ProjectHDFio) – The HDF file/path to read the data
group_name (str) – The name of the group under which the data have been stored
- Returns:
- The
VolumetricData instance
- Return type:
pyiron.atomistics.volumetric.generic.VolumetricData
- static gauss_f(d, fwhm=0.529177)#
Generates a Gaussian distribution for a given distance and full width half maximum value
- Parameters:
d (float) – distance between target point and reference point
fwhm (float) – Full width half maximum in angstrom
- Returns:
Gaussian reduction constant
- Return type:
float
- get_average_along_axis(ind=2)#
Get the lateral average along a certain axis direction. This function is adapted from the pymatgen vasp VolumetricData class
http://pymatgen.org/_modules/pymatgen/io/vasp/outputs.html#VolumetricData.get_average_along_axis
- Parameters:
ind (int) – Index of axis (0, 1 and 2 for the x, y, and z axis respectively)
- Returns:
A 1D vector with the laterally averaged values of the volumetric data
- Return type:
numpy.ndarray
- read_cube_file(filename='cube_file.cube')#
Generate data from a CUBE file
- Parameters:
filename (str) – Filename to parse
- spherical_average_potential(structure, spherical_center, rad=2, fwhm=0.529177)#
Calculates the spherical average about a given point in space
- Parameters:
structure (pyiron_atomistics.atomistics.structure.Atoms) – Input structure
spherical_center (list/numpy.ndarray) – position of spherical_center in direct coordinate
rad (float) – radius of sphere to be considered in Angstrom (recommended value: 2)
fwhm (float) – Full width half maximum of gaussian function in Angstrom (recommended value: 0.529177)
- Returns:
Spherical average at the target center
- Return type:
float
- to_hdf(hdf, group_name='volumetric_data')[source]#
Writes the data as a group to a HDF5 file
- Parameters:
hdf (pyiron_base.generic.hdfio.ProjectHDFio) – The HDF file/path to write the data
group_name (str) – The name of the group under which the data must be stored
- property total_data#
Total volumtric data (3D)
- Type:
numpy.ndarray
- write_cube_file(filename='cube_file.cube', cell_scaling=1.0)#
Write the volumetric data into the CUBE file format
- Parameters:
filename (str) – Filename
cell_scaling (float) – Scale the cell by this fraction
- write_vasp_volumetric(filename='CHGCAR', normalize=False)#
Writes volumetric data into a VASP CHGCAR format
- Parameters:
filename (str) – Filename of the new file
normalize (bool) – True if the data is to be normalized by the volume