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 0000000..238a9b8 Binary files /dev/null and b/tests/fixtures/histogram-intervals-11-03-26/T190LD5Q.LD0H differ diff --git a/tests/fixtures/histogram-intervals-11-03-26/T190LD5Q_LD0H_XML.XML b/tests/fixtures/histogram-intervals-11-03-26/T190LD5Q_LD0H_XML.XML new file mode 100755 index 0000000..27bd9b8 --- /dev/null +++ b/tests/fixtures/histogram-intervals-11-03-26/T190LD5Q_LD0H_XML.XML @@ -0,0 +1,116 @@ + + +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"