structure_factor_utils.structure_factor.StructureFactor
- class structure_factor_utils.structure_factor.StructureFactor(name, atoms)
Bases:
ABCAbstract base class for the scattering structure factor of a system.
Subclasses of
StructureFactorimplement different scattering techniques. The convention of expressing reciprocal space vectors in the reciprocal lattice basis, determinedined by thease.Cell.reciprocal()(fractional coordinates). This includes scattering vectors.- Parameters:
name (str) – the name of the system
atoms (
ase.Atoms) – information about atoms in the system unit cell
- __init__(name, atoms)
Constructor method
Methods
__init__(name, atoms)Constructor method
from_cif(cif_path)Instantiates
StructureFactorwith data from the.cifor.mciffile.get_form_factor(scattering_vector)Abstract method dfor calculating the scattering form factor
get_sf_norm(scattering_vector)Calculates norm of structure factor given a scattering vector
get_structure_factor(scattering_vector)Abstract method for calculating the structure factor
- classmethod from_cif(cif_path)
Instantiates
StructureFactorwith data from the.cifor.mciffile.A finite state machine is used to read file data.
- Parameters:
cif_path (str) – path to the .cif (.mcif) file
- Returns:
StructureFactorinstance with file data- Return type:
- abstract get_form_factor(scattering_vector) float
Abstract method dfor calculating the scattering form factor
- Parameters:
scattering_vector (tuple[float, float, float]) – reciprocal space scattering vector, in reciprocal lattice basis
- Returns:
scattering form factor at the given scattering vector
- Return type:
float
- get_sf_norm(scattering_vector) float
Calculates norm of structure factor given a scattering vector
Note
Implementations of
get_structure_factor()that return vectors must use a Cartesian basis for validget_sf_norm().- Parameters:
scattering_vector (tuple[float, float, float]) – reciprocal space scattering vector, in reciprocal lattice basis
- Returns:
norm of the structure factor
- Return type:
float
- abstract get_structure_factor(scattering_vector)
Abstract method for calculating the structure factor
- Parameters:
scattering_vector (tuple[float, float, float]) – reciprocal space scattering vector, in reciprocal lattice basis