Add fitting of a plane to projection centers #587
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
This PR adds the following functionality to
EBSDDetector
:fit_pc()
: Fit a plane to selected projection centers (PCs) using either a projective or affine transformation, following the work of Winkelmann et al. (https://doi.org/10.3390/ma13122816). This functionality is adapted from Winkelmann's xcdskd package (https://github.com/wiai/xcdskd).extrapolate_pc()
: Extrapolate a plane of PCs from a mean or single PC to a map of PCs, following the work of Singh et al. (https://doi.org/10.1107/S1600576717014200). This is used in EMsoft'sFitOrientation
program (no orientation correction, as they do, is currently implemented). This solves part of Orientation correction after dictionary indexing (and PC correction) before refinement #454.estimate_xtilt()
: Estimate tilt about detector X axis which brings the detector normal parallel to the sample normal, assuming no other tilts. Also adapted from xcdskd.estimate_xtilt_ztilt()
: Estimate tilts about detector X and Z axes which bring the detector normal parallel to the sample normal, assuming no other tilts. Also adapted from xcdskd.plot_pc()
: Plot PCs either in three maps or scatter plots (PCx, PCy), (PCx, PCz), (PCz, PCy), or in a 3D scatter plot (PCx, PCz, PCy).All methods are used in three examples added to the example gallery. They will also be used in tutorial notebooks coming in a follow-up PR.
Other changes/additions:
kikuchipy.draw.plot_pattern_positions_in_map()
convenience function to plot pattern positions (e.g. those we use for PC fitting) on a 2D map. Is used in an example, will be used in coming new tutorials.Progress of the PR
For reviewers
__init__.py
.section in
CHANGELOG.rst
.release.py
,.zenodo.json
and.all-contributorsrc
with the table regenerated.