Expand description
DASlogs run-log reading and beam-state interval derivation (issue #637).
SNS/HFIR NeXus files record slow-control PVs under
/entry/DASlogs/<pv>/{time, value}. These are transition logs, not
uniformly-sampled time series: each value[i] takes effect at time[i]
(seconds relative to run start) and persists until time[i+1] (the last
value persists to the end of the run). Averaging the value array
directly is therefore wrong whenever entries are unevenly spaced — on a
real VENUS run the entry-mean of the pause log read 0.43 while the
time-weighted truth was 0.90. intervals_where encodes the correct
step-function semantics once, so callers never re-derive them.
Real SNS logs occasionally contain corrupt records: device
reconnects write entries with time = 0.0 and an uninitialized-memory
payload (a subnormal double, ~6.9e-310), observed both mid-log (where
the time jumps backward) and as the leading entry (where it does not)
on VENUS furnace channels BL10:SE:ND1:* in 3 of 59 IPTS-37432 runs.
read_run_log drops entries whose time jumps backward or whose
value is subnormal and reports the count in
RunLog::n_dropped_corrupt, so the step function is never fed
garbage and the anomaly stays visible.
The derived (t_start, t_end) interval lists feed
crate::nexus::load_nexus_bank_spectrum’s keep_intervals event
filter and compose across PVs via intervals_intersect (e.g.
pause == 0 ∩ beam_power > 1.5 MW). Facility-specific PV names never
appear in this crate — they belong to caller code and docstrings.
Structs§
- RunLog
- One slow-control PV read from
/entry/DASlogs/<pv>plus the run length.
Functions§
- intervals_
intersect - Intersect two interval lists — e.g.
pause == 0∩beam_power > 1.5 MW. - intervals_
where - Derive the run-time intervals on which a transition-log PV satisfies
min_value <= value <= max_value(either bound optional), using the correct step-function semantics (issue #637):values[i]holds on[times[i], times[i+1]), the last value holds toduration_s. - read_
run_ log - Read a DASlogs PV as a transition log (issue #637).