Add method to downsample EBSD patterns while maintaining data type range #592
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
HyperSpy's
Signal2D.rebin()
is a powerful tool for binning, but it does not rescale intensities. This can lead to memory problems. This PR adds aEBSD.downsample()
method which rescales intensities after binning before overwriting each pattern inplace. It only supports one integer binning factor which must be a divisor of both detector dimensions. Which data type to rescale intensities to can be specified. This of course leads to contrast between patterns being lost.Calling
EBSD.rebin()
followed byEBSD.rescale_intensity()
effectively gives the same result as callingEBSD.downsample()
.I also sorted EBSD methods into groups based on "types" (tools, feature maps, intensity processing [including
downsample()
], indexing etc.). This is the reason for the relatively large git diff.Closes #464.
Progress of the PR
Minimal example of the bug fix or new feature
For reviewers
__init__.py
.section in
CHANGELOG.rst
.release.py
,.zenodo.json
and.all-contributorsrc
with the table regenerated.