feat(decode): over range inside a histogram's intervals, as in the event
Inside an interval the rule is the event's: a peak past 2,000 units (the mic in counts) is Blastware's OORANGE, and the interval's vector sum is OORANGE when any geophone is. DL2 (2026-11-09): numeric up to 1,846 (geophones) / 1,414 (mic), OORANGE from 2,001; vector sums 16 / 16 OORANGE with a geophone over, 2,862 / 2,862 numeric without. event_file_io.over_full_scale(count, channel); the checker renders those interval cells as OORANGE. The saturation carve-out compares SFM's own words properly (_differs): an OORANGE from SFM never counts as saturation, and an OORANGE equal to Blastware's is not a difference. Its interval tests run on the numeric values it used to see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
This commit is contained in:
1 parent
836c9e864b
commit
e25784d9db
4 files changed
+54
-10
No files matched your search
@@ -45,6 +45,14 @@ def _clamped(printed: str, r: float) -> bool:
|
||||
return p is not None and abs(p[0]) >= r - _TOL
|
||||
|
||||
|
||||
def _differs(v: object, cell: str) -> bool:
|
||||
"""A cell SFM disagrees with. SFM's own word (its OORANGE, since
|
||||
2026-11-09) agrees only when Blastware printed the same word."""
|
||||
if isinstance(v, str):
|
||||
return " ".join(v.split()) != " ".join(cell.split())
|
||||
return not matches_printed(v, cell)
|
||||
|
||||
|
||||
def _saturation(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
|
||||
try:
|
||||
r = float(ref.scalars["GeoRange"])
|
||||
@@ -76,16 +84,15 @@ def _saturation(sfm: SfmSide, ref: XmlReport, res: FieldResult) -> bool:
|
||||
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)]
|
||||
differing = [(j, cell, v) for j, cell, v in got[0] if _differs(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)]
|
||||
differing = [(cell, v) for _, cell, v in got[0] if _differs(v, cell)]
|
||||
return bool(differing) and all(
|
||||
_clamped(cell, r) and _at_ceiling(v, r)
|
||||
not isinstance(v, str) and _clamped(cell, r) and _at_ceiling(v, r)
|
||||
and (cell.strip() == "OORANGE" or (v >= 0) == (_printed_number(cell)[0] >= 0))
|
||||
for cell, v in differing)
|
||||
|
||||
|
||||
Reference in new issue
Block a user