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.
Applied fix to Velox EMD
fft_dtype
to allow for FFT selection with odd numbers of pixels. Small 128x128 HAADF examples are provided, one with an FFT selection with odd number of pixels, one with an even number of pixels. The even selection works, the odd cannot be imported with hyperspy.Description of the change
There remains a small bug in reading Velox EMD files with FFTs. In
_read_image()
:fft_dtype = [('realFloatHalfEven', '<f4'), ('imagFloatHalfEven', '<f4')]
; however, this is not always the case. If, for example, an FFT is taken of a region with odd number of pixels, then Velox saves the data asfft_dtype = [('realFloatHalfOdd', '<f4'), ('imagFloatHalfOdd', '<f4')]
This issue causes
hs.load()
to fail in the presence of an FFT with odd number of pixels.In
emd.py
:fft_dtype
to accomodate odd pixel dimensions (line 1101):fft_dtype = [[('realFloatHalfEven', '<f4'),('imagFloatHalfEven', '<f4')],[('realFloatHalfOdd', '<f4'), ('imagFloatHalfOdd', '<f4')]]
dtype
check statement accordingly (line 1105):if h5data.dtype in fft_dtype or h5data.dtype == dpc_dtype:
Progress of the PR
upcoming_changes
folder (seeupcoming_changes/README.rst
),readthedocs
doc build of this PR (link in github checks)hyperspyComplexOddEven.zip
Minimal example of the bug fix or the new feature