A small Python package and script to fit a parametrization of the absorptive scattering factor due to phonons.
The workflow of this code was designed by Dr. José Ángel Castellanos-Reyes. We acknowledge the abTEM multislice code for the compilation of parametrization data of elastic scattering factors.
The installation can be performed using pip:
$ pip install fabsfit
We use the parametrization data of abTEM. To download the files to the fabsfit data directory, run
$ fabsfit download
Alternatively you can save the data files also in any other directory using
$ fabsfit download /path/to/dir
fabsfit can be run in two ways: directly from the command line or as a Python package. Below we give examples of the syntax for both cases.
We can perform a fit of the absorptive scattering factor for Manganese (Mn) and a isotropic
$ fabsfit fit Mn 0.39
Help for more advanced usage options can be obtained with
$ fabsfit fit --help
The functionality in this package can be directly exposed in Python using
from fabsfit.parametrization import Parametrization
# Initializae a Parametrization object
param = Parametrization('doyleturner', 'doyleturner', 'Mn', 100, 0.39)
# perform the fit
param.fit()
The resulting fit would be equivalent to the fit in the example for the command line interface above.
The total scattering factor can be written as
for the purpose of electron scattering simulations, where
Here we focus on vibrational excitations and calculate the absorptive scattering factor for uncorrelated atomic motion as first considered by Hall and Hirsch (Hall and Hirsch, 1965).
Right now only the Doyle-Turner form, i.e.,
is supported, both for the elastic scattering factor
For development purposes, clone the repository
git clone https://github.com/pzeiger/fabsfit.git
and build the python package wheel using hatch
hatch -c build