Panel id on spots and the panel table in the start message

SpotToSave gains int16_t panel (-1 = no panel table). It sits in the padding
after the two bools, so sizeof(SpotToSave) stays 80. It is serialised only
where it is set: CBOR spot key "panel", HDF5 /entry/MX/peakPanel (data file,
plus a virtual dataset in a VDS master when the start message has panels),
read back by HDF5MetadataSource. For a flat detector none of these is written,
so files and streams for existing data are byte-for-byte unchanged.

The start message carries the panel table (detector_modules, CBOR key absent
when empty), filled from the experiment; JFJochHttpReader takes it, so a
stream viewer knows the panels too.

AssignModules takes the spot's panel id where it has one - the stored pixel box
it was found in - and falls back to the plane position otherwise (every spot
until per-panel spot finding sets the id).

Reflection deliberately gets no panel id (owner decision): it is needed only
between prediction and integration, and the struct feeds GPU layout and
memory budgets.

Tests: CBORSerialize_SpotPanelId, CBORSerialize_StartDetectorModules,
JFJochReader_PanelId (VDS/legacy/integrated, with and without panels).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-21 10:28:23 +02:00
1 parent c8fb472f4d
commit dc784c073d
15 files changed
+274 -4

No files matched your search

+7
View File
@@ -67,6 +67,7 @@ void HDF5DataFilePluginMX::OpenFile(HDF5File &data_file, const DataMessage &msg,
spot_k.reserve(max_spots * images_per_file);
spot_l.reserve(max_spots * images_per_file);
spot_dist_ewald.reserve(max_spots * images_per_file);
spot_panel.reserve(max_spots * images_per_file);
if (indexing) {
spot_indexed.reserve(max_spots * images_per_file);
@@ -120,6 +121,7 @@ void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number)
spot_l.resize(max_spots * (max_image_number + 1));
spot_lattice.resize(max_spots * (max_image_number + 1), -1);
spot_dist_ewald.resize(max_spots * (max_image_number + 1), NAN);
spot_panel.resize(max_spots * (max_image_number + 1), -1);
if (indexing) {
spot_indexed.resize(max_spots * (max_image_number + 1));
@@ -134,6 +136,9 @@ void HDF5DataFilePluginMX::Write(const DataMessage &msg, uint64_t image_number)
spot_x[max_spots * image_number + i] = msg.spots[i].x;
spot_y[max_spots * image_number + i] = msg.spots[i].y;
spot_int[max_spots * image_number + i] = msg.spots[i].intensity;
spot_panel[max_spots * image_number + i] = msg.spots[i].panel;
if (msg.spots[i].panel >= 0)
spot_panel_present = true;
if (indexing) {
spot_indexed[max_spots * image_number + i] = msg.spots[i].indexed;
spot_lattice[max_spots * image_number + i] = msg.spots[i].lattice;
@@ -213,6 +218,8 @@ void HDF5DataFilePluginMX::WriteFinal(HDF5File &data_file) {
data_file.SaveVector("/entry/MX/peakTotalIntensity", spot_int, {(hsize_t) (max_image_number + 1), max_spots});
data_file.SaveVector("/entry/MX/peakIceRingRes", spot_ice_ring, {(hsize_t) (max_image_number + 1), max_spots});
data_file.SaveVector("/entry/MX/nPeaks", npeaks.vec());
if (spot_panel_present)
data_file.SaveVector("/entry/MX/peakPanel", spot_panel, {(hsize_t) (max_image_number + 1), max_spots});
if (indexing) {
data_file.SaveVector("/entry/MX/peakH", spot_h, {(hsize_t) (max_image_number + 1), max_spots});