The reference gains D.6.10: the histogram's embedded event record (lead
00 28 05 00, source 04 00, marker fe f5, start, stop) and the interval
and peak-time rules, with 'histograms stay on ts1' retracted in place.
CLAUDE.md 'Where things stand' records the new events key -- any lookup
by event needs the type -- and 47 of 88; the README roadmap follows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
With the start right, the rest of Blastware's histogram timing follows,
measured on a 2,000-histogram DL2 sample:
- each interval's printed time is its end, start + (i + 1) x interval,
capped at the stop: 2,308,524 / 2,308,524 rows
(event_file_io.interval_times)
- each of Tran / Vert / Long / PVS / MicL's peak date and time is that of
the interval holding its first maximum: 2,000 / 2,000 each.
The checker compares intervals.Time and the ten peak date/time fields.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
The footer's start runs a second early on 97% of histograms. Each
histogram carries an event record like a waveform's -- lead 00 28 05 00,
source 04 00, marker fe f5, then start and stop -- and it holds
Blastware's Histogram Start and Stop on 63,490 / 63,490 DL2 histograms.
On all 63,500 there is exactly one, its start 0 or 1 s after the
footer's and its stop 0 or 1 s before; that is the validation rule.
Without a validated record the footer's start stands, as a decode
problem.
Ships with the unit + time + type key (ea2dfc2), without which a
waveform and its histogram at the same second would collide. Three
tests that pinned the old footer start (one said 'for now', pointing at
#51) now pin the record's, which equals the file's Blastware name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Under the unit + time + type key, the test's untyped neighbour no longer
shared the imported waveform's key, so the waveform was stored as its
own row -- the neighbour untouched, which is what the test's name asks.
The guard's job is an estimate landing on another waveform's second, so
the neighbour is now a waveform. A companion test pins the case the new
key allows: an estimate beside a histogram at its second is stored
alongside it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
The events table was UNIQUE(serial, timestamp): one event per unit per
second. A unit records a waveform and a histogram in the same second
legitimately -- 209 times in prod's 2026-09-30 store once histograms
carry Blastware's start -- so the key is now (serial, timestamp,
record_type). Agreed with Brian 2026-11-03.
- Migration 3 rebuilds the table from its own current definition with
only the key swapped, in one transaction: every column, row and id is
kept (Terra-View reads rows by id) and the indexes are recreated.
Migration 1's check no longer mistakes the new key for a missing one.
- The upsert, the estimate guard and the restamp match on the type too.
The restamp also re-types a file's own row in place: before v0.33.0 a
row's type came from the filename, and a re-import under the file's
own type must not add a second row.
- An untyped event still refreshes the untyped row at its second (a
UNIQUE key treats NULLs as distinct).
- scripts/repair_unknown_serials.py checks the new key.
No time changes yet: that is the next commit, and they ship together.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Interval size (k - 40), the stop (footer ts2), frequency = (sample rate
/ 2) / half-period with Blastware's words for N/A, >100 / >200 and
<1.0, and each interval's vector sum with its OORANGE rule. The old
fixed-512 frequency formula is retracted in place. CLAUDE.md and the
README roadmap follow: 34 of 88.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Blastware prints OORANGE for an interval's vector sum when it exceeds
the range in an interval where Blastware also clamped a channel: 17 / 17
DL2 cells, SFM's sum 10.01 .. 17.33 in/s (sqrt 3 x 10.005). The
saturation carve-out now covers intervals.Geo PVS in/s with that rule,
per interval, as it already did for PeakVectorSum. The 4 other cells
left mismatching sit 4e-6 past a rounding boundary (Blastware's
arithmetic is a hair lower) and stay mismatches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Group B of the file-only decode, measured on DL2 2026-11-03:
- Frequency = (sample rate / 2) / half-period: 527,915 / 527,915 cells
at 1024 sps and 1,725 / 1,725 at 2048. #50: half_period_to_hz took a
fixed 512 and halved every 2048-sps frequency; it now takes the rate
(default 1024). Blastware prints 'N/A' for a half-period of 0, '>100'
('>200' at 2048) at 5 samples or fewer, '<1.0' below 1 Hz.
- Each interval's vector sum, sqrt(PVS^2) at the event's range:
771,354 / 771,354.
- Interval size: uint16 seconds at k - 40 (Series IV [8:10]).
- Stop: the footer's (2,995 / 2,999 sampled; 4 print a second earlier).
Event gains histogram_interval_sec, interval_half_periods, interval_pvs
and stop_time; the .h5 gains /intervals/half_period/<ch>,
/intervals/pvs_ips and a histogram_interval_sec attr. The decoder walks
a histogram once (histogram_codec.channels_from_records) and takes the
event's PVS from the same records. The checker compares each interval
column, number or Blastware's word; the test that pinned Tran Freq Hz
as blank now pins the match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Protocol reference:
- D.6.8 (new): the identity block (SUB FE's: serial, firmware, DSP version,
calibration date and 'by', model; battery), the trigger-source bitmask
in the embedded event record, and the trigger settings (sources, stop
mode, per-channel levels, mic type) with their DL2 counts. The
histogram 'terminal tail' 9c 06 00 42 looks like 9c 06 00 + the
serial's B (inferred).
- D.6.6: recorded data vs report units vs unit peaks, with the
MiniMate Plus (s3.9.7) and Blastware (s4) manual sections. Where the
unit stores its own Microphone Units is unmeasured; a keypad test is
proposed.
- D.6.9 (was D.6.7): refreshed, 28 of 88.
CLAUDE.md 'Where things stand' and the README roadmap follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Both settings are documented: the unit's Microphone Units (MiniMate Plus
manual s3.9.7, keypad Right Arrow + Setups: psi(L) / dB(L) / Pa(L)) and
Blastware's report preference (Blastware manual s4, Preferences > Units
and Channel). The report follows Blastware's, as DL2's fleet-wide
switches showed. Where the unit's own setting is stored is unmeasured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
K441LA17.IN0W's report says Units 'in/s and psi(L)' yet prints
MicTriggerLevel '125.0 dB(L)'. The value states its own unit, so that
is the one compared; the report's Units is the fallback. It was the
only MicTriggerLevel mismatch in DL2 (SFM's 0.005158 psi is 125.0 dB).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Group A of the file-only decode, every field matched against every DL2
report (2026-11-03):
- Identity block before the setup name, what the live read gets from
SUB FE: serial k-202, firmware k-147, DSP version k-138, calibration
date k-132 + 'by' k-128, manufacturer k-94, model k-72, firmware
minor k-193. Event.device_info (DeviceInfo gains calibration_date /
calibrated_by). Serial, Version and Calibration 69,983 / 69,983.
- Battery: uint16 hundredths of a volt at k-190 (Event.battery_volts).
69,729 exact; the other 254 are Blastware rounding half up.
- Trigger source: the two bytes between the embedded event record's
lead and fe 80, a bitmask (0x01 Tran 0x02 Vert 0x04 Long 0x08 MicL
0x200 Manual): 6,493 / 6,493. Event.triggered_by.
- Trigger settings in Series IV's 0x1A layout: sources bitmask k-19,
stop mode k-31 (0 = Fixed), each channel's float32 level at
label+30 (geo in/s, mic psi), mic type code at MicL+4 (2 = Linear
Weighting). Geo level 6,447 / 6,447, mic 4,403 / 4,403; Blastware
prints a level when its channel is a trigger source and the event
was not Manual. The mic level's dB uses 6895 Pa/psi (4,272 / 4,272
against 4,271 at 6894.757).
- .h5 attrs for all of them (additive).
- Checker: SFM's side reports the ten fields; the mic trigger level
follows the report's dB/psi. Carve-out
units-is-a-display-preference: dB or psi is Blastware's PC setting
when it wrote the report -- DL2's reports switch fleet-wide in 61
clean runs by write time, and no byte of the file separates them.
Two tests that pinned BatteryLevel / Calibration as blank now pin the
match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
CLAUDE.md 'Where things stand' now says plainly how prod uses a paired
Blastware ASCII report (save_imported_bw overlays its peaks, notes,
sample rate and record time onto SFM's decode), that only report-less
events run on the decoder alone, and that the overlay is scaffolding to
retire at step 3 of the plan. The checker status is brought up to dev:
18 of 88 fields, the remaining groups A-F in the proposed order.
README roadmap: the same framing and progress.
Protocol reference:
- D.3.3: the footer is the file's last 26 bytes; footer[18:24] is not
fixed (retracted).
- D.6.1: STRT[18] picks the codec.
- D.6.3: the job number.
- D.6.5: the PVS^2 high word is non-zero above 1.28 in/s (retracted
'reads 0000'); the peak/PVS consistency check; Blastware's Number of
Intervals is the monitoring time / the interval.
- D.6.7: refreshed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Brian's account: units come back from calibration with the internal
battery unplugged, so a comms-test trigger before the date is set
carries the default. DL2 holds 17 such events on 6 units, all within
1995-09-01 12:02 .. 09-03 11:24.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Every DL2 file ends in a valid footer: 0e 08 and two valid times on
70,041 / 70,041. The decoder took the first '0e 08 + plausible year'
instead, and 14 files also hold an earlier record, ~1.1 KB before the
end, with the stop time followed by zeros:
- a histogram started at its own stop -- a day late on BE9558's daily
histograms (K558L9XP.FK0H: 2025-10-08 19:10:01 for Blastware's
2025-10-07 19:14:08); T003LCYV.JD0H got no time at all;
- a waveform lost its stop, so the trigger was never computed and the
stop was stamped instead (K440I4LG.JK0W: 11:14:12 for 11:14:08).
The last 26 bytes are now taken when they are a footer; otherwise the
old search stands unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Three causes behind the histograms the checker found decoding wrongly:
1. The file decoder tried the waveform codec first, whatever the record
type. It accepted BE9440 / BE9557 / BE17354's 2018 5 s histograms and
returned ~5x too many 'samples' (K440HDXX.XH0H: SFM 44,504, Blastware
6,976). The codec now follows STRT[18] (0x46 / 0x0A on 70,041 /
70,041 DL2 files); only an unknown type falls back to trial order, and a
chosen codec that fails is a decode problem rather than a silent switch.
2. The sub-minute layout check required each record's 'zero word' to be
0000. It is the high word of the interval's PVS squared, non-zero above
1.28 in/s, so a one-block histogram with a loud interval was not
recognised (T193KR5M.X90H, K440HA3C.JM0H, R352HFZ7.530H decoded to
nothing). The check is now the measured relation peak <= PVS <=
sqrt(3) * peak, which holds on 34,502,955 / 34,502,955 DL2 sub-minute
intervals. The no-terminal-tail trim uses the same test. Two test
builders wrote PVS bytes no real record has (one still in the retracted
little-endian layout); they now write peak^2 in the measured layout, and
the retraction test keeps a legacy builder of its own.
3. Checker carve-out interval-count-is-duration: Blastware's Number of
Intervals is (stop - start) / interval from the footer times, and its
own interval table lists one block fewer when the unit never wrote the
last minute. SFM matches the table (T193KSWP.FF0H: 2,880 vs 2,850).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
The setup block has Series IV's 0x1A layout here too: report flags at
k - 9 (bit 0x02 = job number shown) and the number, uint16 BE, at k - 8,
kept while switched off. The flag matches Blastware's JobNumber on
2,997 / 2,997 DL2 events that print one and 66,986 / 66,986 that don't.
Every printed value is 1 and matches; hidden ones hold real numbers
(802, 1012, 1013, 622), so the value is only proven for 1.
- ProjectInfo.job_number_enabled / job_number, named as in
micromate.setup_block.
- write_event_hdf5 stores both as .h5 attrs when read (additive).
- The checker reports the number only when shown, and scores a number
only SFM shows as a mismatch. The old test that pinned JobNumber as
sfm_blank now checks only the ZC cases it also covered.
Not carried into the DB, the API or the PDF report yet (needs a column).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
The pre-trigger float in an event file's setup block varies from event
to event on the same unit, often on the same day (BE18193: -0.25 and
-0.248 on 2026-08-21; 253-256 samples at 1024 sps, -0.002 to -0.249 s
at 4096 sps), and Blastware reports the same per-event value as
Pre-triggerLength. So it is the event's own pre-trigger, and the note
written earlier today overstated what the files say about #48: the live
1A holds the setting, so a missing anchor in a file says little about
whether the live read loses its anchor. #48 stays open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
New Appendix D.6 records the bytes and DL2 verification for every field
SFM reads from a Blastware event file: record type STRT[18], the
recording-setup block (sample rate k-42, pre-trigger k-36, record time
k-30, the four notes), the geophone range (label+29), each histogram
interval's PVS^2, and the mic scale (0.25 Pa per count, dB offset
81.9384). None of these were written down outside code and issues.
Retracted in place:
- D.3.1's STRT[20] = record time: it is 00 on 70,041 / 70,041 DL2 files.
- the 2026-08-26 reading of sub-minute histogram records as little-
endian: big-endian from byte 5 since v0.32.0 (#47/#49), and the
'2-word tail' is the PVS^2. Also in CLAUDE.md.
Measured for #48 (files only): the 1A 'stable anchor' be 80 00 00 00 00
is the setup's pre-trigger -0.25 s plus 00 00. It is present only on
the 3,886 / 6,541 DL2 waveforms recorded at exactly -0.25 s, and on no
histogram. The live 1A read is still unmeasured.
CLAUDE.md: Where things stand reflects the range fix on dev (6,524 /
6,524 waveforms exact); the 8x sensitive-range item and the MicL dB
item are marked resolved in place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
In the setup's channel blocks, the byte 29 after each geophone label is
the range: 0x00 Normal (10 in/s), 0x01 Sensitive (1.25 in/s). It matches
Blastware's GeoRange on 70,042 / 70,042 DL2 events, all three channels
agreeing on every one (35 Sensitive). SFM's live 1A has the same byte
at label+33. SFM assumed Normal, so every Sensitive event's peaks,
vector sum and .h5 samples read 8x high.
- Event.geo_range (0 / 1, None when not read -- channels disagreeing,
an unknown value or a missing block -- with a decode_problems entry).
- decode_blastware_bytes scales peaks and the histogram vector sum by it.
- event_hdf5.write_event_hdf5: geo_range defaults to None = the event's
own, else Normal; an explicit argument still wins.
- waveform_store.save_imported_bw and scripts/backfill_sidecars.py stop
forcing 'normal', so imports and the backfill store the file's range.
The waveform_store line was agreed with the parity session, which owns
that file; its own branch keeps a geo_range parameter, defaulting to
None at its next dev merge.
- The checker's SFM side converts at the event's range and reports
GeoRange; tests that pinned the old 8x gap now pin the fix, and the
saturation carve-out is still tested against an 8x value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
A Blastware event that reaches SFM without its ASCII report -- every DL2
event before 2025, and every event SFM downloads itself -- now carries
its sample rate, record time, pre-trigger, notes and event type, the
histogram vector sum the unit stores, and a mic reading at one count =
0.25 Pa. The new decode checker proves each against Blastware's own
_XML.XML reports for 70,042 DL2 events.
- CHANGELOG: Unreleased -> v0.33.0 with theme and Migration.
- TOOL_VERSION 0.33.0 (gates the backfill regeneration).
- pyproject, CLAUDE.md and README versions; README status entry and
roadmap (the Series-III codec item was long done; the file-only goal
added); CLAUDE.md 'Where things stand' brought up to v0.33.0.
Deploy: back up seismo_relay.db, then backfill_sidecars.py and
backfill_event_shape.py (~2 h on the NAS). No schema change, no
migration, event times do not move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
The checker caught 280 regressions in the first mic fix: every one a dB
value at count 129, where 20 log10(129 x 0.25 Pa / 20 uPa) = 124.149997
rounds to 124.1 and Blastware prints 124.2. Blastware's dB offset sits in
[81.9383, 81.9385] -- any value there matches its dB(L) on 1,729,252 /
1,729,253 DL2 intervals (the last printed '0.000'); exact 81.93820 rounds
count 129 down, and the old 81.94 misses counts 119 and 132. Single
precision does not explain it. psi keeps 0.25 Pa per count, which
matches every interval.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9