feat(db): persist per-channel ZC freq on insert/upsert
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDXjZCr4RqT2U3QvMDhgzf
This commit is contained in:
+31
-3
@@ -415,8 +415,12 @@ class SeismoDb:
|
||||
sample_rate, record_type,
|
||||
blastware_filename, blastware_filesize,
|
||||
a5_pickle_filename, sidecar_filename,
|
||||
device_family)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
device_family,
|
||||
tran_zc_freq, vert_zc_freq, long_zc_freq, mic_zc_freq,
|
||||
tran_zc_above_range, vert_zc_above_range,
|
||||
long_zc_above_range, mic_zc_above_range)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
||||
?, ?, ?, ?, ?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
self._new_id(), serial, key, session_id, ts,
|
||||
@@ -436,6 +440,14 @@ class SeismoDb:
|
||||
rec.get("a5_pickle_filename"),
|
||||
rec.get("sidecar_filename"),
|
||||
device_family,
|
||||
pv.tran_zc_freq if pv else None,
|
||||
pv.vert_zc_freq if pv else None,
|
||||
pv.long_zc_freq if pv else None,
|
||||
pv.mic_zc_freq if pv else None,
|
||||
(1 if (pv and pv.tran_zc_above_range) else 0),
|
||||
(1 if (pv and pv.vert_zc_above_range) else 0),
|
||||
(1 if (pv and pv.long_zc_above_range) else 0),
|
||||
(1 if (pv and pv.mic_zc_above_range) else 0),
|
||||
),
|
||||
)
|
||||
inserted += 1
|
||||
@@ -477,7 +489,15 @@ class SeismoDb:
|
||||
blastware_filesize = ?,
|
||||
a5_pickle_filename = ?,
|
||||
sidecar_filename = ?,
|
||||
device_family = COALESCE(?, device_family)
|
||||
device_family = COALESCE(?, device_family),
|
||||
tran_zc_freq = ?,
|
||||
vert_zc_freq = ?,
|
||||
long_zc_freq = ?,
|
||||
mic_zc_freq = ?,
|
||||
tran_zc_above_range = ?,
|
||||
vert_zc_above_range = ?,
|
||||
long_zc_above_range = ?,
|
||||
mic_zc_above_range = ?
|
||||
WHERE serial = ? AND timestamp = ?
|
||||
""",
|
||||
(
|
||||
@@ -497,6 +517,14 @@ class SeismoDb:
|
||||
rec.get("a5_pickle_filename") if rec else None,
|
||||
rec.get("sidecar_filename") if rec else None,
|
||||
device_family,
|
||||
pv.tran_zc_freq if pv else None,
|
||||
pv.vert_zc_freq if pv else None,
|
||||
pv.long_zc_freq if pv else None,
|
||||
pv.mic_zc_freq if pv else None,
|
||||
(1 if (pv and pv.tran_zc_above_range) else 0),
|
||||
(1 if (pv and pv.vert_zc_above_range) else 0),
|
||||
(1 if (pv and pv.long_zc_above_range) else 0),
|
||||
(1 if (pv and pv.mic_zc_above_range) else 0),
|
||||
serial,
|
||||
ts,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user