Merge beam-always into rc181: post-refinement fits the lattice in the fixed space group's setting when -S re-seats the reflections

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQqN9qRD57vnShzTC37
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-10-28 13:33:52 +01:00
commit 07de0bcb72
1 file changed
+10 -1
+10 -1
View File
@@ -975,13 +975,22 @@ bool Rugnux::ScaleMergeAndSymmetry(PipelineLocals &p) {
}
}
if (result.consensus_cell.has_value()) {
const auto rot = indexer->FinalizeRotationIndexing();
auto rot = indexer->FinalizeRotationIndexing();
indexer->RethrowIndexerError();
if (rot && rot->axis) {
if (geometry_prepass)
prepass_result_ = *rot; // full result (lattice+geom+axis), for the supercell fallback
PostRefineSettings prs;
prs.crystal_system = rot->search_result.system;
// The reflections were re-seated into the fixed space group's setting above, so the
// lattice they are fitted against has to go across with them, in the class it is now
// held to. Left in the indexer's setting, every index was another reflection's: on a
// P-indexed lattice reseated into C2 the held-out residual started 5 orders of magnitude
// above the bare run's, the fit never settled and the header's centre error stayed.
if (end_msg.reindex_matrix) {
rot->lattice = rot->lattice.Multiply(stored_to_final);
prs.crystal_system = end_msg.rotation_lattice_type->crystal_system;
}
prs.num_threads = static_cast<int>(config_.nthreads);
prs.refine_geometry = true;
// Only a pass still at the file's distance can hold it as a hypothesis; a pass