{ "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": [ "# Metadata structure\n", "\n", "The [EBSD](reference.rst#kikuchipy.signals.EBSD) class stores metadata in the\n", "`metadata` attribute provided by HyperSpy" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# exchange inline for qt5 for interactive plotting from the pyqt package\n", "%matplotlib inline\n", "\n", "import matplotlib.pyplot as plt\n", "import kikuchipy as kp\n", "\n", "\n", "s = kp.data.nickel_ebsd_small()\n", "s" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "s.metadata" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "While kikuchipy's EBSD\n", "([ebsd_metadata()](reference.rst#kikuchipy.signals.util.ebsd_metadata)) metadata\n", "structure is based on\n", "[HyperSpy's metadata structure](http://hyperspy.org/hyperspy-doc/current/user_guide/metadata_structure.html),\n", "it includes the nodes `Acquisition_instrument.Sample.Phases` to store phase\n", "information and `Acquisition_instrument.SEM.Detector.EBSD` for acquisition\n", "information. The information in these nodes are written, along with the\n", "patterns, to file when saving an EBSD signal in the\n", "[kikuchipy h5ebsd format](load_save_data.ipynb#h5ebsd)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "kp.signals.util.ebsd_metadata()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The complete list of metadata looks like this\n", "\n", "```\n", " ├── Acquisition_instrument\n", " │ └── SEM\n", " │ ├── Detector\n", " │ │ └── EBSD\n", " │ │ ├── azimuth_angle [º]\n", " │ │ ├── binning\n", " │ │ ├── detector\n", " │ │ ├── elevation_angle [º]\n", " │ │ ├── exposure_time [s]\n", " │ │ ├── frame_number\n", " │ │ ├── frame_rate [1/s]\n", " │ │ ├── gain [dB]\n", " │ │ ├── grid_type\n", " │ │ ├── manufacturer\n", " │ │ ├── sample_tilt [º]\n", " │ │ ├── scan_time [s]\n", " │ │ ├── static_background (numpy.ndarray)\n", " │ │ ├── version\n", " │ │ ├── xpc\n", " │ │ ├── ypc\n", " │ │ └── zpc\n", " │ ├── beam_energy [kV]\n", " │ ├── magnification\n", " │ ├── microscope\n", " │ └── working_distance [mm]\n", " └── Sample\n", " └── Phases\n", " └── 1\n", " ├── atom_coordinates\n", " │ └── 1\n", " │ ├── atom\n", " │ ├── coordinates (x0, y0, z0)\n", " │ ├── debye_waller_factor [nm^2]\n", " │ └── site_occupation\n", " ├── formula\n", " ├── info\n", " ├── lattice_constants (a, b, c and alfa, beta, gamma) [nm and º]\n", " ├── laue_group\n", " ├── material_name\n", " ├── point_group\n", " ├── setting\n", " ├── source\n", " ├── space_group\n", " └── symmetry\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The utility function\n", "[metadata_nodes()](reference.rst#kikuchipy.signals.util.metadata_nodes) returns\n", "the node strings for the `SEM` and `EBSD` nodes for convenience.\n", "\n", "