Skip to main content

run_health

Function run_health 

Source
pub fn run_health(
    path: &Path,
    options: &RunHealthOptions,
) -> Result<RunHealth, IoError>
Expand description

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

See the module docs for the last-value-held semantics, the duration fallback, and the SNS PV-name defaults.

§Errors

  • IoError::Hdf5Error when the file or /entry cannot be opened.
  • IoError::InvalidParameter when a PV is present but malformed (time/value length mismatch, non-finite entries, negative power values, decreasing timestamps), /entry/duration is present but non-positive or non-finite, the integration window is non-positive, or power_dip_fraction is not a positive finite number.

Absent PVs (or an absent DASlogs group) are not errors — the corresponding fields are None, as is a present PV with zero log entries (“no entries logged” carries no integrable information). Absence vs malformed is decided by link existence (member_names), the read_dead_pixel_mask idiom: collapsing “not there” and “there but unreadable” into one path would mask real file corruption as absence.

beam_dip_fraction is additionally None (with median_power still reported) when the sample median of the power entries is non-positive: the dip threshold power_dip_fraction × median is then undefined — see RunHealth::beam_dip_fraction.