From b4706a30f0d70750a7172c6b98bed3ba79638c04 Mon Sep 17 00:00:00 2001 From: serversdown Date: Thu, 29 Oct 2026 17:20:39 -0400 Subject: [PATCH] fix(decode): a Blastware file's setup and notes come from its recording-setup block (#44, #45) Without a paired ASCII report, a Blastware import stored no sample rate, the record-type byte as its record time (every waveform read "70 s"), a pre-trigger and sample count read from STRT bytes that are neither, and blank notes (the reader stopped at the NUL after each label). - The recording-setup block is found by structure -- 1c 08, the setup name, NUL -- not by the name "Standard Recording Setup", which 37% of DL2's files do not use. One match in each of 70,041 archive files. - Sample rate (uint16 BE, name-42), pre-trigger (f32 BE, name-36) and record time (f32 BE, name-30). A waveform's sample count is the decoded count. A histogram gets a sample rate only: Blastware reports neither a record time nor a pre-trigger for one. - The setup name and the four user notes by position, as bw_ascii_report reads them: the labels are operator-editable ("Seis. Loc:", "Location:", "Project: "). - STRT now yields only the waveform key. Verified against Blastware's own _XML.XML event reports for the 70,042 DL2 archive events that have one (2016-2026): sample rate 70,042/70,042, record time 6,524/6,524, pre-trigger 6,484/6,484, notes 70,042/70,042, sample count 6,523/6,524 (one waveform the decoder ends 3 samples short; separate). Events imported with an ASCII report are unchanged -- the report still overlays. Not changed: the waveform-time estimate still finds the record time by the marker; moving it would add a validation constraint for 37% of files and is to be measured first. The job number is not read yet (2,997 archive events carry one). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/event_file_io.py | 138 +++++++++++++----- .../bw-import-fields-10-29-26/M529L4XQ.R30H | Bin 0 -> 1424 bytes .../bw-import-fields-10-29-26/R352HIUI.F40W | Bin 0 -> 3310 bytes tests/test_bw_file_fields.py | 113 ++++++++++++++ tests/test_event_file_io.py | 7 +- 5 files changed, 216 insertions(+), 42 deletions(-) create mode 100755 tests/fixtures/bw-import-fields-10-29-26/M529L4XQ.R30H create mode 100755 tests/fixtures/bw-import-fields-10-29-26/R352HIUI.F40W create mode 100644 tests/test_bw_file_fields.py diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 3b6be84..11f645a 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -20,6 +20,7 @@ import hashlib import json import logging import os +import re import struct from pathlib import Path from typing import Optional, Union @@ -712,35 +713,16 @@ _MIC_FS_PSI = 0.0125 / _INT16_FS # ~0.5 psi full-scale assumption def _decode_strt(strt: bytes) -> dict: """ - Decode the 21-byte STRT record from a BW file. + Decode the 21-byte STRT record from a BW file: the waveform key (4B). - Returns dict with waveform_key (4B), total_samples, pretrig_samples, - rectime_seconds. Falls back to None on truncated/missing fields. + The record holds no setup fields. It was once read as total samples + ([8:10]), pre-trigger samples ([16:18]) and record time ([18]), but [18] is + the record-type marker (0x46 waveform, 0x0A histogram) and the others + matched nothing (#44/#45); those come from the recording-setup block. """ if len(strt) < 21 or strt[0:4] != b"STRT": return {} - return { - "waveform_key": strt[6:10].hex(), - "total_samples": struct.unpack_from(">H", strt, 8)[0], - "pretrig_samples": struct.unpack_from(">H", strt, 16)[0], - "rectime_seconds": strt[18], - } - - -def _find_first_string(buf: bytes, label: bytes, max_len: int = 256) -> Optional[str]: - """ - Search `buf` for `label` (e.g. b"Project:") and return the - null-terminated ASCII string that follows, stripped. - """ - pos = buf.find(label) - if pos < 0: - return None - start = pos + len(label) - end = buf.find(b"\x00", start, start + max_len) - if end < 0: - end = start + max_len - text = buf[start:end].decode("ascii", errors="replace").strip() - return text or None + return {"waveform_key": strt[6:10].hex()} def _decode_samples_4ch_int16_le(stream: bytes) -> dict[str, list[int]]: @@ -855,6 +837,21 @@ def derive_record_type_from_filename(filename, default: str = "Waveform") -> str _RECSETUP_MARKER = b"Standard Recording Setup" _RECTIME_OFFSET_BEFORE_MARKER = 30 +# The recording-setup block, found by its structure rather than by name +# (#44/#45). It ends in the setup's name -- whatever the operator saved it as +# ("Standard Recording Setup", "BE16352.set", ...), NUL-terminated, right after +# the bytes 1c 08 -- and the four user notes follow the name as label/value +# string pairs. 37% of the DL2 archive's files name the setup something other +# than "Standard Recording Setup", which _RECSETUP_MARKER cannot see; the 1c 08 +# form matches exactly once in every one of its 70,041 files (measured +# 2026-10-29). Offsets are from the first byte of the name. +_SETUP_NAME_RE = re.compile(rb"\x1c\x08([\x20-\x7e]{1,40})\x00") +_SAMPLE_RATE_BEFORE_NAME = 42 # uint16 BE, samples per second +_PRETRIG_BEFORE_NAME = 36 # float32 BE, seconds, negative (-0.25, -0.0625 ...) +_RECTIME_BEFORE_NAME = 30 # float32 BE, seconds (the marker's offset above) +_SAMPLE_RATES = (1024, 2048, 4096) +_NOTE_SLOTS = 4 # project, client, operator, sensor location + # The instrument's own event record, which the unit sends in its 5A stream and # Blastware therefore copies into every waveform file (measured 2026-10-26; see # the Series-III reference, "The embedded event record"): @@ -934,6 +931,60 @@ def _parse_record_time_seconds(raw: bytes) -> Optional[float]: return rt if 0.05 <= rt <= 600.0 else None +def _setup_name_at(raw: bytes) -> Optional[int]: + """Offset of the recording setup's name, or None unless exactly one + candidate is found -- two would mean the anchor is not what it seems.""" + found = [m.start(1) for m in _SETUP_NAME_RE.finditer(raw)] + return found[0] if len(found) == 1 else None + + +def _setup_sample_rate(raw: bytes) -> Optional[int]: + """The configured sample rate (samples/s) from the recording-setup block.""" + k = _setup_name_at(raw) + if k is None or k < _SAMPLE_RATE_BEFORE_NAME: + return None + sr = struct.unpack_from(">H", raw, k - _SAMPLE_RATE_BEFORE_NAME)[0] + return sr if sr in _SAMPLE_RATES else None + + +def _setup_record_time(raw: bytes) -> Optional[float]: + """The configured post-trigger record time (s) from the recording-setup + block. A histogram's block carries a stale value here: callers use it + for waveforms only.""" + k = _setup_name_at(raw) + if k is None or k < _RECTIME_BEFORE_NAME: + return None + rt = struct.unpack_from(">f", raw, k - _RECTIME_BEFORE_NAME)[0] + return rt if 0.05 <= rt <= 600.0 else None + + +def _setup_pretrigger(raw: bytes) -> Optional[float]: + """The pre-trigger (s, negative) from the recording-setup block -- the + value Blastware prints, -0.247 s as well as -0.25 s (6,453 of 6,453 DL2 + waveforms, measured 2026-10-29). A histogram's block holds 0.0.""" + k = _setup_name_at(raw) + if k is None or k < _PRETRIG_BEFORE_NAME: + return None + pre = struct.unpack_from(">f", raw, k - _PRETRIG_BEFORE_NAME)[0] + return pre if -2.0 <= pre <= 0.0 else None + + +def _setup_notes(raw: bytes) -> ProjectInfo: + """The setup name and the four user notes. Blastware lets the operator + relabel the note slots ("Seis. Loc:", "Location:", "Project: " ...), so the + labels are not searched for: slot n is the nth label/value pair after the + name, as in bw_ascii_report. An empty value is None.""" + k = _setup_name_at(raw) + if k is None: + return ProjectInfo() + parts = raw[k:].split(b"\x00", 1 + 2 * _NOTE_SLOTS) + text = [p.decode("ascii", errors="replace").strip() or None for p in parts] + text += [None] * (2 + 2 * _NOTE_SLOTS - len(text)) + project, client, operator, location = text[2:2 + 2 * _NOTE_SLOTS:2] + return ProjectInfo(setup_name=text[0], project=project, client=client, + operator=operator, sensor_location=location) + + def read_blastware_file(path: Union[str, Path], *, name: Optional[str] = None) -> Event: """Parse a Blastware event file into an Event: `decode_blastware_bytes` on its bytes, `name` defaulting to the file's own (see there -- never a time source).""" @@ -950,13 +1001,15 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: receives straight from a unit has no Blastware name. Recovers: - - waveform_key, rectime_seconds, total_samples, pretrig_samples - (from the STRT record) + - waveform_key (from the STRT record) + - sample_rate; for a waveform also rectime_seconds, total_samples and + pretrig_samples (from the recording-setup block and the decoded + sample count) - timestamp: a waveform's from the instrument's embedded event record (`timestamp_source` "event_record"); without a validated one, an estimate from the footer with a `decode_problems` entry; a histogram's from the footer start ("footer") - - project_info (from ASCII labels embedded in the body) + - project_info: setup name and the four user notes, by position - raw_samples (Tran/Vert/Long/MicL int16 lists) - peak_values (computed from raw_samples; approximate — see notes on _peaks_from_samples about Normal-range assumption) @@ -1071,12 +1124,6 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: else: samples = decoded_to_adc_counts(decoded) - # Metadata strings (label-anchored search across the body). - project = _find_first_string(body, b"Project:") - client = _find_first_string(body, b"Client:") - user = _find_first_string(body, b"User Name:") - seisloc = _find_first_string(body, b"Seis Loc:") - # Build the Event. ev = Event(index=-1) if strt_fields.get("waveform_key"): @@ -1087,9 +1134,22 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: # caller overrides ev.record_type using the original filename — see # waveform_store.save_imported_bw. ev.record_type = derive_record_type_from_filename(name) - ev.rectime_seconds = strt_fields.get("rectime_seconds") - ev.total_samples = strt_fields.get("total_samples") - ev.pretrig_samples = strt_fields.get("pretrig_samples") + + # Setup fields come from the recording-setup block (#44/#45), not the STRT + # record: STRT[18] is the record-type marker (0x46 / 0x0A), which is why + # every waveform used to read "70 s". A histogram has no record time or + # pre-trigger -- Blastware reports neither. + ev.sample_rate = _setup_sample_rate(raw) + if is_waveform_body: + ev.rectime_seconds = _setup_record_time(raw) + ev.total_samples = len(samples["Tran"]) or None + pre = _setup_pretrigger(raw) + if pre is not None and ev.sample_rate: + ev.pretrig_samples = round(-pre * ev.sample_rate) + if None in (ev.sample_rate, ev.rectime_seconds, ev.pretrig_samples): + ev.decode_problems.append( + f"recording-setup block incomplete: sample rate {ev.sample_rate}, " + f"record time {ev.rectime_seconds}, pre-trigger {pre}") # Event timestamp. The footer's two timestamps mean different things by # record type: @@ -1150,9 +1210,7 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: ) ev.timestamp_source = "footer" - ev.project_info = ProjectInfo( - project=project, client=client, operator=user, sensor_location=seisloc, - ) + ev.project_info = _setup_notes(raw) ev.raw_samples = samples # Sensor self-check traces from the binary's trailing block (waveform # events only; returns {} for histograms / when absent). Carried on the diff --git a/tests/fixtures/bw-import-fields-10-29-26/M529L4XQ.R30H b/tests/fixtures/bw-import-fields-10-29-26/M529L4XQ.R30H new file mode 100755 index 0000000000000000000000000000000000000000..4af107a20be1bae49496efc076f79c39d3a5b425 GIT binary patch literal 1424 zcma)+Z%i9y9LK*;Id<2h?LAkN7do{K8p<>Xr3{9!6&TTFWx>Hn7GG6*ViP>D?dG5O zV#$nec%eoU-?+p?V>Erg#I=iwFP6m~2}X^7)&n*+*c1wzY|gQ9{+>3>7xH4?yQjZ< z?w;rJ`~1GYD+fCP95BcvqjRXWwWFz}9cXE8Y7gTv zNxt@9Hned&Dci3YNSeukc*Y0}jvq_k-*^5Tc1eIlqigG?$OKi;mt}WW)j)U0hypw}{?Wo@I*G2&e^EoRMg+e=s2UPBZ@Ogp8hpDODzRM= zJworfuWTN5VK^<+OF|96qY;WHrGuzzh4Tvamk=2yi#|HFu#UP2oHpt?p`$=8RS2hd zFQcvv&N}s>kSOkpG!%0Wz9*}x|8Ni?c2^*<9@Ya-U?*5{>fH~%Uc5B(qdh-=@$%Bu zKUY?-|8?u{e>U!MX}&fPk#@+6TdnbWeH!On_v^KOIx6z}{kqO|jcY!i&+GAc)Ec*2 zQDi=N+}Ph&?}z4;R_tQ2P$=XIxqPmW&s&yd+xAMSw7Kc5tq~RP0N0tW>p?o{brk$! z&U6OO=(&gE32KR`%W;734q&Fc!V<$%E+QqCUe?PMO#n(n1bgb_`(IsInE9bNH#@hm zxb(+zY3;_%Tet6QaA~HBh^l3`yG9TZ5FrrDLt7GD0!r64P4jt)sYX?ai4VSE4DYY^ za|j~qf|biLN$*y9d_Z z3egJ)xwJA-lts%#YZap3rr!H7OCJ3+J2yLj`HCRAeq&vj#Fc6GdDrL27p_S^omasA1Ru literal 0 HcmV?d00001 diff --git a/tests/fixtures/bw-import-fields-10-29-26/R352HIUI.F40W b/tests/fixtures/bw-import-fields-10-29-26/R352HIUI.F40W new file mode 100755 index 0000000000000000000000000000000000000000..33f00fb988fdf534f7b501bdc1b8517c28be607e GIT binary patch literal 3310 zcma)8e{5Sv9si!|H80L{-Z^nXR6>2}ij;Lp<|J+xMM;-74QoqMqBVr_A13iOqtqF; z*U>6j70+X@IdMier<8wWRgq^Sx)M zNE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up "BE16352.set", 1024 sps, 1.0 s, -0.247 s, 1277 sample rows. + ("bw-import-fields-10-29-26/R352HIUI.F40W", 1024, 1.0, 253, 1277), +] + + +@pytest.mark.parametrize("rel,sr,rt,pretrig,total", _WAVEFORMS) +def test_waveform_setup_fields_come_from_the_file(rel, sr, rt, pretrig, total): + ev = read_blastware_file(_FIX / rel) + assert ev.sample_rate == sr + assert ev.rectime_seconds == pytest.approx(rt) + assert ev.pretrig_samples == pretrig + assert ev.total_samples == total + + +# (file, sample rate) -- ASCII report / XML +_HISTOGRAMS = [ + ("histogram-mic-off-10-26-26/K441LTOK.QZ0", 2048), + ("ts-fix/K441LKZU.C30H", 1024), + ("bw-import-fields-10-29-26/M529L4XQ.R30H", 1024), +] + + +@pytest.mark.parametrize("rel,sr", _HISTOGRAMS) +def test_histogram_sample_rate_comes_from_the_file(rel, sr): + ev = read_blastware_file(_FIX / rel) + assert ev.sample_rate == sr + + +@pytest.mark.parametrize("rel,sr", _HISTOGRAMS) +def test_histogram_has_no_record_time_or_pretrigger(rel, sr): + # Blastware reports neither for a histogram; the STRT record-type byte + # (0x0A = 10) is not a record time. + ev = read_blastware_file(_FIX / rel) + assert ev.rectime_seconds is None + assert ev.pretrig_samples is None + + +# (file, setup name, project, client, operator, sensor location) +_NOTES = [ + # ASCII report; default labels, location spelled "Seis Loc:". + ("5-11-26/M529LL1A.SP0", "Standard Recording Setup", + "Test-5-8-26", "New Client", "Terra-Mechanics - Harrison", "Still Catbed."), + # ASCII report; location spelled "Seis. Loc:". BE9441's bench setup is + # saved as "Standard Recording Setup.set" (#45). + ("histogram-mic-off-10-26-26/K441LTOK.QZ0", "Standard Recording Setup.set", + "TestUnit-Minimate", "Terra-Mechanics", "Terra-Mechanics Inc. - Harrison", "Test unit 1"), + # XML; a setup not named "Standard Recording Setup". + ("bw-import-fields-10-29-26/R352HIUI.F40W", "BE16352.set", + "JV 241 - 1425 Spanlers Mill Rad", "Walsh Granite JV", + "Terra-Mechanics Inc- D. Harrison", "Loc #1 - 1425 Spanlers Mill Rd"), + # XML (Test Loc only); the operator relabelled the + # four note slots "Location:", "Client:", "User Name:", "General:" and + # filled in only the first. Slots are positional, as in the ASCII parser. + ("bw-import-fields-10-29-26/M529L4XQ.R30H", "Standard Recording Setup", + "Test Loc", None, None, None), +] + + +@pytest.mark.parametrize("rel,setup,project,client,operator,location", _NOTES) +def test_notes_come_from_the_file_by_position(rel, setup, project, client, operator, location): + pi = read_blastware_file(_FIX / rel).project_info + assert pi.setup_name == setup + assert pi.project == project + assert pi.client == client + assert pi.operator == operator + assert pi.sensor_location == location + + +def test_import_without_a_report_stores_the_file_fields(tmp_path: Path): + """The watcher path with no ASCII report: the sidecar carries what the + file holds, not blanks and not the STRT bytes.""" + from sfm.waveform_store import WaveformStore + + src = _FIX / "bw-import-fields-10-29-26/R352HIUI.F40W" + store = WaveformStore(tmp_path / "waveforms") + store.save_imported_bw(src.read_bytes(), source_path=src) + + sc = store.load_sidecar("BE16352", src.name) + assert sc["event"]["sample_rate"] == 1024 + assert sc["event"]["rectime_seconds"] == pytest.approx(1.0) + assert sc["event"]["pretrig_samples"] == 253 + assert sc["project_info"]["project"] == "JV 241 - 1425 Spanlers Mill Rad" + assert sc["project_info"]["sensor_location"] == "Loc #1 - 1425 Spanlers Mill Rd" diff --git a/tests/test_event_file_io.py b/tests/test_event_file_io.py index 2b0c0d4..9135747 100644 --- a/tests/test_event_file_io.py +++ b/tests/test_event_file_io.py @@ -269,7 +269,7 @@ def test_seismodb_persists_sidecar_filename_and_review_sync(tmp_path: Path): def test_read_blastware_file_round_trip(tmp_path: Path): - """write → read → key/timestamp/rectime survive.""" + """write → read → key/timestamp survive.""" from minimateplus.blastware_file import write_blastware_file, blastware_filename ev, frames = _make_synthetic_event() @@ -278,7 +278,10 @@ def test_read_blastware_file_round_trip(tmp_path: Path): parsed = event_file_io.read_blastware_file(bw_path) assert parsed._waveform_key == ev._waveform_key - assert parsed.rectime_seconds == ev.rectime_seconds + # The synthetic file has no recording-setup block, so its record time is + # unknown. STRT[18], where the helper puts it, is the record-type marker + # and is not read as a record time (#44/#45). + assert parsed.rectime_seconds is None # Timestamp lands via the footer; year/month/day/hour/min/sec all survive. assert parsed.timestamp is not None assert parsed.timestamp.year == ev.timestamp.year