Commit Graph
6 Commits
Author SHA1 Message Date
serversdownandClaude Opus 5.5 7a58bad28d feat(decode): a Blastware file's job number, and whether Blastware shows it
The setup block has Series IV's 0x1A layout here too: report flags at
k - 9 (bit 0x02 = job number shown) and the number, uint16 BE, at k - 8,
kept while switched off.  The flag matches Blastware's JobNumber on
2,997 / 2,997 DL2 events that print one and 66,986 / 66,986 that don't.
Every printed value is 1 and matches; hidden ones hold real numbers
(802, 1012, 1013, 622), so the value is only proven for 1.

- ProjectInfo.job_number_enabled / job_number, named as in
  micromate.setup_block.
- write_event_hdf5 stores both as .h5 attrs when read (additive).
- The checker reports the number only when shown, and scores a number
  only SFM shows as a mismatch.  The old test that pinned JobNumber as
  sfm_blank now checks only the ZC cases it also covered.

Not carried into the DB, the API or the PDF report yet (needs a column).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-11-02 14:31:23 -05:00
serversdownandClaude Opus 5.5 4844135f01 fix(decode): a Blastware file's geophone range comes from its setup -- Sensitive events no longer read 8x
In the setup's channel blocks, the byte 29 after each geophone label is
the range: 0x00 Normal (10 in/s), 0x01 Sensitive (1.25 in/s).  It matches
Blastware's GeoRange on 70,042 / 70,042 DL2 events, all three channels
agreeing on every one (35 Sensitive).  SFM's live 1A has the same byte
at label+33.  SFM assumed Normal, so every Sensitive event's peaks,
vector sum and .h5 samples read 8x high.

- Event.geo_range (0 / 1, None when not read -- channels disagreeing,
  an unknown value or a missing block -- with a decode_problems entry).
- decode_blastware_bytes scales peaks and the histogram vector sum by it.
- event_hdf5.write_event_hdf5: geo_range defaults to None = the event's
  own, else Normal; an explicit argument still wins.
- waveform_store.save_imported_bw and scripts/backfill_sidecars.py stop
  forcing 'normal', so imports and the backfill store the file's range.
  The waveform_store line was agreed with the parity session, which owns
  that file; its own branch keeps a geo_range parameter, defaulting to
  None at its next dev merge.
- The checker's SFM side converts at the event's range and reports
  GeoRange; tests that pinned the old 8x gap now pin the fix, and the
  saturation carve-out is still tested against an 8x value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-11-01 16:26:15 -05:00
serversdownandClaude Opus 5.5 5644dbd5ad fix(decode): one MicL count is 0.25 Pa -- the mic psi was ~95x low
SFM converted mic counts to psi with a '~0.5 psi full-scale' guess
(0.0125 / 32768 psi per count).  Measured against 1,729,253 DL2
histogram intervals' 'MicL Peak' columns: one count is exactly 0.25 Pa.
count x 0.25 Pa matches Blastware's psi(L) on every interval, and
20 log10(count x 0.25 Pa / 20 uPa) its dB(L) on all but 17 exact
half-way cases.

- event_file_io: _MIC_FS_PSI -> _MIC_PSI_PER_COUNT = 0.25 / 6894.757
  (3.626e-5 psi per count, was 3.81e-7).  The event's mic peak in psi,
  and with it the .h5 mic trace (event_hdf5 back-solves its scale from
  that peak), come right on events with no report.
- waveform_codec.mic_count_to_db: the offset is 20 log10(0.25 / 20e-6)
  = 81.938, not 81.94 -- the old value missed 49 of those intervals at a
  rounding edge (count 119 printed 123.4, 81.94 gave 123.451).

The decoded count was always right: count 16 on K441LTON.900 is
Blastware's 106.0 dB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-31 01:28:23 -04:00
serversdownandClaude Opus 5.5 ff7dd908a7 feat(codec): carve-outs for proven Blastware differences -- saturation first
A mismatch becomes 'accepted' only through a written carve-out whose
evidence does not rest on SFM's output.  Saturation: Blastware clamps a
clipped channel to the range maximum and prints OORANGE, while the file
holds counts past full scale.  SFM's value must sit at the ceiling
(r - 0.0006 .. r * 1.01), so a Sensitive-range event read 8x high on
SFM's Normal assumption stays a mismatch; a vector sum is accepted when
a clipped channel under it is at the ceiling.  series_pairs() is now the
one place waveform rows and interval columns are paired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:27:01 -04:00
serversdownandClaude Opus 5.5 3662d2fac1 feat(codec): compare SFM's file-only decode with Blastware's XML, field by field
Every field the report carries (bar its format version and Blastware's
file name), the notes in order, the job number, the channel list, every
waveform sample and every histogram interval column.  Numbers match at
Blastware's printed precision, halves rounding away from zero; N/A and
empty text are no_reference; >100 needs SFM's above-range flag; OORANGE
is a mismatch unless a carve-out says otherwise.  Waveform rows pair
cells with the channels still running, so channels that end early
(T438HGTZ.B30W) match, and any row-length disagreement is counted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:26:00 -04:00
serversdownandClaude Opus 5.5 3e69a2acdd feat(codec): SFM's side of the decode check, from the event bytes alone
decode_blastware_bytes with no filename and no report: the values SFM
produces today in Blastware's field names, its notes, channels and raw
counts, with its Normal-range assumption kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
2026-10-29 19:24:31 -04:00