From 35dcbd19715afdc3c60ee701f0d555cb0f1fe96d Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 6 Nov 2025 10:49:54 +0100 Subject: [PATCH] jfjoch_viewer: Don't show diffraction rings entirely outside of the detector --- viewer/JFJochViewerImage.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/viewer/JFJochViewerImage.cpp b/viewer/JFJochViewerImage.cpp index 65e3e690..06c6a66b 100644 --- a/viewer/JFJochViewerImage.cpp +++ b/viewer/JFJochViewerImage.cpp @@ -368,7 +368,17 @@ void JFJochViewerImage::DrawResolutionRings() { float phi_offset = 0; + float res1 = geom.PxlToRes(0,0); + float res2 = geom.PxlToRes(image->Dataset().experiment.GetXPixelsNum(),0); + float res3 = geom.PxlToRes(image->Dataset().experiment.GetXPixelsNum(),image->Dataset().experiment.GetYPixelsNum()); + float res4 = geom.PxlToRes(0,image->Dataset().experiment.GetYPixelsNum()); + + float min_res = std::min({res1, res2, res3, res4}); + for (const auto &d: res_ring) { + if (d < min_res) + continue; + auto [x1,y1] = geom.ResPhiToPxl(d, 0); auto [x2,y2] = geom.ResPhiToPxl(d, M_PI_2); auto [x3,y3] = geom.ResPhiToPxl(d, M_PI);