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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-11-03 18:02:51 -05:00
1 parent 2b698e74cf
commit 13f2769736
4 files changed
+161 -2

No files matched your search

+20 -2
View File
@@ -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,
)
Binary file not shown.
+116
View File
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<Event>
<FileVersion>8.0</FileVersion>
<EventType>Full Histogram</EventType>
<SerialNumber>BE18190</SerialNumber>
<Version>V 10.72-8.17 MiniMate Plus</Version>
<FileName>T190LD5Q.LD0H</FileName>
<HistogramStartTime>11:00:49</HistogramStartTime>
<HistogramStartDate>2025-12-09</HistogramStartDate>
<HistogramStopTime>11:00:59</HistogramStopTime>
<HistogramStopDate>2025-12-09</HistogramStopDate>
<Channels>
<Channel>Tran</Channel>
<Channel>Vert</Channel>
<Channel>Long</Channel>
<Channel>MicL</Channel>
</Channels>
<NumberofIntervals>1.00</NumberofIntervals>
<IntervalSize>1 minute</IntervalSize>
<SampleRate>1024 sps</SampleRate>
<BatteryLevel>6.9 Volts</BatteryLevel>
<Calibration>June 13, 2025 by Instantel</Calibration>
<Units>in/s and dB(L)</Units>
<Project>I-80-North Fork-Area 3-462Richardsvilel</Project>
<Client>Fay Company</Client>
<UserName>Terra-Mechanics Inc.- Harrison</UserName>
<SeisLoc>Loc #8 - Area 3- 462 Richardsville Road</SeisLoc>
<GeoRange>
<Value>10.000</Value>
<Units>in/s</Units>
</GeoRange>
<TranPPV>
<Value>2.140</Value>
<Units>in/s</Units>
</TranPPV>
<VertPPV>
<Value>OORANGE</Value>
<Units>in/s</Units>
</VertPPV>
<LongPPV>
<Value>2.830</Value>
<Units>in/s</Units>
</LongPPV>
<TranZCFreq>
<Value>&gt;100</Value>
<Units>Hz</Units>
</TranZCFreq>
<VertZCFreq>
<Value>85</Value>
<Units>Hz</Units>
</VertZCFreq>
<LongZCFreq>
<Value>34</Value>
<Units>Hz</Units>
</LongZCFreq>
<TranPeakTime>11:00:59</TranPeakTime>
<TranPeakDate>2025-12-09</TranPeakDate>
<VertPeakTime>11:00:59</VertPeakTime>
<VertPeakDate>2025-12-09</VertPeakDate>
<LongPeakTime>11:00:59</LongPeakTime>
<LongPeakDate>2025-12-09</LongPeakDate>
<PeakVectorSum>
<Value>OORANGE</Value>
<Units>in/s</Units>
</PeakVectorSum>
<PeakVectorSumTime>11:00:59</PeakVectorSumTime>
<PeakVectorSumDate>2025-12-09</PeakVectorSumDate>
<Microphone>Linear Weighting</Microphone>
<MicLPSPL>
<Value>106.0</Value>
<Units>dB(L)</Units>
</MicLPSPL>
<MicLTime>11:00:59</MicLTime>
<MicLDate>2025-12-09</MicLDate>
<MicLZCFreq>
<Value>85</Value>
<Units>Hz</Units>
</MicLZCFreq>
<TranTestFreq>7.4 Hz.</TranTestFreq>
<TranTestRatio>4.4</TranTestRatio>
<TranTestResults>Passed</TranTestResults>
<VertTestFreq>7.6 Hz.</VertTestFreq>
<VertTestRatio>3.5</VertTestRatio>
<VertTestResults>Passed</VertTestResults>
<LongTestFreq>7.3 Hz.</LongTestFreq>
<LongTestRatio>3.9</LongTestRatio>
<LongTestResults>Passed</LongTestResults>
<MicLTestFreq>20.5 Hz.</MicLTestFreq>
<MicLTestAmplitude>691 mv</MicLTestAmplitude>
<MicLTestResults>Passed</MicLTestResults>
<UsbSummaryChannels>
</UsbSummaryChannels>
<MonitorLog>2025-12-09 11:00:48 - 2025-12-09 11:00:59 &quot;Event Recorded Modem Exit&quot;</MonitorLog>
<HistogramData>
<HistogramDataColumnTitle>
<ColumnTitle> Tran Peak in/s </ColumnTitle>
<ColumnTitle> Tran Freq Hz </ColumnTitle>
<ColumnTitle> Vert Peak in/s </ColumnTitle>
<ColumnTitle> Vert Freq Hz </ColumnTitle>
<ColumnTitle> Long Peak in/s </ColumnTitle>
<ColumnTitle> Long Freq Hz </ColumnTitle>
<ColumnTitle> Geo PVS in/s </ColumnTitle>
<ColumnTitle> MicL Peak psi(L) </ColumnTitle>
<ColumnTitle> MicL Peak dB(L) </ColumnTitle>
<ColumnTitle> MicL Freq Hz </ColumnTitle>
</HistogramDataColumnTitle>
<HistogramDataIntervals>
<Time>2025-12-09 11:00:59</Time>
<Row>
<Cell>2.140</Cell><Cell>&gt;100</Cell><Cell>OORANGE</Cell><Cell>85</Cell><Cell>2.830</Cell><Cell>34</Cell><Cell>OORANGE</Cell><Cell>0.001</Cell><Cell>106.0</Cell><Cell>85</Cell></Row>
</HistogramDataIntervals>
</HistogramData>
<HistogramDataUsbChannels>
</HistogramDataUsbChannels>
</Event>
+25
View File
@@ -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"