diff --git a/common/DiffractionExperiment.cpp b/common/DiffractionExperiment.cpp index 3ade2d095..639d3399d 100644 --- a/common/DiffractionExperiment.cpp +++ b/common/DiffractionExperiment.cpp @@ -1843,9 +1843,11 @@ DiffractionExperiment &DiffractionExperiment::GeomRefinementAlgorithm(GeomRefine } gemmi::CrystalSystem DiffractionExperiment::GetCrystalSystem() const { + // Without a space group nothing is known of the cell's symmetry: triclinic leaves every angle of + // the given cell free, where any other system would hold some of them at 90 degrees. auto sg = GetGemmiSpaceGroup(); if (!sg) - return gemmi::CrystalSystem::Monoclinic; + return gemmi::CrystalSystem::Triclinic; return sg->crystal_system(); } diff --git a/image_analysis/IndexAndRefine.cpp b/image_analysis/IndexAndRefine.cpp index b814fbcf0..c741d0c32 100644 --- a/image_analysis/IndexAndRefine.cpp +++ b/image_analysis/IndexAndRefine.cpp @@ -380,6 +380,19 @@ IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(Data else if (!de_novo) outcome.lattice_candidate = latt; // else: de-novo + symmetry mismatch -> leave unset, frame is not indexed + } else if (!de_novo && experiment.GetUnitCell() + && latt.GetUnitCell().is_close(*experiment.GetUnitCell(), + experiment.GetIndexingSettings().GetUnitCellDistTolerance(), + experiment.GetIndexingSettings().GetUnitCellAngleTolerance_deg())) { + // A cell with no space group: FFBIDX returned the lattice on the given cell's axes, and + // it stays on them, so that every frame is in one setting. Nothing is known of the + // symmetry, so it is refined with every angle free. + outcome.symmetry = LatticeMessage{ + .centering = 'P', + .niggli_class = 0, + .crystal_system = gemmi::CrystalSystem::Triclinic + }; + outcome.lattice_candidate = latt; } else { auto sym_result = LatticeSearch(latt); outcome.symmetry = LatticeMessage{ diff --git a/tests/DiffractionExperimentTest.cpp b/tests/DiffractionExperimentTest.cpp index 930bc9ad1..e5db38e08 100644 --- a/tests/DiffractionExperimentTest.cpp +++ b/tests/DiffractionExperimentTest.cpp @@ -354,7 +354,7 @@ TEST_CASE("DiffractionExperiment_ZMQPreview", "[DiffractionExperiment]") { TEST_CASE("DiffractionExperiment_SpaceGroup", "[DiffractionExperiment]") { DiffractionExperiment x; REQUIRE(!x.GetGemmiSpaceGroup()); - REQUIRE(x.GetCrystalSystem() == gemmi::CrystalSystem::Monoclinic); + REQUIRE(x.GetCrystalSystem() == gemmi::CrystalSystem::Triclinic); REQUIRE_THROWS(x.SpaceGroupNumber(-1)); REQUIRE_THROWS(x.SpaceGroupNumber(500)); REQUIRE_NOTHROW(x.SpaceGroupNumber(96));