From 3f7b4b4686bc12cff5a69261de07cafb2554ba1d Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 6 Aug 2026 21:17:10 +0200 Subject: [PATCH] rugnux: say which lattice the first pass rejected "Two-pass rotation indexing found only a lattice that indexes 2/60 validation frames" tells a user that something went wrong and nothing about what. The commonest cause is a metric symmetry promoted one class too far: the constrained cell then misses every reflection by the small angle the constraint snapped away, and the run dies with no way to see that a centred supercell setting was chosen over the primitive one it should have kept. Print the centring, crystal system and cell that was rejected. Co-Authored-By: Claude Opus 5 (1M context) --- rugnux/Rugnux.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/rugnux/Rugnux.cpp b/rugnux/Rugnux.cpp index 00efab99..8ef1e368 100644 --- a/rugnux/Rugnux.cpp +++ b/rugnux/Rugnux.cpp @@ -835,12 +835,22 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b // frame in six, several times below the weakest crystal that still merges. It is checked AFTER // the long-axis rescue, so a metric that rescue recovers is never rejected on its pre-rescue // score. - if (best.score < static_cast(validation.size()) / 6) + if (best.score < static_cast(validation.size()) / 6) { + // Name the cell and Bravais class that was rejected. The commonest cause is a metric + // symmetry promoted one class too far - the constrained cell then misses every + // reflection by the small angle the constraint snapped away - and without the cell in + // the message there is nothing to see that from. + const auto &c = best.result->search_result.conventional.GetUnitCell(); throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, fmt::format("Two-pass rotation indexing found only a lattice that " "indexes {}/{} validation frames - too few for it to be " - "this crystal's lattice.{}", - best.score, static_cast(validation.size()), next_steps)); + "this crystal's lattice. It was {}-centred {}, " + "{:.2f} {:.2f} {:.2f} {:.2f} {:.2f} {:.2f}.{}", + best.score, static_cast(validation.size()), + best.result->search_result.centering, + gemmi::crystal_system_str(best.result->search_result.system), + c.a, c.b, c.c, c.alpha, c.beta, c.gamma, next_steps)); + } indexer->ForceRotationIndexerResult(*best.result); logger.Info("Two-pass rotation indexing found lattice (scheme '{}': {}/{} validation frames)", best.name, best.score, static_cast(validation.size()));