feat(decode): over range from the unit's own peaks -- Blastware's OORANGE
A channel is over range when the unit's own peak (its summary's min / max) passes 2,000: 32,000 counts, full scale, on either geophone range; the mic in counts. Blastware prints OORANGE for that channel's peak, for the vector sum when any geophone is over, and its "Out of Range" line when the mic is (DL2, 2026-11-09): numeric up to 1,991 / 1,933, OORANGE from 2,001; the vector sum is OORANGE on all 43 events with a geophone over and on none of the 38 whose vector sum alone passes 10 in/s -- the open "vector sum alone" carve-out was never needed. PeakValues gains tran/vert/long/mic/pvs_over_range. The checker matches OORANGE by the flag, and calls a flag against a printed number a mismatch. Clipped events that the saturation carve-out used to accept now match outright; the carve-out stays as the fallback for a file without the unit's summary, and its guards are tested that way. 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
e542e61b68
commit
af8dde5114
12 files changed
+1097
-19
No files matched your search
@@ -157,6 +157,10 @@ def sfm_side(raw: bytes) -> SfmSide:
|
||||
("LongZCFreq", pv.long_zc_freq), ("MicLZCFreq", pv.mic_zc_freq)):
|
||||
if hz is not None:
|
||||
values[tag] = "<1.0" if hz < 1.0 else hz
|
||||
# Blastware's "Out of Range" line: on every DL2 event whose mic is over
|
||||
# range, and on no other (18 / 18, 2026-11-09).
|
||||
if pv is not None and pv.mic_over_range:
|
||||
values["OORANGE"] = "Out of Range"
|
||||
# The event's Monitor Log line, from the footer (2026-11-08).
|
||||
if ev.monitor_log is not None:
|
||||
ml = ev.monitor_log
|
||||
@@ -269,6 +273,11 @@ def _mic_converter(ref: XmlReport) -> Optional[Callable[[int], float]]:
|
||||
return None
|
||||
|
||||
|
||||
_OVER_RANGE = {"TranPPV": "tran_over_range", "VertPPV": "vert_over_range",
|
||||
"LongPPV": "long_over_range", "PeakVectorSum": "pvs_over_range",
|
||||
"MicLPSPL": "mic_over_range"}
|
||||
|
||||
|
||||
def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> FieldResult:
|
||||
if not printed.strip() or printed.strip() == "N/A":
|
||||
return FieldResult(tag, "no_reference", printed, None)
|
||||
@@ -288,8 +297,14 @@ def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> Fie
|
||||
ch = tag[:-len("ZCFreq")].lower()
|
||||
flag = getattr(sfm.event.peak_values, ("mic" if ch == "micl" else ch) + "_zc_above_range", False)
|
||||
return FieldResult(tag, "match" if flag else "mismatch", printed, str(value))
|
||||
if printed == "OORANGE":
|
||||
return FieldResult(tag, "mismatch", printed, str(value))
|
||||
# Over range: SFM agrees with Blastware's OORANGE only by setting its flag,
|
||||
# and a flag against a printed number is a disagreement.
|
||||
over = _OVER_RANGE.get(tag)
|
||||
flagged = bool(over and getattr(sfm.event.peak_values, over, False))
|
||||
if printed == "OORANGE" or flagged:
|
||||
ok = printed == "OORANGE" and flagged
|
||||
return FieldResult(tag, "match" if ok else "mismatch", printed,
|
||||
"OORANGE" if flagged else _render(value, printed))
|
||||
if isinstance(value, (int, float)) and not isinstance(value, bool) and _printed_number(printed):
|
||||
ok = matches_printed(float(value), printed)
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user