model_simulation1d#

ElectronDiffraction1D.model_simulation1d(simulation, power_law_background=True, starting_scale=None, auto_limit_peaks=True, center_lim=0.05, fit=True)[source]#

Creates a model for fitting diffraction peaks for a ring pattern using a series of Gaussians.

This is primarily useful for calibration but could be potentially used for other things like phase segmentation from 1D diffraction patterns. The lack of a parallel option for model fitting in hyperspy limits that usefulness for 4D STEM. If that is something you are interested in doing,

raise an issue for more discussion.

Parameters:
  • simulation (diffsims.simulations.Simulation1D) – The simulation of a 1D “powder” diffraction pattern.

  • power_law_background (bool) – Whether to include a power law background in the model.

  • starting_scale (float) – The starting scale for the model. If None, the maximum peak intensity in the simulation is used. Note that removing the zero peak is generally a good idea to help with fitting.

  • auto_limit_peaks (bool) – Whether to automatically guess some reasonable parameters for the Gaussian peaks and bounds.

  • fit (bool) – Whether to fit the model. If False, the model is returned unfitted.

Returns:

model – The model for fitting the diffraction peaks to a 1D diffraction pattern.

Return type:

hyperspy.models.Model1D

Notes

This functionality is still under development and may change slightly in the future.