Add support for EDAX line scan data - #485
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #485 +/- ##
=======================================
Coverage 88.88% 88.88%
=======================================
Files 113 113
Lines 13045 13082 +37
Branches 2414 2420 +6
=======================================
+ Hits 11595 11628 +33
- Misses 910 911 +1
- Partials 540 543 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ericpre
left a comment
There was a problem hiding this comment.
Thank you @AndrewHerzing for the pull request!
It would be good to refactor the spd_reader and lsd_reader function because they share a lot of the some code!
The test suite failure are unrelated to this PR.
Appended "lsd" and "LSD" to list of supported file extensions specifications.yaml for EDAX reader.
Added files are line_scan.spc, line_scan.lsd, line_scan.csv
Added missing csv_fname argument to file_reader and fixed some issues with the way the csv header was being stored in the metadata.
Used TestSpdMap_070_eds as a template and updated for data shape and expected parameters
… for file_reader lsd_reader was missing docstring entries for some arguements. The .lsd (line scan) was added to the description of the file_reader function. Also corrected a typo related to the EDAX TEAM software, which should be "TEAM" instead of "TEAMS".
Note that the file specification is the same as .spd, so I just linked to the existing .spd file specification pdf.
51a24cf to
0603276
Compare
|
The suggested changes have now all been implemented. These changes are:
@ericpre I think this is ready for another round of review |
There was a problem hiding this comment.
Pull request overview
Adds EDAX .lsd (1D line scan) support to the EDAX reader by reusing the existing SPD/SPC parsing and adding CSV-based spatial calibration, with corresponding documentation and tests.
Changes:
- Extend EDAX reader to accept
.lsdfiles and read spatial calibration from a companion.csv. - Add test coverage for
.lsdline scan loading and update the EDAX test data registry hash. - Update EDAX documentation/spec references and add a Towncrier changelog fragment.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| upcoming_changes/485.enhancements.rst | Adds changelog entry for EDAX line scan support |
| upcoming_changes/475.enhancements.rst | Adds an additional changelog fragment (scope relevance needs confirmation) |
| rsciio/tests/test_edax.py | Adds tests validating .lsd loading, metadata, axes, and CSV parsing |
| rsciio/tests/registry.txt | Updates the checksum for edax_files.zip test data |
| rsciio/edax/specifications.yaml | Registers .lsd extension and updates EDAX format description |
| rsciio/edax/_api.py | Implements .lsd reading + CSV spatial axis handling via shared reader path |
| doc/supported_formats/supported_formats.rst | Updates supported formats table (currently contains unresolved conflict markers) |
| doc/supported_formats/edax.rst | Updates EDAX user guide docs for .lsd behavior |
| doc/file_specification/index.rst | Adds .lsd entry to file specification downloads list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Initialized csv_header as OrderedDict and initialized spatial_axis_calibration and spatial_axis_offset variables to 1 and 0, respectively, to prevent unbounded variable errors.
Previously, `filename`, `lazy`, and `enidanness` were all desribed.
The main file_reader function defined the keywords argument as **kwargs. Elsewhere in the code this was mistakenly set as **kwds. All kwds entries were changed to kwargs
The lsd_reader is for line scan data while the spd_reader is for 2D hyperspectral image scans. The two sepearte functions shared a lot of code so in this commit they have been combined into a single reader function
456bdda to
293f532
Compare
293f532 to
7473481
Compare
Description of the change
Addresses issue #479
The EDAX reader can read
.spdfiles which are the output from a 2D EDS mapping acquisition. It cannot currently read the.lsdfile format which results from a 1D EDS line scan acquisition. Support for this format would be very nice to have. Since the actual file structure of the.lsdfiles are the same as the.spdfiles this is fairly easy to implement. The major difference between the two types of data is that the spatial calibration information for mapping data is stored in a.iprfile while it is stored as a column in a.csvfile for the line scan data.Progress of the PR
upcoming_changesfolder (seeupcoming_changes/README.rst),docs/readthedocs.org:rosettasciiobuild of this PR (link in github checks)Minimal example of the bug fix or the new feature
Since the format of the
.lsdfiles are exactly the same as the.spdfiles, I simply referred to the PDF for the.spdspecification in the EDAXindex.rst.Also, one item to consider for future functionality is the ability to read in the image detector output for the line scan data. This is stored in a single column of the CSV file and is readily accessible. However, the reader only returns the spectral line scan data. Perhaps the image detector signal could be store in the metadata or a helper function could be added?