Closed Jordi-W closed 4 months ago
Thanks @Jordi-W for the bug report. From reading the code, there is indeed a bug but not the one that you describe, there is the lazy version that has the issue! 😉 See #287 for a fix with a test that checks that the sum of each stream are different.
Describe the bug
According to documentation, using
hs.load()
with argumentsum_EDS_detectors=True
on an .edm file with spectral images from multiple detectors combines the spectra from the different detectors. However, a correctly combined spectral image is not produced. Instead, iflazy=False
, the resulant image is just the same as that from the first detector, whilst iflazy=True
, instead the resultant image is the image from the first detector multiplied by the total number of detectorsTo Reproduce
Have a valid .edm file called "Test.edm" with data from 4 EDS detectors
Expected behavior
Instead,
hs.load( sum_EDS_detectors=True)
should sum data from all detectors.Python environment:
Additional context
I believe that I have a fix for the problem. In /rsciio/emd_emd_velox.py, change
to
With this alteration, the example code above produces correct results. As I am new to HyperSpy, it would be best if this could be reviewed by a more experienced pair of eyes.