Check out the Hyperspy Workshop May 13-17, 2024 Online

get_elliptical_distortion#

CalibrationGenerator.get_elliptical_distortion(mask_radius, scale=100, amplitude=1000, spread=2, direct_beam_amplitude=500, asymmetry=1, rotation=0, center=None)[source]#

Determine elliptical distortion of the diffraction pattern.

Parameters:
  • mask_radius (int) – The radius in pixels for a mask over the direct beam disc (the direct beam disc within given radius will be excluded from the fit)

  • scale (float) – An initial guess for the diffraction calibration in 1/Angstrom units

  • amplitude (float) – An initial guess for the amplitude of the polycrystalline rings in arbitrary units

  • spread (float) – An initial guess for the spread within each ring (Gaussian width)

  • direct_beam_amplitude (float) – An initial guess for the background intensity from the direct beam disc in arbitrary units

  • asymmetry (float) – An initial guess for any elliptical asymmetry in the pattern (for a perfectly circular pattern asymmetry=1)

  • rotation (float) – An initial guess for the rotation of the (elliptical) pattern in radians.

  • center (None or list) – The center of the diffraction pattern.

Returns:

  • fit_params (np.array()) –

    Array of fitting parameters. [scale, amplitude, spread,

    direct_beam_amplitude, asymmetry, rotation].

  • affine_matrix (np.array()) – Array defining the affine transformation that corrects for lens distortions in the diffraction pattern.