diff --git a/rugnux/RugnuxScaleMerge.cpp b/rugnux/RugnuxScaleMerge.cpp index 978469bb3..65cbc6f64 100644 --- a/rugnux/RugnuxScaleMerge.cpp +++ b/rugnux/RugnuxScaleMerge.cpp @@ -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(config_.nthreads); prs.refine_geometry = true; // Only a pass still at the file's distance can hold it as a hypothesis; a pass