RotationIndexer: Remove SetLattice() - not sure why it was necessary in the first place

This commit is contained in:
2026-01-19 13:56:28 +01:00
parent e02e85cedb
commit 8f452f8c56
4 changed files with 7 additions and 16 deletions

View File

@@ -19,14 +19,6 @@ IndexAndRefine::IndexAndRefine(const DiffractionExperiment &x, IndexerThreadPool
if (indexer && x.IsRotationIndexing())
rotation_indexer = std::make_unique<RotationIndexer>(x, *indexer);
}
#include <iostream>
void IndexAndRefine::SetLattice(const CrystalLattice &lattice) {
if (rotation_indexer) {
rotation_indexer->SetLattice(lattice);
std::cout << "Set lattice for rotation indexing" << std::endl;
}
}
IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(DataMessage &msg) {
IndexingOutcome outcome(experiment);

View File

@@ -49,7 +49,6 @@ class IndexAndRefine {
const IndexingOutcome &outcome);
public:
IndexAndRefine(const DiffractionExperiment &x, IndexerThreadPool *indexer);
void SetLattice(const CrystalLattice &lattice);
void ProcessImage(DataMessage &msg, const SpotFindingSettings &settings, const CompressedImage &image, BraggPrediction &prediction);
std::optional<RotationIndexerResult> Finalize();
};

View File

@@ -35,11 +35,6 @@ RotationIndexer::RotationIndexer(const DiffractionExperiment &x, IndexerThreadPo
}
}
void RotationIndexer::SetLattice(const CrystalLattice &lattice) {
std::unique_lock ul(m);
indexed_lattice = lattice;
}
void RotationIndexer::TryIndex() {
indexing_tried = true;
@@ -130,7 +125,13 @@ std::optional<RotationIndexerResult> RotationIndexer::ProcessImage(int64_t image
if (accumulated_images >= min_images_for_indexing && image >= first_image_to_try_indexing)
TryIndex();
}
if (!indexed_lattice)
return {};
return RotationIndexerResult{
.lattice = indexed_lattice.value(),
.search_result = search_result_,
.geom = updated_geom_
};
return GetLattice();
}

View File

@@ -54,7 +54,6 @@ class RotationIndexer {
void TryIndex();
public:
RotationIndexer(const DiffractionExperiment& x, IndexerThreadPool& indexer);
void SetLattice(const CrystalLattice &lattice);
std::optional<RotationIndexerResult> ProcessImage(int64_t image, const std::vector<SpotToSave>& spots);
std::optional<RotationIndexerResult> GetLattice();
};