Skip to main content

Module daslogs

Module daslogs 

Source
Expand description

DASlogs-based run-health summary for SNS NeXus files (hdf5 feature).

A VENUS acquisition can be paused mid-run or suffer accelerator beam dips; both silently reduce the effective exposure of the summed TIFF stack. run_health reads the slow-control logs under /entry/DASlogs/<pv>/{time,value} and reports the time-weighted fraction of the run spent paused and the fraction spent with the beam power dipped below a threshold.

§Transition logs, not samples

DASlogs PVs log transitions: an entry is written when the value changes, not on a regular clock. Taking the plain mean of the logged entries is therefore wrong (a run paused for 90 % of its duration may contain just two pause entries). All statistics here use last-value-held time-weighted integration instead: value[0] holds from t = 0, each value[i] holds until the next log entry, and the final value holds to the end of the run. Intervals are clamped to [0, duration] (DASlogs timestamps can precede the run start).

§Run duration

The window length comes from the /entry/duration scalar when present. Otherwise it falls back to the latest log timestamp across the PVs that were read — a lower bound on the true run duration (the run continued after the last logged transition), which makes the reported fractions upper bounds. A non-positive or non-finite window is a hard error, never a NaN fraction.

§SNS PV names

The defaults target SNS: pause (nonzero while the DAQ is paused) and proton_charge (per-pulse beam power proxy). Other facilities pass their own PV names via RunHealthOptions.

Structs§

RunHealth
Run-health summary computed from DASlogs.
RunHealthOptions
Options for run_health: PV names and the beam-dip threshold.

Constants§

DEFAULT_POWER_DIP_FRACTION
Default beam-dip threshold as a fraction of the median power.

Functions§

run_health
Compute a run-health summary from /entry/DASlogs of a NeXus file.