get_orientation#

PolarDiffraction2D.get_orientation(simulation, n_keep=None, frac_keep=0.1, n_best=1, normalize_templates=True, **kwargs)[source]#

Match the orientation with some simulated diffraction patterns using an accelerated orientation mapping algorithm. The details of the algorithm are described in the paper: “Free, flexible and fast: Orientation mapping using the multi-core and

GPU-accelerated template matching capabilities in the python-based open source 4D-STEM analysis toolbox Pyxem”

Parameters:
  • simulation (DiffractionSimulation) – The diffraction simulation object to use for indexing.

  • n_keep (int) – The number of orientations to keep for each diffraction pattern.

  • frac_keep (float) – The fraction of the best matching orientations to keep.

  • n_best (int) – The number of best matching orientations to return. If n_best == -1 all of the orientations and correlations are returned.

  • normalize_templates (bool) – Normalize the templates to the same intensity..

  • kwargs (dict) – Any additional options for the map() function.

Returns:

orientation – A signal with the orientation at each navigation position.

Return type:

BaseSignal

Notes

If n_best exceeds n_keep or frac_keep * N for N simulations, then full correlation is performed on n_best simulations instead. This ensures the output contains n_best simulations.

A gamma correction is often applied to the diffraction patterns. A good value to start with is the square root (gamma=0.5) of the diffraction patterns to increase the intensity of the low intensity reflections and decrease the intensity of the high intensity reflections. This can be applied via:

s_gamma = s**0.5

In most cases gamma < 1 See [CCAAnes+22] for more information. Additionally, subtracting a small value can sometimes be helpful as it penalizes diffraction patterns which do not have the full compliment of simulated diffraction vectors.

References

[CCAAnes+22]

Niels Cautaerts, Phillip Crout, Håkon Wiik Ånes, Eric Prestat, Jiwon Jeong, Gerhard Dehm, and Christian H Liebscher. Free, flexible and fast: orientation mapping using the multi-core and gpu-accelerated template matching capabilities in the python-based open source 4d-stem analysis toolbox pyxem. Ultramicroscopy, pages 113517, 2022. doi:10.1016/j.ultramic.2022.113517.