{ "cells": [ { "cell_type": "markdown", "metadata": { "nbsphinx": "hidden" }, "source": [ "This notebook is part of the `kikuchipy` documentation https://kikuchipy.org.\n", "Links to the documentation won't work from the notebook." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Fit a plane to selected projection centers\n", "\n", "In this tutorial, we will fit a plane to projection centers (PCs).\n", "The PCs are determined from a (5, 5) grid of EBSD patterns from a single crystal silicon wafer.\n", "The resulting fitted plane contains one PC per pattern in the dataset from which the grid is obtained.\n", "This plane of PCs can be used in subsequent indexing of the dataset.\n", "To relate the sample positions of the grid to the PCs, we will test both an affine transformation and a projective transformation. These transformations are based on the work by Winkelmann et al. (2020).\n", "\n", "We'll start by importing necessary libraries" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import skimage.filters as skf\n", "\n", "from diffsims.crystallography import ReciprocalLatticeVector\n", "import kikuchipy as kp\n", "from orix.crystal_map import PhaseList\n", "\n", "\n", "plt.rcParams.update(\n", " {\n", " \"figure.facecolor\": \"w\",\n", " \"figure.dpi\": 75,\n", " \"figure.figsize\": (8, 8),\n", " \"font.size\": 15,\n", " }\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load and inspect data\n", "\n", "Load data lazily (~500 MB) and inspect its shape and step size" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "tags": [ "nbval-ignore-output" ] }, "outputs": [ { "data": { "text/html": [ "
\n",
"
| \n",
" \n",
"
| \n",
"