From 6cb619ecc4602a1eb13e93381aa9d4546c8b44d1 Mon Sep 17 00:00:00 2001 From: serversdown Date: Mon, 1 Jun 2026 19:33:44 +0000 Subject: [PATCH] version bump - 0.21.1 --- CHANGELOG.md | 57 +++++++++++++++++++++++++++++++++++ minimateplus/event_file_io.py | 2 +- pyproject.toml | 2 +- 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index decd53e..77478d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,63 @@ All notable changes to seismo-relay are documented here. --- +## v0.21.1 — 2026-06-01 + +Bug fixes against v0.21.0 surfaced after the first prod redeploy. Three +production-visible symptoms — blank waveform charts on most Thor events, +blank histogram charts on all Thor events, and a mic chart that +auto-scaled against a dB(L) value treated as psi — all root-caused and +fixed. + +### Fixed + +- **Dynamic IDFW body offset.** The v0.21.0 codec hardcoded the body + at file offset `0x0f1f` based on the example corpus, but only ~52% + of production IDFW events use that offset; the rest sit at offsets + from `0x1033` up to `0x3082` depending on header padding. At + `0x0f1f` the codec would find a coincidentally-matching `00 02 00` + magic, read the 2-byte Tran preamble, and return empty V/L/M + arrays — producing near-empty .h5 files and blank charts. + `micromate.idf_file._find_waveform_body_offset()` now scans every + `00 02 00` magic position past `0x0E00`, trial-decodes each one, + and picks the offset with the most samples. Validated across 483 + prod IDFW files: 0 preamble-only events (was ~50%), 355/483 fully + decode, 126/483 partial (BW codec walker-stops-early on loud + events — pre-existing limitation, samples reached are correct). + +- **IDFH histograms now render bar charts.** Histograms previously + skipped the .h5 write because there are no per-sample arrays, but + the renderer drives the per-interval bar chart from .h5 channel + data + `bw_report.histogram.n_intervals`. `save_imported_idf` now + synthesizes a 1-sample-per-interval array from the decoded + `IdfhInterval` peak counts and writes an .h5 so the existing + renderer works unchanged — each "sample" is the per-interval peak + ADC count, so the writer's `count × geo_fs/32768` conversion + yields the right bar height. + +- **Mic chart scaling on Thor events.** `PeakValues.micl` (consumed + by the h5 writer's per-count mic scale factor) expects psi, but + the Thor bridge was stuffing the dB(L) value (~99.4) into it, + producing a per-count factor 5+ orders of magnitude too large and + a flat-looking mic chart. Fixed by adding `IdfPeaks.mic_pspl_psi` + alongside `mic_pspl_dbl`; `read_idf_file()` computes it from + binary mic counts (`max(|MicL|) × 2.14e-6 psi/count`) for both + IDFW and IDFH paths; `save_imported_idf` merges it onto the typed + event after `IdfEvent.from_report`; the bridge feeds psi to + `PeakValues.micl` with a dB(L)→psi formula fallback when only the + dB(L) value is available. dB(L) for the report header still + flows through `bw_report.mic.pspl_dbl` unchanged. + +### Operator + +After deploy, run `python scripts/backfill_thor_events.py` to refresh +every existing Thor event's sidecar + .h5 with the corrected codec +output. The script auto-skips events already at the current +`TOOL_VERSION`, so the bump from `0.21.0` → `0.21.1` is what triggers +the refresh. + +--- + ## v0.21.0 — 2026-05-29 The "Thor / Series IV codec" release. Two big pieces landed: (1) the IDF binary codec actually decodes now, both IDFW and IDFH, and (2) a Thor→BW adapter lets Thor events flow through the existing Series III Event Report PDF pipeline. Combined effect: a Thor event ingested via `/db/import/idf_file` now lands in the DB with the same fidelity as a Blastware event, gets a per-event PDF on demand, and renders in Terra-View's modal chart with the same plotting code as a BW event. diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 6b61f7e..faa3d98 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -49,7 +49,7 @@ SIDECAR_KIND = "sfm.event" # bumped without a `pip install` re-run — leading to confusing stale # version stamps in sidecars. Bump this constant and CHANGELOG.md # together at release time. -TOOL_VERSION = "0.21.0" +TOOL_VERSION = "0.21.1" try: # Best-effort: prefer the installed metadata when it's NEWER than the diff --git a/pyproject.toml b/pyproject.toml index f8e4ae8..dafdc73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "seismo-relay" -version = "0.21.0" +version = "0.21.1" description = "Python client and REST server for MiniMate Plus seismographs" requires-python = ">=3.10" dependencies = [