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 a EBSD.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 by EBSD.rescale_intensity() effectively gives the same result as calling EBSD.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.
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
.CHANGELOG.rst
.release.py
,.zenodo.json
and.all-contributorsrc
with the table regenerated.