IndexAndRefine: Fix using lattice at zero deg for refinement

This commit is contained in:
2026-01-20 13:28:42 +01:00
parent 3e721dc476
commit 7da28b5c9a
4 changed files with 9 additions and 17 deletions

View File

@@ -26,7 +26,11 @@ IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(Data
if (rotation_indexer) {
auto result = rotation_indexer->ProcessImage(msg.number, msg.spots);
if (result) {
outcome.lattice_candidate = result->lattice;
// get rotated lattice
auto gon = experiment.GetGoniometer();
if (gon)
outcome.lattice_candidate = result->lattice.Multiply(gon->GetTransformation(-msg.number));
outcome.experiment.BeamX_pxl(result->geom.GetBeamX_pxl())
.BeamY_pxl(result->geom.GetBeamY_pxl())
@@ -132,10 +136,6 @@ void IndexAndRefine::QuickPredictAndIntegrate(DataMessage &msg,
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));
// Use moving average for mosaicity and profile_radius (also add beam center later)
if (msg.mosaicity_deg)
msg.mosaicity_deg = rotation_parameters.Mosaicity(msg.mosaicity_deg.value());
@@ -201,8 +201,7 @@ void IndexAndRefine::ProcessImage(DataMessage &msg,
if (!outcome.lattice_candidate)
return;
if (!AnalyzeIndexing(msg, outcome.experiment, *outcome.lattice_candidate,
outcome.experiment.GetGoniometer(), rotation_indexer.get() != nullptr))
if (!AnalyzeIndexing(msg, outcome.experiment, *outcome.lattice_candidate))
return;
msg.lattice_type = outcome.symmetry;