Skip to content

BIFROST: unpin detector geometry once a corrected NeXus file is available #962

Description

@SimonHeybrock

Summary

BIFROST's detector geometry is temporarily pinned to the old geometry artifact (geometry-bifrost-2025-01-01.nxs) while the chopper workflow consumes a newer one (geometry-bifrost-2026-06-08.nxs). Both are in the geometry registry; each consumer selects the file in which its data is valid. This issue tracks collapsing back to a single artifact once a corrected source file is available.

Why the split exists

The new source file coda_bifrost_999999_00006061.hdf has correct, up-to-date chopper geometry (new group names bandwidth_chopper_*, frame_overlap_chopper_*, pulse_shaping_chopper_*; pulse-shaping choppers moved ~7 cm), but a broken detector transformation chain:

  • The detector_tank_angle group lost its numeric prefix (was 117_detector_tank_angle), but detector_tank_angle_r0/value still has depends_on/entry/instrument/117_detector_tank_angle/transformations/detector_tank_angle_t0 (stale prefix).
  • The static detector_tank_angle_t0 zero-offset node is missing entirely from the file.

Loading the detector geometry therefore raises a dangling-depends_on warning and fails the reduction. The chopper workflow is unaffected — it loads only NXdisk_chopper + NXsource, never the detector chain. (Reported upstream to the file-writer side.)

The missing _t0 value cannot be safely reconstructed: in the old file it was 0.1192°, identical to the choppers' *_t0_r offset; in the new file that offset was re-surveyed to 0.0974°. Grafting the old value would inject a known-stale number; inferring 0.0974° is unverified. So we pin rather than fabricate.

Cleanup when a corrected file lands

A single NeXus file valid for both detectors and choppers (complete detector_tank_angle chain incl. _t0, new chopper names):

  • Regenerate the geometry artifact (ess-livedata-make-geometry-nexus) and streams_parsed.py (nexus_helpers --generate) from it; add one new registry entry in detector_data_handler.py.
  • In bifrost/factories.py:
    • Drop the date= pin on the reduction's get_nexus_geometry_filename('bifrost') call so both consumers use the latest entry.
    • Switch _detector_names from the prefixed form (123_channel_1_1_triplet) to the unprefixed form (channel_1_1_triplet) — the new files drop the prefix (detector_number content is identical).
    • Remove the two-file rationale comments.

Related changes already on the chopper branch

  • Chopper-cascade / wavelength-LUT workflow wired into the BIFROST factory; integration test tests/config/bifrost_wavelength_lut_test.py.
  • log_producer_bifrost.json extended with per-chopper speed-setpoint + delay sliders for dev-mode testing.
  • make_geometry_nexus.py fixed to handle event-only monitors lacking depends_on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workflowsInstrument configs, geometry, reduction and science logic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions