From 25e66b4d3de88de890c0289e5ef95cb82ec6a62a Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 28 Oct 2026 16:14:21 +0100 Subject: [PATCH] RotationScaleMerge: an empty merge says what happened instead of "resolution calculation failed" A lattice that does not describe the frames can merge nothing - no rocking event recorded whole enough to make a full - and the run then stopped on "RotationScaleMerge: resolution calculation failed". The message now says that nothing was merged and why that usually happens. The empty merges seen on Bruker swung runs were the negative-increment defect, fixed in the reader; this is only the message. EXTERNAL_TEST_DATA: the 6OR0 row says what is now true of the SMART 6000 distance - the header distance is ~4% short of what the data give, the refinement corrects it on a 2theta = 0 run and not yet on a swung one. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HVeDQqN9qRD57vnShzTC37 --- docs/EXTERNAL_TEST_DATA.md | 2 +- image_analysis/scale_merge/RotationScaleMerge.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/EXTERNAL_TEST_DATA.md b/docs/EXTERNAL_TEST_DATA.md index 61b3133b6..0f4033745 100644 --- a/docs/EXTERNAL_TEST_DATA.md +++ b/docs/EXTERNAL_TEST_DATA.md @@ -331,7 +331,7 @@ noted. | lalanine | four runs of the RODIN L-alanine deposition at 2θ = 20° | the 900-frame `pgw240050_01` run | | 9E2T | one continuous sweep plus screening images | the 2700-frame sweep | | 8OWM | three MXRDR zips covering one 1800-frame sweep, plus a processed-data zip | the three sweep zips (proc zip skipped) | -| 6OR0 | four 900 × 0.2° Bruker `.sfrm` runs of one twinned crystal at 10 cm: ω scans at 2θ = 0° (`01`) and 35° (`02`), φ scans on the fixed-χ (54.74°) platform at 2θ = 0° (`03`) and 35° (`04`) | the `01` run (2θ = 0°): read with the header's distance the cell of these SMART 6000 frames comes out ~4% short, which a 2θ = 0° run absorbs into the cell scale and a swung run does not | +| 6OR0 | four 900 × 0.2° Bruker `.sfrm` runs of one twinned crystal at 10 cm: ω scans at 2θ = 0° (`01`) and 35° (`02`), φ scans on the fixed-χ (54.74°) platform at 2θ = 0° (`03`) and 35° (`04`) | the `01` run (2θ = 0°): the header distance of these SMART 6000 frames is ~4% short of what the data give, which the distance refinement corrects on a 2θ = 0° run and not yet on a swung one | | 6OQZ | eleven `.sfrm` ω runs of 472-900 × 0.2° at 18 cm, 2θ = 10°, 25° and 45° (low, medium, high resolution) at different φ, plus two 5-frame runs at 2θ = 0° and the orientation-matrix runs `gdri_MATRIX_*` | the low-resolution `01` run (2θ = 10°), for the reason given for 6OR0; three crystals, the test set for multi-lattice integration | | laspartic | seven Bruker-converted full-imgCIF kappa runs, φ (`01`, 1200 × 0.3°) and ω (`02`-`07`, 292-394 frames) at 2θ = -26.7° | the 1200-frame `01` φ run | | onitroaniline | the same seven-run kappa layout (`01` 1200 × 0.3° φ, `02`-`07` ω), deposited twice: as Bruker `.sfrm` and as APEX's full-imgCIF conversion of the same frames | the `01` run, read from the `.sfrm` files | diff --git a/image_analysis/scale_merge/RotationScaleMerge.cpp b/image_analysis/scale_merge/RotationScaleMerge.cpp index c3071337e..42b4e2b73 100644 --- a/image_analysis/scale_merge/RotationScaleMerge.cpp +++ b/image_analysis/scale_merge/RotationScaleMerge.cpp @@ -6573,9 +6573,14 @@ RotationScaleMerge::Result RotationScaleMerge::MergeAndStats(int n_groups, bool if (effective_d_min && m.d < *effective_d_min) continue; sd_min = std::min(sd_min, m.d); sd_max = std::max(sd_max, m.d); } + // Nothing (or one resolution) merged: no rocking event of the lattice made a full reflection, which + // is what a lattice that does not describe the frames ends in. if (!(sd_min < sd_max && sd_min > 0.0f)) throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, - "RotationScaleMerge: resolution calculation failed"); + fmt::format("nothing to merge ({} merged reflections): no rocking event of " + "the lattice was recorded whole enough to make a full reflection, so " + "the lattice probably does not describe these frames", + result.merged.size())); // The completeness denominator is counted over the range the run DECLARES, not the range that // survived: the shell grid shares its bounds (so nothing is enumerated outside a shell) and runs // to the declared low-resolution limit, or over the whole sphere - 1/d^2 down to 0, spelled as an