Skip to content

ekscn: read through dcio (M2) - #6

Merged
remislp merged 1 commit into
masterfrom
m2-shims
Sep 2, 2026
Merged

remislp merged 1 commit into
masterfrom
m2-shims

Conversation

@remislp

@remislp remislp commented Sep 2, 2026

Copy link
Copy Markdown
Member

M2 of the record-layer plan. EKDIST carried a second implementation of the SCN
binary decoding, and two copies of a format parser is two places for a record
to be read differently. It was: the interval array is stored as 4-byte floats,
and under NEP 50 the millisecond-to-second multiply stayed in single precision
here, discarding most of the digits the file carries.

read_data now delegates to dcio.formats.scn.read. Verified identical
before the change
on both shipped records — intervals equal bit for bit
(max difference 0), raw amplitudes and flags equal, and the same trailing-gap
trim.

The contract is unchanged: amplitudes come back as raw stored integers, not pA,
because that is what this has always returned and what load_SCN_file scales
by calfac2. dcio applies the calibration on read, so it is divided back out.
That round trip is exercised on 181003S8.SCN, whose calfac2 is 0.0025
rather than 1 — with a test asserting it stays non-unit, so the check cannot
quietly become vacuous.

Scope: read_header stays EKDIST's

It parses about 130 header fields — the full SCAN header including display
and fitting parameters — where dcio names 18. Shimming it would lose
information dcio does not currently model. The duplication removed here is the
data decoding, which is where the numerical disagreement actually lived.

Bringing the header across would mean extending dcio's parser first. Worth
doing, but it is its own piece of work, not a shim.

48 passing.

🤖 Generated with Claude Code

M2 of the record-layer plan. EKDIST carried a second implementation of the SCN
binary decoding, and two copies of a format parser is two places for a record
to be read differently. It was: the interval array is stored as 4-byte floats,
and under NEP 50 the millisecond-to-second multiply stayed in single precision
here, discarding most of the digits the file carries.

read_data now delegates to dcio.formats.scn.read. Verified identical on both
shipped records before the change -- intervals equal bit for bit, raw
amplitudes and flags equal, and the same trailing-gap trim.

The contract is unchanged: amplitudes come back as raw stored integers, not
pA, because that is what this has always returned and what load_SCN_file
scales by calfac2. dcio applies the calibration on read, so it is divided back
out. The round trip is exercised on 181003S8.SCN, whose calfac2 is 0.0025
rather than 1, with a test asserting that it stays non-unit so the check
cannot become vacuous.

read_header stays EKDIST's own. It parses about 130 header fields -- the full
SCAN header including display and fitting parameters -- where dcio names 18.
Shimming it would lose information dcio does not currently model, so the
duplication removed here is the data decoding, which is where the numerical
disagreement lived.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@remislp
remislp merged commit 8b1bc69 into master Sep 2, 2026
6 checks passed
@remislp
remislp deleted the m2-shims branch September 2, 2026 10:25
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