From 13f2769736fc05628c235c71ff8600354074aa76 Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 18:02:51 -0500 Subject: [PATCH] feat(decode_check): an OORANGE interval vector sum is saturation Blastware prints OORANGE for an interval's vector sum when it exceeds the range in an interval where Blastware also clamped a channel: 17 / 17 DL2 cells, SFM's sum 10.01 .. 17.33 in/s (sqrt 3 x 10.005). The saturation carve-out now covers intervals.Geo PVS in/s with that rule, per interval, as it already did for PeakVectorSum. The 4 other cells left mismatching sit 4e-6 past a rounding boundary (Blastware's arithmetic is a hair lower) and stay mismatches. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check_carveouts.py | 22 +++- .../T190LD5Q.LD0H | Bin 0 -> 1838 bytes .../T190LD5Q_LD0H_XML.XML | 116 ++++++++++++++++++ tests/test_decode_check.py | 25 ++++ 4 files changed, 161 insertions(+), 2 deletions(-) create mode 100755 tests/fixtures/histogram-intervals-11-03-26/T190LD5Q.LD0H create mode 100755 tests/fixtures/histogram-intervals-11-03-26/T190LD5Q_LD0H_XML.XML diff --git a/minimateplus/decode_check_carveouts.py b/minimateplus/decode_check_carveouts.py index 1bf3d75..e1d05c9 100644 --- a/minimateplus/decode_check_carveouts.py +++ b/minimateplus/decode_check_carveouts.py @@ -68,6 +68,21 @@ def _saturation(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool: got = series_pairs(sfm, ref, res.field) if got is None or got[1]: return False + if res.field == "intervals.Geo PVS in/s": + # Per interval, as PeakVectorSum: an OORANGE vector sum, SFM's sum within + # three channels at the ceiling, and a channel Blastware itself clamped in + # that interval. 17 / 17 DL2 cells, SFM 10.01 .. 17.33 (2026-11-03). + cols = ref.interval_columns or [] + peaks = [cols.index(c) for c in ("Tran Peak in/s", "Vert Peak in/s", "Long Peak in/s") + if c in cols] + rows = ref.intervals or [] + differing = [(j, cell, v) for j, cell, v in got[0] + if isinstance(v, str) or not matches_printed(v, cell)] + return bool(differing) and all( + cell.strip() == "OORANGE" and not isinstance(v, str) + and r - _TOL <= v <= 3 ** 0.5 * r * 1.01 + and any(_clamped(rows[j][1][p], r) for p in peaks if p < len(rows[j][1])) + for j, cell, v in differing) differing = [(cell, v) for _, cell, v in got[0] if not matches_printed(v, cell)] return bool(differing) and all( _clamped(cell, r) and _at_ceiling(v, r) @@ -79,10 +94,13 @@ SATURATION = Carveout( id="saturation", fields=("TranPPV", "VertPPV", "LongPPV", "PeakVectorSum", "samples.Tran", "samples.Vert", "samples.Long", - "intervals.Tran Peak in/s", "intervals.Vert Peak in/s", "intervals.Long Peak in/s"), + "intervals.Tran Peak in/s", "intervals.Vert Peak in/s", "intervals.Long Peak in/s", + "intervals.Geo PVS in/s"), evidence=("Blastware clamps a clipped channel to the range maximum and prints OORANGE; " "the file holds counts past full scale (32016 counts = 10.005 in/s observed). " - "scratch/verify_against_ascii.py, 2026-08-28."), + "scratch/verify_against_ascii.py, 2026-08-28. An interval's vector sum prints " + "OORANGE when it exceeds the range in an interval with a clamped channel: 17 / 17 " + "DL2 cells, 2026-11-03."), applies=_saturation, ) diff --git a/tests/fixtures/histogram-intervals-11-03-26/T190LD5Q.LD0H b/tests/fixtures/histogram-intervals-11-03-26/T190LD5Q.LD0H new file mode 100755 index 0000000000000000000000000000000000000000..238a9b8e1bccfb2c4c91bb91dd694cd035037c46 GIT binary patch literal 1838 zcma)-TW}Lq7{|X&(`1{=UXrCc*r_K)pchioG(apAiUqWqV(kTo@j+v2;!MFo(iQ}P0!i8irYMs2JDY+!!vo)*vzu(b z+wc6(ZUkVq1GFizcuJx-ML4L2Nv9l&s^N&TiFC>Ft$om;M&Fi0@g`_<`#tXUQ8m7qtc$Ae zxL2!kkTkk|OTC?u&}Iycy%*_~dkM7mMq~v8)&;kb*65bLpt22mVzNrs2e-&g&@HQK z(A_R$j1mdONShL>cas-_sv3z!73h*9F%pP|ngCB^o}akMY$bxF$bV|}%A_+I3=>%U zL0neCa+s`-#^o63vS}6It42M#)u4jh40ND&)iB3U!WeNCpykxQ`v5Bg$y7wC*Hv1K z%XfS;_-fF5gRI6MKdNRE_-ZjK5LGrkepLNy;HyLT_DCpz7XzFIFZOORoMkRRDL}J- z0}HVH+tR~*u?Va<;LlbEY9RUpRF{Gg3U|tE<_WMu!|ZjrzAG`&1N-l}rvL69b8%nve|4-(=;B8!WzI7qR3$OhbD*&4iIqP z!@a|Brn$%xfO!T^XK^!bfdys~pCeMiz{$^ceR*smJ$!C#d>n};Zr;jH z=5No;{PnkB9Cr|ZDH4@gZ8nbMXjz>{lB78}oRWlCNToAz93t6@NM>)D3K_-Tn>k;N}n$JnX+L)9ZEp27K82_fKw}r zL~XE;Dd0u9FLVYNa&U-x`gtMpoDh_rAn7Ni+w z`@o&?k;f>CyRV$Q9Jt*hQRFKs@LIaP*)IPkPRd3)=Dhx6-&*ZfMh)Ctxne S&b~)H58o#){P%!s3;qE{> + +8.0 +Full Histogram +BE18190 +V 10.72-8.17 MiniMate Plus +T190LD5Q.LD0H +11:00:49 +2025-12-09 +11:00:59 +2025-12-09 + +Tran +Vert +Long +MicL + +1.00 +1 minute +1024 sps +6.9 Volts +June 13, 2025 by Instantel +in/s and dB(L) +I-80-North Fork-Area 3-462Richardsvilel +Fay Company +Terra-Mechanics Inc.- Harrison +Loc #8 - Area 3- 462 Richardsville Road + +10.000 +in/s + + +2.140 +in/s + + +OORANGE +in/s + + +2.830 +in/s + + +>100 +Hz + + +85 +Hz + + +34 +Hz + +11:00:59 +2025-12-09 +11:00:59 +2025-12-09 +11:00:59 +2025-12-09 + +OORANGE +in/s + +11:00:59 +2025-12-09 +Linear Weighting + +106.0 +dB(L) + +11:00:59 +2025-12-09 + +85 +Hz + +7.4 Hz. +4.4 +Passed +7.6 Hz. +3.5 +Passed +7.3 Hz. +3.9 +Passed +20.5 Hz. +691 mv +Passed + + +2025-12-09 11:00:48 - 2025-12-09 11:00:59 "Event Recorded Modem Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +2.140>100OORANGE852.83034OORANGE0.001106.085 + + + + + + diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index 503023a..8edaca6 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -300,3 +300,28 @@ def test_blastwares_interval_frequency_words(halfp, sr, want): # below 1 Hz -- on ~3.1 M DL2 cells, 2026-11-03. from minimateplus.decode_check import interval_frequency assert interval_frequency(halfp, sr) == want + + +def _pvs_oorange(unclamp=False): + hb = FIX.parent / "histogram-intervals-11-03-26" + ref = parse_xml_report_file(hb / "T190LD5Q_LD0H_XML.XML") # Geo PVS OORANGE, Vert OORANGE + if unclamp: + cols = ref.interval_columns + t, row = ref.intervals[0] + row = list(row) + row[cols.index("Vert Peak in/s")] = "0.500" + ref.intervals[0] = (t, row) + res = {r.field: r for r in compare(sfm_side((hb / "T190LD5Q.LD0H").read_bytes()), ref, CARVEOUTS)} + return res["intervals.Geo PVS in/s"] + + +def test_an_oorange_interval_vector_sum_is_saturation(): + # Blastware prints OORANGE for an interval's vector sum above the range when + # it clamped a channel in that interval: 17 / 17 DL2 cells, SFM's sum + # 10.01 .. 17.33 (= sqrt 3 x 10.005). + r = _pvs_oorange() + assert (r.verdict, r.carveout) == ("accepted", "saturation") + + +def test_an_oorange_vector_sum_needs_a_clamped_channel_in_that_interval(): + assert _pvs_oorange(unclamp=True).verdict == "mismatch"