chore(release): v0.24.0 — waveform-shape metrics on events
This commit is contained in:
@@ -8,6 +8,37 @@ All notable changes to seismo-relay are documented here.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## v0.24.0 — 2026-08-22
|
||||||
|
|
||||||
|
**Waveform-shape metrics on events.** The `events` table and the `/db/events`
|
||||||
|
feed now carry per-event crest factor and points-near-peak, computed from the
|
||||||
|
decoded waveform samples at ingest — groundwork for Terra-View's
|
||||||
|
false-trigger detection (Phase B).
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **`events` columns** `shape_crest_factor`, `shape_near_peak_count`,
|
||||||
|
`shape_sample_count`, `shape_axis`. Added via the existing incremental
|
||||||
|
`_migrate` ADD COLUMN pass — **auto-migrates on `SeismoDb()` construction,
|
||||||
|
no manual migration**. `query_events` / `get_event` (and thus `/db/events`)
|
||||||
|
return them automatically (`SELECT *`).
|
||||||
|
- **Populated at ingest** — crest factor + near-peak-count are computed from
|
||||||
|
the decoded samples in every save path (`shape_from_h5`/
|
||||||
|
`shape_from_samples`), and `insert_events` persists them on INSERT and
|
||||||
|
UPSERT.
|
||||||
|
- **Backfill** `scripts/backfill_event_shape.py` — fills the columns for
|
||||||
|
existing events from their on-disk `.h5` waveform samples (idempotent,
|
||||||
|
UPDATE-only).
|
||||||
|
|
||||||
|
### Upgrade Notes
|
||||||
|
|
||||||
|
Run the backfill once after deploying, against the events DB + waveform store:
|
||||||
|
`python3 scripts/backfill_event_shape.py --db-path <seismo_relay.db> --store-root <waveforms/>`
|
||||||
|
Events with no decodable samples (or no waveform file) stay NULL and render
|
||||||
|
"—" downstream.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## v0.23.0 — 2026-08-04
|
## v0.23.0 — 2026-08-04
|
||||||
|
|
||||||
**Per-channel ZC frequency in the events store.** The `events` table and the
|
**Per-channel ZC frequency in the events store.** The `events` table and the
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "seismo-relay"
|
name = "seismo-relay"
|
||||||
version = "0.23.0"
|
version = "0.24.0"
|
||||||
description = "Python client and REST server for MiniMate Plus seismographs"
|
description = "Python client and REST server for MiniMate Plus seismographs"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ app = FastAPI(
|
|||||||
"Implements the minimateplus RS-232 protocol library.\n"
|
"Implements the minimateplus RS-232 protocol library.\n"
|
||||||
"Proxied by terra-view at /api/sfm/*."
|
"Proxied by terra-view at /api/sfm/*."
|
||||||
),
|
),
|
||||||
version="0.23.0",
|
version="0.24.0",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Allow requests from the waveform viewer opened as a local file (file://)
|
# Allow requests from the waveform viewer opened as a local file (file://)
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
import os, sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
|
||||||
|
from sfm.database import SeismoDb
|
||||||
|
from minimateplus.models import Event
|
||||||
|
|
||||||
|
SHAPE_COLS = (
|
||||||
|
"shape_crest_factor",
|
||||||
|
"shape_near_peak_count",
|
||||||
|
"shape_sample_count",
|
||||||
|
"shape_axis",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_query_events_row_includes_shape_keys(tmp_path: Path):
|
||||||
|
db = SeismoDb(tmp_path / "s.db")
|
||||||
|
|
||||||
|
ev = Event(index=0)
|
||||||
|
ev._waveform_key = bytes.fromhex("0111abcd")
|
||||||
|
|
||||||
|
db.insert_events([ev], serial="BE1")
|
||||||
|
row = db.query_events(serial="BE1")[0]
|
||||||
|
|
||||||
|
for k in SHAPE_COLS:
|
||||||
|
assert k in row
|
||||||
|
assert row[k] is None
|
||||||
Reference in New Issue
Block a user