Skip to content

Commit

Permalink
Merge 632993e into 79daffd
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonanes committed Jan 8, 2023
2 parents 79daffd + 632993e commit 5ed2ef2
Show file tree
Hide file tree
Showing 22 changed files with 5,307 additions and 662 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Unreleased

Added
-----
- Two tutorials showing projection center (PC) fitting and extrapolation to obtain a
plane of PCs to index a full dataset.
(`#588 <https://github.com/pyxem/kikuchipy/pull/588>`_)
- Tutorial showing sloppy projection center (PC)/orientation optimization landscape of
the Ni dataset from Jackson et al. (2019), replicating the results from Pang et al.
(2020). (`#588 <https://github.com/pyxem/kikuchipy/pull/588>`_)
- Method ``EBSDDetector.fit_pc()`` to fit a plane using a projective or affine
transformation to projection centers following work by Winkelmann and co-workers
(2020). (`#587 <https://github.com/pyxem/kikuchipy/pull/587>`_)
Expand Down Expand Up @@ -64,6 +70,8 @@ Added

Changed
-------
- Exclude documentation and tests from source distribution.
(`#588 <https://github.com/pyxem/kikuchipy/pull/588>`_)
- Minimal version of HyperSpy increased to >= 1.7.3.
(`#585 <https://github.com/pyxem/kikuchipy/pull/585>`_)
- Minimal version of Numba increased to >= 0.52.
Expand Down
12 changes: 2 additions & 10 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
include CHANGELOG.rst
include CODE_OF_CONDUCT.rst
include CONTRIBUTING.rst
include CODE_OF_CONDUCT.rst
include environment.yml
include kikuchipy/hyperspy_extension.yaml
include LICENSE
include MANIFEST.in
include README.md
include readthedocs.yaml
include RELEASE.rst
include setup.cfg
include setup.py
include tutorials/README.rst

recursive-include doc Makefile make.bat *.rst *.py *.bib *.ipynb *.txt *.cfg *.sh
recursive-include doc/_static *.png *.jpg *.svg *.css *.sh

recursive-include kikuchipy/data *
recursive-include examples *.rst *.py

recursive-include benchmarks *.py
recursive-include kikuchipy/data *
375 changes: 185 additions & 190 deletions doc/tutorials/esteem2022_diffraction_workshop.ipynb

Large diffs are not rendered by default.

73 changes: 42 additions & 31 deletions doc/tutorials/feature_maps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"[zero-mean normalized](pattern_processing.ipynb#Normalize-intensity) before\n",
"computing $Q$, we must pass `get_image_quality(normalize=False)`.\n",
"\n",
"Let's compute the image quality $Q$ and plot it for the entire data set"
"Let's compute the image quality $Q$ and plot it for the entire data set (using the [CrystalMap.plot()](https://orix.readthedocs.io/en/stable/reference/generated/orix.crystal_map.CrystalMap.plot.html#orix.crystal_map.CrystalMap.plot) method of the [EBSD.xmap](../reference/generated/kikuchipy.signals.EBSD.xmap.rst) attribute)"
]
},
{
Expand All @@ -155,13 +155,23 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"nbsphinx-thumbnail": {
"tooltip": "Extraction of information from pattern intensities"
},
"tags": [
"nbsphinx-thumbnail"
]
},
"outputs": [],
"source": [
"plt.figure(figsize=(10, 6))\n",
"plt.imshow(iq, cmap=\"gray\")\n",
"plt.colorbar(label=r\"Image quality, $Q$\", pad=0.01)\n",
"_ = plt.axis(\"off\")"
"s.xmap.plot(\n",
" iq.ravel(),\n",
" cmap=\"gray\",\n",
" colorbar=True,\n",
" colorbar_label=\"Image quality, $Q$\",\n",
" remove_padding=True,\n",
")"
]
},
{
Expand Down Expand Up @@ -199,20 +209,16 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"nbsphinx-thumbnail": {
"tooltip": "Extraction of information from pattern intensities"
},
"tags": [
"nbsphinx-thumbnail"
]
},
"metadata": {},
"outputs": [],
"source": [
"plt.figure(figsize=(10, 6))\n",
"plt.imshow(adp, cmap=\"gray\")\n",
"plt.colorbar(label=\"Average dot product\", pad=0.01)\n",
"_ = plt.axis(\"off\")"
"s.xmap.plot(\n",
" adp.ravel(),\n",
" cmap=\"gray\",\n",
" colorbar=True,\n",
" colorbar_label=\"Average dot product\",\n",
" remove_padding=True,\n",
")"
]
},
{
Expand Down Expand Up @@ -265,10 +271,13 @@
"source": [
"adp2 = s.get_average_neighbour_dot_product_map(window=w2)\n",
"\n",
"plt.figure(figsize=(10, 6))\n",
"plt.imshow(adp2, cmap=\"gray\")\n",
"plt.colorbar(label=\"Average dot product\", pad=0.01)\n",
"_ = plt.axis(\"off\")"
"s.xmap.plot(\n",
" adp2.ravel(),\n",
" cmap=\"gray\",\n",
" colorbar=True,\n",
" colorbar_label=\"Average dot product\",\n",
" remove_padding=True,\n",
")"
]
},
{
Expand Down Expand Up @@ -331,9 +340,9 @@
"\n",
"s2 = s.inav[x - x_n : x + x_n + 1, y - y_n : y + y_n + 1].deepcopy()\n",
"s2.rescale_intensity(percentiles=(0.5, 99.5)) # Stretch the contrast a bit\n",
"s3 = (\n",
" s2 * s_dp_matrices.inav[x, y].T\n",
") # Signals must have same navigation shape"
"\n",
"# Signals must have same navigation shape (warning can be ignored)\n",
"s3 = s2 * s_dp_matrices.inav[x, y].T"
]
},
{
Expand Down Expand Up @@ -389,11 +398,13 @@
"metadata": {},
"outputs": [],
"source": [
"plt.figure(figsize=(10, 6))\n",
"plt.imshow(adp3, cmap=\"gray\")\n",
"plt.colorbar(label=\"Average dot product\", pad=0.01)\n",
"plt.scatter(x=x, y=y, marker=\"o\", c=\"r\", s=50)\n",
"_ = plt.axis(\"off\")"
"s.xmap.plot(\n",
" adp3.ravel(),\n",
" cmap=\"gray\",\n",
" colorbar=True,\n",
" colorbar_label=\"Average dot product\",\n",
" remove_padding=True,\n",
")"
]
}
],
Expand All @@ -413,7 +424,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.8"
}
},
"nbformat": 4,
Expand Down
28 changes: 14 additions & 14 deletions doc/tutorials/geometrical_ebsd_simulations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@
"metadata": {},
"outputs": [],
"source": [
"ref = ReciprocalLatticeVector(\n",
"rlv = ReciprocalLatticeVector(\n",
" phase=phase, hkl=[[1, 1, 1], [2, 0, 0], [2, 2, 0], [3, 1, 1]]\n",
")\n",
"ref"
"rlv"
]
},
{
Expand All @@ -171,8 +171,8 @@
"metadata": {},
"outputs": [],
"source": [
"ref = ref.symmetrise().unique()\n",
"ref.size"
"rlv = rlv.symmetrise().unique()\n",
"rlv.size"
]
},
{
Expand All @@ -181,7 +181,7 @@
"metadata": {},
"outputs": [],
"source": [
"ref.print_table()"
"rlv.print_table()"
]
},
{
Expand All @@ -190,8 +190,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Dictionary with {hkl} as key and indices into `ref` as values\n",
"hkl_sets = ref.get_hkl_sets()\n",
"# Dictionary with {hkl} as key and indices into ReciprocalLatticeVector as values\n",
"hkl_sets = rlv.get_hkl_sets()\n",
"hkl_sets"
]
},
Expand All @@ -201,7 +201,7 @@
"metadata": {},
"outputs": [],
"source": [
"hkl_colors = np.zeros((ref.size, 3))\n",
"hkl_colors = np.zeros((rlv.size, 3))\n",
"for idx, color in zip(\n",
" hkl_sets.values(),\n",
" [\n",
Expand All @@ -221,7 +221,7 @@
"outputs": [],
"source": [
"hkl_labels = []\n",
"for hkl in ref.hkl.round(0).astype(int):\n",
"for hkl in rlv.hkl.round(0).astype(int):\n",
" hkl_labels.append(str(hkl).replace(\"[\", \"(\").replace(\"]\", \")\"))"
]
},
Expand All @@ -231,7 +231,7 @@
"metadata": {},
"outputs": [],
"source": [
"ref.scatter(c=hkl_colors, grid=True, ec=\"k\", vector_labels=hkl_labels)"
"rlv.scatter(c=hkl_colors, grid=True, ec=\"k\", vector_labels=hkl_labels)"
]
},
{
Expand All @@ -247,7 +247,7 @@
"metadata": {},
"outputs": [],
"source": [
"ref.draw_circle(\n",
"rlv.draw_circle(\n",
" color=hkl_colors, hemisphere=\"both\", figure_kwargs=dict(figsize=(15, 10))\n",
")"
]
Expand All @@ -270,7 +270,7 @@
"outputs": [],
"source": [
"rot = s.xmap.rotations\n",
"rot = rot.reshape(*s.axes_manager.navigation_shape[::-1])\n",
"rot = rot.reshape(*s.xmap.shape)\n",
"rot # Quaternions"
]
},
Expand Down Expand Up @@ -317,7 +317,7 @@
"metadata": {},
"outputs": [],
"source": [
"simulator = kp.simulations.KikuchiPatternSimulator(ref)"
"simulator = kp.simulations.KikuchiPatternSimulator(rlv)"
]
},
{
Expand Down Expand Up @@ -479,7 +479,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.8"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 5ed2ef2

Please sign in to comment.