Add MAGIC instrument: detector views and cylinder-Y projection#970
Draft
SimonHeybrock wants to merge 6 commits into
Draft
Add MAGIC instrument: detector views and cylinder-Y projection#970SimonHeybrock wants to merge 6 commits into
SimonHeybrock wants to merge 6 commits into
Conversation
Register a new `magic` instrument with its two detector banks and the two geometry-free logical detector views (wire and strip), mirroring DREAM. The views fold the raw per-voxel data into the logical structure and reduce over the strip / remaining dimensions respectively; no physical geometry is needed, so detector_number arrays are supplied directly and no NeXus geometry file is required. The logical voxel layout (dimension names and nesting order) is provisional: only the per-bank voxel counts are confirmed (491520 and 131072). The fold order can be adjusted once the hardware numbering convention is known. Monitors and the cylinder-Y projection are deferred; the latter requires an upstream essreduce addition (the existing cylinder projection is hardcoded to the z axis). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Register the cylinder-mantle projection for the two MAGIC banks, which are
vertical (Y-axis) cylinders resembling the DREAM mantle rotated onto Y.
Pixel positions come from a geometry file. The MAGIC NeXus files carry only a
per-voxel NXoff_geometry pixel_shape and no [xyz]_pixel_offset, which the
essreduce position calculation requires. Rather than teach the runtime to read
OFF geometry, make-geometry-nexus gains an --off-active-face option that derives
[xyz]_pixel_offset from the voxel vertex centroids (only one radial face is the
active surface, so a single face is used) and drops the bulky mesh. The result
loads through the standard geometry path with no instrument-specific workaround.
The cylinder-mantle projector now accepts the axis ('y' or 'z'), so this depends
on the essreduce generalize-cylinder-projection change.
Event routing needs a temporary fix: the current event producer numbers
event_id in a global active-channel space that does not line up with
detector_number (bank B is offset by 245760, and bank A's active channels are
half its voxels). A per-detector event_id offset, applied before pixel grouping,
brings the ids into range; it is marked for removal once the producer is fixed.
The geometry file still has to be generated, uploaded to the geometry release,
and added to the registry; until then the projection roundtrip test is skipped.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Upload the derived MAGIC geometry artifact to the geometry release and add it to the registry, so the cylinder-Y projection resolves its pixel positions. The projection roundtrip test no longer needs to be skipped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The per-bank event_id offset only matched the buggy event_id numbering in the CODA reference file. It broke the fake detector source, whose event_id is drawn from the detector_number range (so the +245760 offset pushed bank B out of range and dropped all its events), and it would likewise break real data once the producer is fixed. Assume event_id lies within the detector_number range, as the fake and corrected real data do. The reference file's mismatched event_id is a producer bug to be fixed upstream, not worked around here. Remove the now-unused event_id offset plumbing from GroupByPixel and the instrument configuration. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The coda_magic geometry file describes detector_a as 245760 voxels, a segment of a vertical cylinder: 32 depth wires, 128 vertical strips, 60 azimuthal segments, with detector_number running C-order (segment fastest, wire slowest). The logical view configured a counter:2 axis (product 491520, double the voxel count) and the reverse nesting order. Drop the counter axis and reorder the fold sizes to reproduce the geometry layout. The polarization bank (detector_b) has no geometry file and is left as a provisional placeholder. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bee6280 to
42ec338
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds dashboard support for the MAGIC instrument (#968): its two detector banks, the geometry-free wire and strip logical views, and the cylinder-Y mantle projection for each bank. The banks are vertical (Y-axis) cylinders resembling the DREAM mantle rotated onto Y.
Geometry
The MAGIC NeXus files carry only a per-voxel
NXoff_geometrypixel_shapeand no[xyz]_pixel_offset, which essreduce's position calculation requires. Rather than add a runtime path that reads OFF geometry,make-geometry-nexusgains an--off-active-faceoption that derives the pixel offsets from the voxel vertex centroids (only one radial face is the active surface, so a single face is used) and drops the bulky mesh. The derived geometry file is uploaded to the geometry release and registered, so the projection loads through the standard geometry path with no instrument-specific runtime code.Event routing
event_idis assumed to lie within thedetector_numberrange, as the fake detector source and corrected real data do. The reference file (coda_magic_999999_00006299.hdf) numbersevent_iddifferently; that is a producer-side bug to fix upstream and is intentionally not worked around here, so replaying that specific file leaves the polarization bank empty.Status / draft
Draft because the cylinder-mantle projector now takes an axis and depends on the essreduce
generalize-cylinder-projectionchange being released. The logical voxel layout (fold dimension names and order) is provisional pending the hardware numbering convention, and monitors are deferred since the reference file contains none.Test plan