IndexAndRefine: Use "standard predictor", just with rotated axis

This commit is contained in:
2026-01-19 13:06:23 +01:00
parent 1353748a2e
commit 69cd7b551d
2 changed files with 17 additions and 5 deletions
+17 -3
View File
@@ -10,18 +10,22 @@
#include "indexing/FFTIndexer.h"
#include "lattice_search/LatticeSearch.h"
IndexAndRefine::IndexAndRefine(const DiffractionExperiment &x, IndexerThreadPool *indexer)
: index_ice_rings(x.GetIndexingSettings().GetIndexIceRings()),
experiment(x),
geom_(x.GetDiffractionGeometry()),
indexer_(indexer) {
if (indexer && x.GetGoniometer() && x.GetIndexingSettings().GetRotationIndexing())
if (indexer && x.IsRotationIndexing())
rotation_indexer = std::make_unique<RotationIndexer>(x, *indexer);
}
#include <iostream>
void IndexAndRefine::SetLattice(const CrystalLattice &lattice) {
if (rotation_indexer)
if (rotation_indexer) {
rotation_indexer->SetLattice(lattice);
std::cout << "Set lattice for rotation indexing" << std::endl;
}
}
IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(DataMessage &msg) {
@@ -144,9 +148,19 @@ void IndexAndRefine::QuickPredictAndIntegrate(DataMessage &msg,
.ewald_dist_cutoff = ewald_dist_cutoff,
.max_hkl = 100,
.centering = outcome.symmetry.centering,
.image_number = static_cast<int>(msg.number)
};
auto nrefl = prediction.Calc(experiment, *outcome.lattice_candidate, settings_prediction);
CrystalLattice latt = outcome.lattice_candidate.value();
if (rotation_indexer) {
// Rotate lattice_candidate to the current image angle
auto gon = experiment.GetGoniometer();
if (gon)
latt = outcome.lattice_candidate->Multiply(gon->GetTransformation(-msg.number));
}
auto nrefl = prediction.Calc(experiment, latt, settings_prediction);
auto refl_ret = BraggIntegrate2D(outcome.experiment, image, prediction.GetReflections(), nrefl, msg.number);
constexpr size_t kMaxReflections = 10000;