feat(checker): read each mic value in the unit Blastware printed; carve out mixed columns
Blastware's dB(L) / psi(L) labels do not hold for the mic on every report (DL2, 2026-11-09): - the mic peak carries its own <Units>, which 7 reports set to dB under a psi Units line and 3 the reverse: the checker now reads the peak in its own unit; - a mic sample table has no unit of its own and need not follow the line (S353JTHU.DT0W prints dB under psi): the checker reads it from its cells -- a mic dB value is never under 60, psi never over 1; - some reports mix the two inside one column: K441L9IN.OT0W prints psi '0.000' for counts of 1 to 3 in a dB table. Carve-out mic-units-mixed accepts a mic field when every cell SFM disagrees with is SFM's own value in the other unit: 19 DL2 events (14 sample tables, 5 peaks); a cell matching neither stays a mismatch. Not a decoder change: SFM's mic data were right. Checker run 20261109-141808: 78 of 88 fields, 0 regressions; no mic peak or mic sample table mismatches left. 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
e21d23a3f2
commit
0b6150adb5
9 files changed
+25513
-4
No files matched your search
@@ -272,8 +272,25 @@ def _same_text(a: object, b: str) -> bool:
|
||||
return " ".join(str(a).split()) == " ".join(b.split())
|
||||
|
||||
|
||||
def _mic_table_units(ref: XmlReport) -> str:
|
||||
"""The unit a report's mic sample table is printed in. Its cells say so --
|
||||
a mic dB value is never under 60, psi never over 1 -- where the event's
|
||||
Units line need not: S353JTHU.DT0W prints dB under psi (2026-11-09)."""
|
||||
if ref.sample_rows and "MicL" in ref.channels:
|
||||
i, seen = ref.channels.index("MicL"), False
|
||||
for row in ref.sample_rows:
|
||||
p = _printed_number(row[i]) if len(row) == len(ref.channels) else None
|
||||
if p is not None:
|
||||
if abs(p[0]) > 1.0:
|
||||
return "dB(L)"
|
||||
seen = True
|
||||
if seen:
|
||||
return "psi(L)"
|
||||
return ref.event_units or ""
|
||||
|
||||
|
||||
def _mic_converter(ref: XmlReport, sfm: SfmSide) -> Optional[Callable[[int], float]]:
|
||||
units = ref.event_units or ""
|
||||
units = _mic_table_units(ref)
|
||||
d = sfm.mic_divisor
|
||||
if "dB(L)" in units:
|
||||
return lambda c: mic_count_to_db(c / d)
|
||||
@@ -293,7 +310,11 @@ def _compare_scalar(tag: str, printed: str, sfm: SfmSide, ref: XmlReport) -> Fie
|
||||
if tag in ("MicLPSPL", "MicTriggerLevel"):
|
||||
# A printed value that states its unit is compared in that unit:
|
||||
# K441LA17.IN0W's Units say psi(L), its MicTriggerLevel "125.0 dB(L)".
|
||||
units = printed if ("dB(L)" in printed or "psi(L)" in printed) else (ref.event_units or "")
|
||||
# Else the field's own <Units>, then the event's line: 7 DL2 reports
|
||||
# print the mic peak in dB under a psi line, 3 the reverse (2026-11-09).
|
||||
own = ref.units.get(tag) or ""
|
||||
units = (printed if ("dB(L)" in printed or "psi(L)" in printed)
|
||||
else own if ("dB(L)" in own or "psi(L)" in own) else (ref.event_units or ""))
|
||||
key = (f"{tag} dB(L)" if "dB(L)" in units else
|
||||
f"{tag} psi(L)" if "psi(L)" in units else None)
|
||||
value = sfm.values.get(key) if key else None
|
||||
|
||||
Reference in new issue
Block a user