Skip to content

Add EPU XML decoding and a cross-source acquisition check - #2

Merged
aaronkanzer merged 1 commit into
mainfrom
feat/acquisition-check
Oct 10, 2026
Merged

aaronkanzer merged 1 commit into
mainfrom
feat/acquisition-check

Conversation

@aaronkanzer

Copy link
Copy Markdown
Member

Adds decode_epu_xml and compare_acquisition.

decode_epu_xml reads the acquisition settings from an EPU image XML: voltage, pixel size as recorded, binning, super-resolution factor, fractions, exposure, dose, applied defocus, detector and energy-filter slit. It is not auto-dispatched, since .xml is too generic an extension to claim. epu_pixel_size_candidates lists the plausible pixel sizes for the saved movie, because EPU records the pixel size of the binned grid.

compare_acquisition takes values from any number of sources (collection sheet, EPU, movie header, RELION or CryoSPARC optics, a deposit) and reports disagreements in voltage, pixel size, dose, frame count, Cs and magnification, worst first. With target_resolution_a it also flags a pixel size whose Nyquist limit cannot reach the target. It does not decide which source is right.

Why: a processing run used 300 kV for data recorded at 200 kV. Nothing failed; the map just stalled several angstrom short of the published one. The check makes that kind of disagreement visible before compute is spent.

Checked against:

  • the existing suite (199 tests pass) plus 13 new ones
  • a real EPU XML, parsed locally with no data added to this repo; the tests use a synthetic document
  • the public EMD-0731 numbers for the voltage case

No version bump and no tag, so nothing publishes on merge. The change sits under Unreleased in the changelog.

decode_epu_xml reads voltage, pixel size as recorded, binning, super-resolution
factor, fractions, exposure, dose, applied defocus, detector and energy-filter
slit from an EPU image XML. It is not registered for automatic dispatch because
.xml is too generic an extension to claim. epu_pixel_size_candidates lists the
plausible pixel sizes for the saved movie, since EPU records the binned grid.

compare_acquisition cross-checks voltage, pixel size, dose, frame count, Cs and
magnification across any number of sources (collection sheet, EPU, movie header,
RELION or CryoSPARC optics, a deposit) and reports disagreements with a severity.
With target_resolution_a it also flags a pixel size whose Nyquist limit cannot
reach the target.

Motivation: a processing run used 300 kV for data recorded at 200 kV and stalled
well short of the published resolution without raising any error.

Tests use a synthetic EPU document so no collection data enters this public repo.
@aaronkanzer
aaronkanzer merged commit 52d6be6 into main Oct 10, 2026
3 checks passed
@aaronkanzer aaronkanzer mentioned this pull request Oct 11, 2026
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