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
@@ -857,7 +857,11 @@ def _apply_unit_summary(pv: PeakValues, summary: dict, geo_fs_ins: float, sample
|
||||
* a waveform's peak displacement = half its integral: 19,479 / 19,479
|
||||
* a waveform's times of peak and vector-sum time, from the unit's peak
|
||||
samples (`pretrig` given): they replace the samples' own, which differ
|
||||
only where the stored samples wrap (O117I1NK.R70W)."""
|
||||
only where the stored samples wrap (O117I1NK.R70W)
|
||||
* over range, every record type: a channel whose peak passes full scale,
|
||||
and the vector sum when any geophone does -- Blastware's OORANGE on all
|
||||
43 such events, and on none of the 38 whose vector sum alone passes
|
||||
the range (2026-11-09)."""
|
||||
# The summary's geophone values are decoder units, as a histogram's are.
|
||||
unit_ins = _HIST_GEO_COUNTS_PER_UNIT * geo_fs_ins / _GEO_INT16_FS
|
||||
for ch, attr in (("Tran", "tran"), ("Vert", "vert"), ("Long", "long"), ("MicL", "mic")):
|
||||
@@ -867,11 +871,13 @@ def _apply_unit_summary(pv: PeakValues, summary: dict, geo_fs_ins: float, sample
|
||||
hz, above = _zc_from_half_period(c["half_period"], sample_rate)
|
||||
setattr(pv, f"{attr}_zc_freq", hz)
|
||||
setattr(pv, f"{attr}_zc_above_range", above)
|
||||
setattr(pv, f"{attr}_over_range", max(abs(c["min"]), abs(c["max"])) > _SUMMARY_FULL_SCALE)
|
||||
if pretrig is None:
|
||||
continue
|
||||
setattr(pv, f"{ch.lower()}_time_of_peak", (c["peak_sample"] - pretrig) / sample_rate)
|
||||
if ch != "MicL":
|
||||
setattr(pv, f"{attr}_peak_disp_in", c["disp_integral"] * unit_ins / sample_rate / 2)
|
||||
pv.pvs_over_range = pv.tran_over_range or pv.vert_over_range or pv.long_over_range
|
||||
if pretrig is not None and all(ch in summary for ch in ("Tran", "Vert", "Long")):
|
||||
pv.pvs_time = (summary["pvs_sample"] - pretrig) / sample_rate
|
||||
|
||||
@@ -1109,6 +1115,10 @@ _EVENT_RECORD_ID = 0x05
|
||||
_SUMMARY_PVS_SAMPLE = slice(25, 29)
|
||||
_SUMMARY_CHANNELS = {0x32: "Tran", 0x33: "Vert", 0x34: "Long", 0x35: "MicL"}
|
||||
_SUMMARY_CHANNEL_LEN = 21 # the payload; the record is 22 with its id
|
||||
# Full scale in the summary's units: 2,000 x 16 = 32,000 counts on either
|
||||
# geophone range, and 2,000 counts on the mic. A peak past it is Blastware's
|
||||
# OORANGE: numeric up to 1,991 / 1,933, OORANGE from 2,001 (DL2, 2026-11-09).
|
||||
_SUMMARY_FULL_SCALE = 2000
|
||||
|
||||
|
||||
def _unit_summary(chain: dict[int, bytes]) -> Optional[dict]:
|
||||
|
||||
Reference in new issue
Block a user