EELS curve fitting#

Performs curve fitting to an EELS spectrum, plots the result and saves it as png file.

import hyperspy.api as hs

s = hs.load("coreloss_spectrum.msa", signal_type="EELS")
low_loss = hs.load("lowloss_spectrum.msa", signal_type="EELS")

s.add_elements(("Mn", "O"))
s.set_microscope_parameters(
    beam_energy=300, convergence_angle=24.6, collection_angle=13.6
)

Create a model and fit it to the data.

Note

By default, generalized oscillator strength (GOS) calculated using density functional theory (DFT) are used. Use the GOS parameter to change to use other GOS, for example GOS="dirac".

m = s.create_model(low_loss=low_loss)
m.enable_fine_structure()
m.multifit(kind="smart")
/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/rsciio/utils/rgb_tools.py:62: VisibleDeprecationWarning: The module `rsciio.utils.rgb_tools` has been renamed to `rsciio.utils.rgb` and it will be removed in version 1.0. Use `RGB_DTYPES` instead
  warnings.warn(
/opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages/rsciio/utils/rgb_tools.py:62: VisibleDeprecationWarning: The module `rsciio.utils.rgb_tools` has been renamed to `rsciio.utils.rgb` and it will be removed in version 1.0.
  warnings.warn(

Plot the model fit result

coreloss_spectrum Signal

Total running time of the script: (0 minutes 2.731 seconds)

Gallery generated by Sphinx-Gallery