Skip to content

[ESSREDUCE] Generalize cylinder mantle projection to axis-aligned cylinders#633

Open
SimonHeybrock wants to merge 1 commit into
mainfrom
generalize-cylinder-projection
Open

[ESSREDUCE] Generalize cylinder mantle projection to axis-aligned cylinders#633
SimonHeybrock wants to merge 1 commit into
mainfrom
generalize-cylinder-projection

Conversation

@SimonHeybrock

@SimonHeybrock SimonHeybrock commented Jun 10, 2026

Copy link
Copy Markdown
Member

Motivation

scipp/esslivedata#970 needs to add projections for MAGIC, which has detectors like DREAM mantle but along a vertical cylinder.

Overview

Generalizes the cylinder-mantle projection in live.raw from a hard-coded z-axis cylinder to any axis-aligned cylinder, motivated by the need for a cylinder-Y projection (vertically-aligned mantle detectors). Only axis-aligned variants are supported, which is sufficient for current detectors.

project_onto_cylinder_z becomes project_onto_cylinder with an axis parameter ('x', 'y', or 'z'), using a right-handed cyclic relabeling of the in-plane axes so the math is shared. from_nexus accepts the new 'cylinder_mantle_y' projection alongside the existing 'cylinder_mantle_z'.

To avoid forcing a synchronized release with downstream (esslivedata calls make_cylinder_mantle_coords directly), that function keeps its name and signature, gaining only an axis keyword defaulting to 'z'. Existing direct calls are unchanged; cylinder-Y is opt-in via axis='y'. The from_nexus projection strings are likewise additive.

The pixel-noise path is untouched: it derives from physical pixel-tube geometry, independent of the projection axis.

Note: for 'cylinder_mantle_y' the resolution dict must key the axial dimension 'y' (rather than 'z'), since the output coordinate name follows the cylinder axis.

Test plan

  • New unit test for the cylinder-Y projection, mirroring the existing z test under axis relabeling.
  • Existing z test updated to the new signature.
  • Verified esslivedata's projectors_test.py still passes against this branch (direct make_cylinder_mantle_coords(coords) call preserved).

@github-actions github-actions Bot added the essreduce Issues for essreduce. label Jun 10, 2026
@github-actions github-actions Bot changed the title Generalize cylinder mantle projection to axis-aligned cylinders [ESSREDUCE] Generalize cylinder mantle projection to axis-aligned cylinders Jun 10, 2026
Replace `project_onto_cylinder_z` with `project_onto_cylinder`, parametrized
by the cylinder axis ('x', 'y', or 'z') via a right-handed cyclic relabeling
of the in-plane axes. `from_nexus` now accepts the 'cylinder_mantle_y'
projection alongside 'cylinder_mantle_z'.

`make_cylinder_mantle_coords` gains an `axis` keyword defaulting to 'z', so
existing direct calls keep their behavior. Downstream packages can adopt
cylinder-Y by passing `axis='y'` without a synchronized release.

The pixel-noise path is unaffected: it derives from physical pixel-tube
geometry, independent of the projection axis.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SimonHeybrock SimonHeybrock force-pushed the generalize-cylinder-projection branch from ab38701 to 75151cd Compare June 10, 2026 12:36
@SimonHeybrock SimonHeybrock marked this pull request as ready for review June 10, 2026 12:41
)


def test_project_onto_cylinder_y_is_z_result_under_axis_relabeling() -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add a test for x case, as it is an option above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

essreduce Issues for essreduce.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants