feat(decode): sensor check results from the unit's own records (group E)

The record chain that starts with the embedded event record runs to the
file's end on all 70,041 DL2 files: the event record 0x05, the unit's
summary 0x32-0x35, its sensor checks 0x3c-0x3f, then the footer 0x0e
(no 0x35 / 0x3f on a unit without a mic, 8 files).  _record_chain walks
it and refuses a chain that does not end exactly at the file's end; the
unit's summary is now read from it too.

Each sensor-check record's header holds the results (DL2, 2026-11-06):
[2] channel type (1 geophone, 2 mic, 0 disabled), [4] status (0 =
passed), [5:7] frequency x 10, [7:9] ratio x 10, [9:11] amplitude mV.
Blastware prints them as they are: 209,943 / 209,943 geophone
frequencies and ratios, 69,975 / 69,975 mic frequencies and amplitudes;
"Passed" on status 0, "Check" on every other (its bits not decoded:
a Check can sit inside every passing range), "Disabled" on type 0.

Event.sensor_check_results: channel -> SensorCheckResult (result,
status, freq_hz, ratio, amplitude_mv).  The checker compares them.
Behaviour change: an unknown id inside an intact chain now leaves only
that record unread (was: everything after it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-11-06 12:58:31 -05:00
1 parent d2fe675650
commit f7b310b130
7 files changed
+4158 -30

No files matched your search

+24 -1
View File
@@ -43,7 +43,7 @@ def test_report_fields_stay_blank():
# since 2026-11-04, ZC frequency and displacement since 2026-11-05:
# test_the_setup_fields_match_blastware, test_waveform_peak_detail_*,
# test_zc_frequency_and_displacement_match_blastware. Its Tran ZC is N/A.)
for tag in ("TranZCFreq", "TranTestResults"):
for tag in ("TranZCFreq",): # (sensor check results since 2026-11-06)
assert s.values.get(tag) is None
@@ -393,3 +393,26 @@ def test_a_clipped_events_peak_times_match_blastware():
for f in ("TranTimeofPeak", "VertTimeofPeak", "LongTimeofPeak", "MicLTimeofPeak",
"PeakVectorSumTimeSum"):
assert res[f].verdict == "match", (f, res[f])
# ── Group E: the sensor check results (2026-11-06) ──────────────────────────
_SENSOR_CHECK = [f"{ch}Test{f}" for ch in ("Tran", "Vert", "Long", "MicL")
for f in ("Results", "Freq", "Ratio", "Amplitude")]
@pytest.mark.parametrize("path", [
FIX / "R352HIUI.F40W", FIX / "T1905KDW.5F0W", FIX / "T004JTRF.ME0H", FIX / "M529L4XQ.R30H",
_US / "K440HJCN.AS0W", # two Checks
_US / "K558IKSJ.P20W", _US / "O117I1NK.R70W",
])
def test_sensor_check_results_match_blastware(path):
ref = parse_xml_report_file(path.with_name(path.name.replace(".", "_", 1) + "_XML.XML"))
res = {r.field: r for r in compare(sfm_side(path.read_bytes()), ref, CARVEOUTS)}
checked = 0
for f in _SENSOR_CHECK:
if ref.scalars.get(f) is None:
continue
assert res[f].verdict == "match", (f, res[f])
checked += 1
assert checked >= 4