From 643bda3dd3ded8703cf24da07c57633cf8b6badc Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 15 Jul 2026 19:13:41 +0200 Subject: [PATCH] stills: widen per-frame cell-refine angle bound to [30,150] deg The stills per-frame XtalOptimizer in IndexAndRefine used the struct-default monoclinic angle bound [60,120] deg, which clamps a beta outside that window (e.g. NmHR / 7O8F, C2 beta=131.78) to the boundary and corrupts the per-frame cell. Both indexers already use [30,150] (FFBIDXIndexer, FFT settings); this aligns the per-frame refine with them. Rotation path is unaffected (refine_unit_cell is false there). Verified on NmHR serial stills: FFBIDX with the correct C2 cell went from 0.01% to 9.10% indexed, recovering the true mC cell (beta~131.7) instead of a clamped beta=120; 60k-image merge reaches 2.61 A at 99.8% completeness. Co-Authored-By: Claude Opus 4.8 (1M context) --- image_analysis/IndexAndRefine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/image_analysis/IndexAndRefine.cpp b/image_analysis/IndexAndRefine.cpp index ac051faf..ac7a9e67 100644 --- a/image_analysis/IndexAndRefine.cpp +++ b/image_analysis/IndexAndRefine.cpp @@ -205,6 +205,11 @@ void IndexAndRefine::RefineGeometryIfNeeded(DataMessage &msg, IndexAndRefine::In .latt = *outcome.lattice_candidate, .crystal_system = outcome.symmetry.crystal_system, .min_spots = experiment.GetIndexingSettings().GetViableCellMinSpots(), + // Match the [30,150] deg bound the indexers already use (FFBIDXIndexer, FFT settings): + // the struct default [60,120] clamps a monoclinic beta outside that window (e.g. NmHR + // beta=131.8) to the boundary, corrupting the per-frame cell refinement. + .min_angle_deg = 30.0f, + .max_angle_deg = 150.0f, .refine_beam_center = true, .refine_distance_mm = false, .refine_detector_angles = false,