This notebook is part of the
kikuchipy documentation https://kikuchipy.org.
Links to the documentation won't work from the notebook.
The EBSD and EBSDMasterPattern signals have a powerful and versatile plot() method provided by HyperSpy. Its uses are greatly detailed in HyperSpy's visualisation user guide. This section details example uses specific to EBSD and EBSDMasterPattern signals.
Let's import the necessary libraries and a Nickel EBSD test data set Ånes et al. (2019):
# Exchange inline for notebook or qt5 (from pyqt) for interactive plotting %matplotlib inline import hyperspy.api as hs import kikuchipy as kp import matplotlib.pyplot as plt import numpy as np from orix import io, plot, quaternion, vector import skimage.exposure as ske import skimage.transform as skt # Use kp.load("data.h5") to load your own data s = kp.data.nickel_ebsd_large(allow_download=True) # External download s
Correlating results from e.g. crystal and phase structure determination, i.e.
indexing, with experimental patterns can inform their interpretation. When
plot() without any input parameters, the navigator map is a grey scale
image with pixel values corresponding to the sum of all detector intensities
within that pattern:
The upper panel shows the navigation axes, in this case 2D, with the current beam position in the upper left corner shown as a red square the size of one pixel. This square can be made larger/smaller with +/-. The square can be moved either by the keyboard arrows or the mouse. The lower panel shows the image on the detector in the current beam position.
vbse_gen = kp.generators.VirtualBSEGenerator(s) print(vbse_gen) print(vbse_gen.grid_shape)
vbse_rgb = vbse_gen.get_rgb_image(r=(3, 1), b=(3, 2), g=(3, 3)) vbse_rgb
iq = s.get_image_quality() s_iq = hs.signals.Signal2D(iq) s.plot(navigator=s_iq, scalebar=False)
rgb_z = plt.imread("../_static/image/visualizing_patterns/ni_large_rgb_z.png") rgb_z = rgb_z[..., :3] # Drop the alpha channel s_rgb_z = kp.draw.get_rgb_navigator(rgb_z) s.plot(navigator=s_rgb_z, colorbar=False)
HyperSpy provides the function plot_signals() to plot multiple signals with the same navigator, as explained in their user guide. This enables e.g. plotting of experimental and best matching simulated patterns side-by-side as a visual inspection of indexing results. See the pattern matching user guide for a demonstration.
# Only a single energy, 20 keV mp_stereo = kp.data.nickel_ebsd_master_pattern_small( projection="stereographic", hemisphere="both" ) print(mp_stereo.axes_manager)
As can be seen from the axes manager, the master pattern has two navigation axes, a north and south hemisphere, thus, when plotting, we get a slider as a navigator when plotting: