Module nexus

Module nexus 

Source
Expand description

NeXus/HDF5 reading for rustpix-processed neutron imaging data.

Supports two data modalities from rustpix output files:

  • Histogram: 4D counts array (rot_angle, y, x, tof) summed over rotation angles and transposed to NEREIDS convention (tof, y, x).
  • Events: per-neutron (event_time_offset, x, y) histogrammed into a (tof, y, x) grid with user-specified binning parameters.

§HDF5 Schema (rustpix convention)

/entry/histogram/counts          — u64 4D [rot_angle, y, x, tof]
/entry/histogram/time_of_flight  — f64 1D, nanoseconds
/entry/neutrons/event_time_offset — u64 1D, nanoseconds
/entry/neutrons/x                — f64 1D, pixel coordinate
/entry/neutrons/y                — f64 1D, pixel coordinate
/entry/pixel_masks/dead          — u8  2D [y, x]

Metadata attributes on /entry or group level:

  • flight_path_m (f64)
  • tof_offset_ns (f64)

Structs§

EventBinningParams
Parameters for histogramming neutron event data into a 3D grid.
EventRetentionStats
Statistics on how many events were kept vs dropped during histogramming.
Hdf5TreeEntry
An entry in the HDF5 group/dataset tree hierarchy.
NexusHistogramData
Histogram data loaded from a NeXus file, ready for NEREIDS processing.
NexusMetadata
Metadata probed from a NeXus/HDF5 file without loading full data.

Enums§

Hdf5EntryKind
Kind of HDF5 tree entry.

Functions§

list_hdf5_tree
List the group/dataset tree structure of an HDF5 file.
load_nexus_events
Load neutron event data from a NeXus file and histogram into a 3D grid.
load_nexus_histogram
Load histogram data from a NeXus file.
probe_nexus
Probe a NeXus/HDF5 file for available data modalities and metadata.