From 45abde17a11af755f046edb6208f0c22b3e454ba Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 22 Oct 2026 12:45:32 +0200 Subject: [PATCH] stills geometry refinement: a distance given with --detector-distance is held in the joint fit The joint distance+cell fit freed the distance even where the user had given it. A user-given distance is a hard pin: the cell alone absorbs any error. The file's distance and DecideStillsGeometry's stay free as before. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu --- rugnux/RugnuxStills.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rugnux/RugnuxStills.cpp b/rugnux/RugnuxStills.cpp index 63a4d14a0..ac0e8e139 100644 --- a/rugnux/RugnuxStills.cpp +++ b/rugnux/RugnuxStills.cpp @@ -282,9 +282,9 @@ void Rugnux::RefineStillsGeometry(int start_image, int end_image, int images_to_ // short, with the cell absorbing it, mispredicted the spots past 2.5 A by enough to make the merged // intensities there negative. A deposited cell is often a percent off this crystal (another // temperature, or the cell the depositors started from), and a stated distance can be off as much, - // so the cell (-C) and the distance (the file's, --detector-distance or DecideStillsGeometry's) are - // both only where the fit starts. - gr_settings.refine_distance = true; + // so the cell (-C) and the file's distance (or DecideStillsGeometry's) are both only where the fit + // starts. A distance the user gave (--detector-distance) is held: the cell alone absorbs any error. + gr_settings.refine_distance = !config_.detector_distance_given; gr_settings.cell_reg_coeff = 0.0; const DiffractionGeometry nominal = experiment_.GetDiffractionGeometry();