Skip to content

Read the PROCNO spectroscopy fids as interleaved float64 - #212

Merged
headmeister merged 2 commits into
isi-nmr:masterfrom
gdevenyi:fix/fid-proc-64
Aug 10, 2026
Merged

Read the PROCNO spectroscopy fids as interleaved float64#212
headmeister merged 2 commits into
isi-nmr:masterfrom
gdevenyi:fix/fid-proc-64

Conversation

@gdevenyi

@gdevenyi gdevenyi commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #198.

Spec 3.5:

| fid_proc.64, fid_refscan.64 | PV360 spectroscopy (e.g. PRESS) — in the PROCNO, not the EXPNO | Processed and reference FIDs as 64-bit doubles, real/imaginary interleaved. […] PVM_SpecMatrix = 2048 and a 32,768-byte fid_proc.64 = 8 × 2 × 2048, i.e. one complex float64 pair per spectral point. |

fid_proc/"64" was declared supported but wired to the raw-fid recipe set, so on PV360 the word type resolved to int32 via ACQ_word_size and the shape came from the acquisition block model. The computed size was exactly half the file:

InvalidDataset: expected 16384 bytes for shape (4096, 1) and dtype int32, got 32768 bytes

Had the two coincided the file would have been silently reinterpreted as int32 noise.

Change

  • properties_fid_proc_core.json / _custom.json: float64 from BYTORDA, the point count from PVM_SpecMatrix (falling back on the file when the method omits it), and an id that names the reconstruction as a 2dseq id does — these live in the PROCNO.
  • SchemaFidCompanion decodes them; it already handles exactly this shape, so no new schema.
  • fid_refscan.64, listed in the same spec row, was not a supported type at all. Same format, same recipes.

All ten .64 files in the corpus now load:

_cache/PV360_StdData/PRESS_1H/pdata/1/fid_proc.64      (2048,) complex128  |max|=132890.5
_cache/PV360_StdData/PRESS_1H/pdata/1/fid_refscan.64   (2048,) complex128  |max|=57469576.4
... (pv-3-5 / pv-3-6 / pv-3-7 / pv360 likewise)

matching each scan's PVM_SpecMatrix = 2048. Folder discovery is unchanged — its default dataset_index is fid/2dseq/rawdata — so nothing else moves.

Test

test_the_procno_spectroscopy_fids_are_interleaved_float64, parametrized over both stems: writes a known 8-point complex spectrum interleaved as float64 and asserts it reads back exactly. Both fail on master.

Suite: 2140 passed, 12 skipped.

`ruff format --check` reported twelve files as unformatted, so any change
touching one of them dragged unrelated reflow into its diff. Run the
formatter once, on its own, so subsequent changes show only what they
actually change.

Formatting only: no behaviour changes, and `ruff check` is clean before and
after. The suite is unchanged at 2140 passed, 12 skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017SNrm3jFhpTPShP8xGkePC
fid_proc/"64" was declared a supported dataset type but wired to the raw-fid
recipe set, so on PV360 the word type resolved to int32 through
ACQ_word_size and the storage shape came from the acquisition block model
(block_size = ACQ_jobs[0][0], block_count = NI*NR). The computed size was
exactly half the real file, and every fid_proc.64 in the corpus was rejected:

    InvalidDataset: expected 16384 bytes for shape (4096, 1) and dtype int32,
                    got 32768 bytes

Had the two sizes coincided the file would have been silently reinterpreted
as int32 noise instead.

Spec 3.5 describes these as 64-bit doubles with real and imaginary
interleaved, 8 * 2 * PVM_SpecMatrix bytes -- one complex pair per spectral
point -- so give them recipes of their own: float64 from BYTORDA, the point
count from PVM_SpecMatrix (falling back on the file when the method omits
it), and SchemaFidCompanion, which already decodes exactly this shape. The
id names the reconstruction, as a 2dseq id does, because these live in the
PROCNO rather than the EXPNO.

fid_refscan.64, listed in the same spec row, was not a supported type at all;
it is the same format, so it shares the recipes.

All ten .64 files in the corpus now load as 2048-point complex spectra,
matching their PVM_SpecMatrix. Folder discovery is unchanged -- its default
dataset_index is fid/2dseq/rawdata -- so nothing else moves.

Closes isi-nmr#198

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017SNrm3jFhpTPShP8xGkePC
@gdevenyi

gdevenyi commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto #213 (ruff format), so this branch carries that commit until #213 merges — merge #213 first and this diff reduces to its own change. Verified after the rebase: ruff check and ruff format --check clean, full suite green.

Integration check across all eleven conformance PRs merged together: 2164 passed, 12 skipped; corpus load test 3202 → 3207 of 3478 with zero newly broken datasets.

@headmeister
headmeister merged commit 2af415a into isi-nmr:master Aug 10, 2026
7 checks passed
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.

fid_proc.64 is decoded as int32 with fid block sizing instead of float64, so every real PV360 spectroscopy fid_proc.64 is rejected (spec 3.5)

2 participants