Skip to content

add support for Velox EMD files containing EELS spectrum images#522

Open
PauTorru wants to merge 4 commits into
hyperspy:mainfrom
PauTorru:velox-eels-reader
Open

add support for Velox EMD files containing EELS spectrum images#522
PauTorru wants to merge 4 commits into
hyperspy:mainfrom
PauTorru:velox-eels-reader

Conversation

@PauTorru

@PauTorru PauTorru commented Jun 2, 2026

Copy link
Copy Markdown

Description of the change

With the new Iliad TFS systems being installed now there are .emd files that contain both EDX and EELS spectrum images. This pull request allows the reader to get the data and metadata of the EELS datasets and create the hspy signals.

Main Changes:

  • hs.load("file.emd") loads EELS datasets if present.
  • implemented "_read_eels_spectrum_images" on the FeiEMDReader class

Progress of the PR

  • Change implemented (can be split into several points),
  • update docstring (if appropriate),
  • update user guide (if appropriate),
  • add a changelog entry in the upcoming_changes folder (see upcoming_changes/README.rst),
  • Check formatting of the changelog entry (and eventual user guide changes) in the docs/readthedocs.org:rosettasciio build of this PR (link in github checks)
  • add tests,
  • ready for review.

Minimal example of the bug fix or the new feature

from rsciio.emd import file_reader
from hyperspy.io import dict2signal

dictionaries = file_reader("file.emd")
signals = [dict2signal(i) for i in dictionaries]

print(any([s.metadata.Signal.signal_type=="EELS" and s.data.ndim>2 for s in signals])) # True

PauTorru added 2 commits June 2, 2026 16:59
With the new EELS detector from TFS, velox now produces .emd files that contain EELS datasets along with all previously existing datasets. The emd reader now looks for them and reads them properly.
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.26316% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.52%. Comparing base (06c95ac) to head (3af9675).

Files with missing lines Patch % Lines
rsciio/emd/_emd_velox.py 5.26% 53 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #522      +/-   ##
==========================================
- Coverage   88.88%   88.52%   -0.37%     
==========================================
  Files         113      113              
  Lines       13045    13102      +57     
  Branches     2414     2425      +11     
==========================================
+ Hits        11595    11598       +3     
- Misses        910      963      +53     
- Partials      540      541       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ericpre ericpre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick look, it looks good. It would need some test files - see guidelines in https://hyperspy.org/rosettasciio/contributing.html#making-test-data-files.

@PauTorru

Copy link
Copy Markdown
Author

pre-commit.ci autofix

@PauTorru

Copy link
Copy Markdown
Author

Looks like Eduardo beat me to it in PR #524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants