structure_factor_utils.structure_factor.StructureFactor

class structure_factor_utils.structure_factor.StructureFactor(name, atoms)

Bases: ABC

Abstract base class for the scattering structure factor of a system.

Subclasses of StructureFactor implement different scattering techniques. The convention of expressing reciprocal space vectors in the reciprocal lattice basis, determinedined by the ase.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 StructureFactor with data from the .cif or .mcif file.

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 StructureFactor with data from the .cif or .mcif file.

A finite state machine is used to read file data.

Parameters:

cif_path (str) – path to the .cif (.mcif) file

Returns:

StructureFactor instance with file data

Return type:

StructureFactor

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 valid get_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