From f9cc99f3c0313dcaf4e5946f88783bd5f1a229d9 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 5 Feb 2026 11:18:19 +0100 Subject: [PATCH] SpotToSave: Include phi angle of the spot --- common/DiffractionSpot.cpp | 6 ++++++ common/SpotToSave.h | 1 + 2 files changed, 7 insertions(+) diff --git a/common/DiffractionSpot.cpp b/common/DiffractionSpot.cpp index 0f71be57..dd8fe53d 100644 --- a/common/DiffractionSpot.cpp +++ b/common/DiffractionSpot.cpp @@ -68,9 +68,15 @@ void DiffractionSpot::ConvertToImageCoordinates(const DiffractionExperiment &exp SpotToSave DiffractionSpot::Export(const DiffractionGeometry &geometry, int64_t image_num) const { auto d = geometry.PxlToRes(x / (float) photons, y / (float) photons); + float phi = 0.0f; + if (geometry.GetRotation()) { + phi = geometry.GetRotation()->GetIncrement_deg() * image_num + geometry.GetRotation()->GetWedge_deg(); + } + return { .x = x / static_cast(photons), .y = y / static_cast(photons), + .phi = phi, .intensity = static_cast(photons), .maxc = max_photons, .d_A = d, diff --git a/common/SpotToSave.h b/common/SpotToSave.h index ccdef978..9efb978d 100644 --- a/common/SpotToSave.h +++ b/common/SpotToSave.h @@ -9,6 +9,7 @@ struct SpotToSave { float x = 0; float y = 0; + float phi = 0; float intensity = 0; int64_t maxc = 0; float d_A = 0.0;