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

apply_affine_transformation#

Diffraction2D.apply_affine_transformation(D, order=1, keep_dtype=False, inplace=True, *args, **kwargs)[source]#

Correct geometric distortion by applying an affine transformation.

Parameters:
  • D (array or Signal2D of arrays) – 3x3 np.array (or Signal2D thereof) specifying the affine transform to be applied.

  • order (1,2,3,4 or 5) – The order of interpolation on the transform. Default is 1.

  • keep_dtype (bool) – If True dtype of returned ElectronDiffraction2D Signal is that of the input, if False, casting to higher precision may occur.

  • inplace (bool) – If True (default), this signal is overwritten. Otherwise, returns a new signal.

  • *args – Arguments to be passed to hyperspy.api.signals.BaseSignal.map().

  • **kwargs – Keyword arguments to be passed to hyperspy.api.signals.BaseSignal.map().

Returns:

  • ElectronDiffraction2D Signal containing the affine Transformed

  • diffraction patterns.