Skip to content

feat!: Sample.elements, metadata groups and segment times of Velox single spectra - #44

Merged
Paullo9 merged 1 commit into
mainfrom
issue-10-velox-spectra
Oct 30, 2026
Merged

Paullo9 merged 1 commit into
mainfrom
issue-10-velox-spectra

Conversation

@Paullo9

@Paullo9 Paullo9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Requested by Paul · project thread

Part of #10 (item 2 of the 29 Oct plan). Independent of #43 (item 1). Still open from #10:

  • item 3: partial PixelSize/Offset, detector name and Ceta date, re-measured against RosettaSciIO on the real files first;
  • item 4: camera pixel pitch. Found while looking: none of RosettaSciIO's 15 public Velox files states a physical camera pitch (Detectors.* carries only Binning), and RosettaSciIO maps DM's Acquisition.Device.CCD.Pixel Size (um) for CL signals only, so item 4 needs a file that states it before a field is added.

What changes

  • VeloxSpectrumSignals maps Sample.elements as HyperSpy sets it when it applies RosettaSciIO's _convert_element_list (d.keys()[0] on HyperSpy's DictionaryTreeBrowser: the first of the sorted, slugified keys; atomic_number2name 1 to 119; SharedProperties/EDSSpectrumQuantificationSettings from version 11, Operations/ImageQuantificationOperation before).
  • The four file-level groups (Displays, Operations, SharedProperties, Features) are parsed as read_file parses them (shared with VeloxTitles); the read is refused wherever RosettaSciIO or HyperSpy raises, int(version) and the version key included.
  • FormatoValue.texts([String]) holds the list (with a texts accessor).
  • VeloxEMDReader.spectrumMetadata() and VeloxMetadata.binaryResultSegmentTimes: each spectrum's live and real time as Velox 4 to 13 store them per segment in Detectors (RosettaSciIO maps only DetectorMetadata.*, which no public spectrum holds). Not in the signals' metadata, which stays RosettaSciIO's.
  • FormatoLoader.load keeps a Velox file's images when its spectra are refused (as it already does for spectrum images).
  • docs/parity.md and docs/open-items.md updated, with the deviations left.

Migration

An exhaustive switch over FormatoValue needs a .texts arm (or default). The suite's apps have none.

Tests

  • tools/velox-elements/pins.py: 20 planted files, read by RosettaSciIO 049e7d70 with the mapping applied by HyperSpy 2.4.0's own DictionaryTreeBrowser, plus the public files (Test SI 16x16 215 kx.emd gives ["C", "O", "Ca", "Cu"], as RosettaSciIO's own test).
  • VeloxSpectrumElementsTests: the elements exact or the refusal (unsupported, "RosettaSciIO raises") for every file, a case whose slugified order differs from the raw order, a slugify table checked against HyperSpy, the segment times to the bit, and the public files when unzipped.
  • swift test -c release --parallel --skip FormatoKitParityTests: green, except the HDF5 exit-barrier test, which needs FORMATO_HDF5_PATH from tools/test.sh (environment, not this change).
  • Reviewed before commit (public API). The findings are fixed: slug-order fixture, specific refusal checks, _-prefixed keys, duplicate slugs refused, HDF5 errors no longer hidden in spectrumMetadata(), docs.

🤖 Generated with Claude Code

…s of Velox single spectra

VeloxSpectrumSignals maps Sample.elements as HyperSpy sets it when it applies
RosettaSciIO's _convert_element_list (the first of DictionaryTreeBrowser's sorted,
slugified keys; atomic_number2name 1 to 119), parses Displays, Operations,
SharedProperties and Features as read_file does, and refuses the read wherever
RosettaSciIO or HyperSpy raises (int(version) included). FormatoValue gains a
.texts([String]) case for the list. VeloxEMDReader.spectrumMetadata() and
VeloxMetadata.binaryResultSegmentTimes give each spectrum's live and real times as
Velox 4 to 13 store them in Detectors. FormatoLoader.load keeps the images of a file
whose spectra are refused. Pinned by tools/velox-elements/pins.py (planted and public).

Migration: an exhaustive switch over FormatoValue needs a .texts arm (or default).

Done: issue 10 item 2 (single spectra). Next: item 3 (partial PixelSize/Offset,
detector name, Ceta date) and item 4 (camera pixel pitch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Paullo9 Paullo9 self-assigned this Oct 30, 2026
@Paullo9
Paullo9 merged commit d941fad into main Oct 30, 2026
8 checks passed
@Paullo9
Paullo9 deleted the issue-10-velox-spectra branch October 30, 2026 11:12
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.

1 participant