The record chain that starts with the embedded event record runs to the
file's end on all 70,041 DL2 files: the event record 0x05, the unit's
summary 0x32-0x35, its sensor checks 0x3c-0x3f, then the footer 0x0e
(no 0x35 / 0x3f on a unit without a mic, 8 files). _record_chain walks
it and refuses a chain that does not end exactly at the file's end; the
unit's summary is now read from it too.
Each sensor-check record's header holds the results (DL2, 2026-11-06):
[2] channel type (1 geophone, 2 mic, 0 disabled), [4] status (0 =
passed), [5:7] frequency x 10, [7:9] ratio x 10, [9:11] amplitude mV.
Blastware prints them as they are: 209,943 / 209,943 geophone
frequencies and ratios, 69,975 / 69,975 mic frequencies and amplitudes;
"Passed" on status 0, "Check" on every other (its bits not decoded:
a Check can sit inside every passing range), "Disabled" on type 0.
Event.sensor_check_results: channel -> SensorCheckResult (result,
status, freq_hz, ratio, amplitude_mv). The checker compares them.
Behaviour change: an unknown id inside an intact chain now leaves only
that record unread (was: everything after it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
After its embedded event record, every Blastware event file carries the
unit's own per-channel summary: a chain of [length][id][payload] records,
ids 0x32 Tran .. 0x35 MicL, each with min, max, peak sample,
half-period and a displacement integral; the event record itself holds
the vector-sum peak's sample. Blastware prints these as they are
(measured on DL2, 2026-11-05):
- ZC frequency = (rate / 2) / half-period: 15,844 / 15,844 waveform and
104,000 / 104,000 histogram values; every word too (">100" at <= 5
samples, "N/A" at 0, "<1.0" beyond rate / 2). Recomputing from the
samples had reached 46%: the unit works at full resolution.
- peak displacement = half the integral x 16 counts x in/s per count /
rate: 19,479 / 19,479 (84% recomputed).
- times of peak and the vector-sum time now come from the unit's peak
samples. They equal the samples' argmax on 25,962 / 25,966 channels;
the 4 others are O117I1NK.R70W, whose stored samples wrap at the
trigger (Blastware's own sample table has the same wrapped values).
The event-record readers return the validated record's offset, so the
summary is read from that spot only. No summary: nothing is set, and
times of peak stay the samples'.
The checker reports ZC frequency and displacement, and reads the mic's
above-range flag under its real name (mic_zc_above_range).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Group D, part 1, measured on 400 DL2 waveforms (2026-11-04):
- time of peak = (first peak sample - pre-trigger samples) / sample
rate, per channel including the mic: 1,197 / 1,197 geophone values
- the vector sum's time, the same on sqrt(T^2 + V^2 + L^2): 398 / 399
- peak acceleration = the largest |v[i+1] - v[i]| x sample rate / g,
with Blastware's g = 9.81 m/s^2: 1,190 / 1,197 (the standard 9.80665
gives 1,073). Blastware's manuals: 'subtracts two velocity readings
and divides the result by the elapsed time between them'.
PeakValues gains *_time_of_peak, pvs_time and *_peak_accel_g, filled
for waveforms only. The checker reports them. Displacement (84% with
the manuals' half-cycle integral) and ZC frequency (46%) are not shipped
yet -- Blastware does something more there.
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
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
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
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
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
SFM converted mic counts to psi with a '~0.5 psi full-scale' guess
(0.0125 / 32768 psi per count). Measured against 1,729,253 DL2
histogram intervals' 'MicL Peak' columns: one count is exactly 0.25 Pa.
count x 0.25 Pa matches Blastware's psi(L) on every interval, and
20 log10(count x 0.25 Pa / 20 uPa) its dB(L) on all but 17 exact
half-way cases.
- event_file_io: _MIC_FS_PSI -> _MIC_PSI_PER_COUNT = 0.25 / 6894.757
(3.626e-5 psi per count, was 3.81e-7). The event's mic peak in psi,
and with it the .h5 mic trace (event_hdf5 back-solves its scale from
that peak), come right on events with no report.
- waveform_codec.mic_count_to_db: the offset is 20 log10(0.25 / 20e-6)
= 81.938, not 81.94 -- the old value missed 49 of those intervals at a
rounding edge (count 119 printed 123.4, 81.94 gave 123.451).
The decoded count was always right: count 16 on K441LTON.900 is
Blastware's 106.0 dB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
A mismatch becomes 'accepted' only through a written carve-out whose
evidence does not rest on SFM's output. Saturation: Blastware clamps a
clipped channel to the range maximum and prints OORANGE, while the file
holds counts past full scale. SFM's value must sit at the ceiling
(r - 0.0006 .. r * 1.01), so a Sensitive-range event read 8x high on
SFM's Normal assumption stays a mismatch; a vector sum is accepted when
a clipped channel under it is at the ceiling. series_pairs() is now the
one place waveform rows and interval columns are paired.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
Every field the report carries (bar its format version and Blastware's
file name), the notes in order, the job number, the channel list, every
waveform sample and every histogram interval column. Numbers match at
Blastware's printed precision, halves rounding away from zero; N/A and
empty text are no_reference; >100 needs SFM's above-range flag; OORANGE
is a mismatch unless a carve-out says otherwise. Waveform rows pair
cells with the channels still running, so channels that end early
(T438HGTZ.B30W) match, and any row-length disagreement is counted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9
decode_blastware_bytes with no filename and no report: the values SFM
produces today in Blastware's field names, its notes, channels and raw
counts, with its Normal-range assumption kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9