From f89cf0bdcd8ca1f3c7297dec025d6f9f381fcf6b Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 19 Nov 2026 11:51:33 +0100 Subject: [PATCH] Rugnux live stills: crystals picked by shape where the pre-pass kept the header distance Live stills frames already refine their own cell and beam centre per frame, as JFJochReceiverFPGA does (IndexAndRefine with GeomRefinementAlgorithm::BeamCenter, the cell within 5 % of the reference), so a wrong header distance still indexes: its error goes into each frame's cell scale. What broke was the merge: with the given cell it keeps the volume population nearest that cell (GivenCellPopulation), and at a 2.5 % short distance a stray population near the stated volume won over the frames refined ~7.5 % smaller - 315 of 352 frames left out, CC1/2 0.01. Where the pre-pass did not refine the geometry, the live merge now picks the crystals as without a given cell: the major form by shape (LeaveOutMinorCellForm), merged in the consensus cell. Where it refined, unchanged. Replays, 8000-frame windows: in-house lysozyme (header ~7 px and 2.5 % off) N=500 CC1/2 0.007 -> 0.697 (1.75 A), N=1000 0.013 -> 0.641 (1.81 A); R3 chip start N=500 0.801 -> 0.807; refined windows identical. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQrPqZ52Tp6rzzZGxf3 --- receiver/StillsGPUAnalysis.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/receiver/StillsGPUAnalysis.cpp b/receiver/StillsGPUAnalysis.cpp index 0e7df1b2e..cea3831a5 100644 --- a/receiver/StillsGPUAnalysis.cpp +++ b/receiver/StillsGPUAnalysis.cpp @@ -284,8 +284,11 @@ void StillsGPUAnalysis::PrePassThread() { if (merge_frames) { merge_experiment = setup.experiment; merge_experiment.ImportScalingSettings(RugnuxDefaultScalingSettings(false)); + // The frames refine their own cell (IndexAndRefine), and at a distance the pre-pass did not refine its + // error is in their scale: the given cell then cannot pick the crystals by size, and they are picked as + // without one - the major form by shape merge = std::make_unique(merge_experiment, experiment.GetImageNum(), - experiment.GetUnitCell(), + refined ? experiment.GetUnitCell() : std::nullopt, result ? result->run_width : std::nullopt, setup.experiment.IsDetectIceRings(), SpotFindingSettings().ice_ring_width_Q_recipA, logger);