RotationIndexer: For fixed space group, set explicitly lattice type and centering for refinement

This commit is contained in:
2026-05-29 12:01:58 +02:00
parent 56764a948b
commit b44b0a56fb
+14 -3
View File
@@ -73,9 +73,19 @@ void RotationIndexer::TryIndex() {
}
auto indexer_result = indexer_.Run(experiment, coords_sel);
if (!indexer_result.lattice.empty()) {
// Find lattice type
search_result_ = LatticeSearch(indexer_result.lattice[0]);
if (!indexer_result.lattice.empty() && indexer_result.lattice[0].CalcVolume() > 1.0) {
auto sg = experiment.GetGemmiSpaceGroup();
if (sg) {
search_result_ = LatticeSearchResult{
.niggli_class = 0, // Since Niggli class was not searched for, we don't know which one
.conventional = indexer_result.lattice[0], // If lattice provided, it is for now primitive == conventional
.system = sg->crystal_system(),
.centering = sg->centring_type(),
};
} else {
// Find lattice type based on cell
search_result_ = LatticeSearch(indexer_result.lattice[0]);
}
// Run refinement
DiffractionExperiment experiment_copy(experiment);
@@ -97,6 +107,7 @@ void RotationIndexer::TryIndex() {
if (data.crystal_system == gemmi::CrystalSystem::Monoclinic)
data.latt.ReorderMonoclinic();
if (XtalOptimizer(data, v_sel)) {
indexed_lattice = data.latt;
updated_geom_ = data.geom;