From c3bb5e1f5ffa30cb0bf9aaf1ce8810b985b72900 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Fri, 5 Jun 2026 15:57:22 +0200 Subject: [PATCH] RotationIndexer: Add refinement of extra lattices + limit number of extra lattices --- image_analysis/rotation_indexer/RotationIndexer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/image_analysis/rotation_indexer/RotationIndexer.cpp b/image_analysis/rotation_indexer/RotationIndexer.cpp index dddc0c24..f004959a 100644 --- a/image_analysis/rotation_indexer/RotationIndexer.cpp +++ b/image_analysis/rotation_indexer/RotationIndexer.cpp @@ -80,8 +80,10 @@ void RotationIndexer::RunIndexing() { if (indexer_result.lattice.size() > 1) { auto ml_latt = MultiLatticeSearch(indexer_result.lattice); for (auto &l : ml_latt) { + if (extra_lattices_.size() >= experiment.GetIndexingSettings().GetMaxExtraLattices()) + break; - // Ignore lattices oriented by less then 3.0 degree + // Ignore lattices oriented by less than 3.0 degree if (l.rotation_vector.Length() < 3.0 * M_PI / 180.0) continue; @@ -100,6 +102,12 @@ void RotationIndexer::RunIndexing() { .index_ice_rings = experiment.GetIndexingSettings().GetIndexIceRings(), .axis = axis_ }; + + // Quick refinement: orientation only. Cell size/angles, beam center, + // detector angles and rotation axis are all kept from the first lattice. + // XtalOptimizer always refines orientation; everything else is frozen above. + XtalOptimizer(data_multi, v_); + extra_lattices_.push_back(data_multi.latt); } }