IndexAndRefine: Indexing time is now recorded in the main loop
This commit is contained in:
@@ -50,6 +50,8 @@ IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetryRotat
|
||||
}
|
||||
|
||||
IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(DataMessage &msg) {
|
||||
auto indexing_start_time = std::chrono::steady_clock::now();
|
||||
|
||||
IndexingOutcome outcome(experiment);
|
||||
|
||||
// Convert input spots to reciprocal space
|
||||
@@ -61,39 +63,39 @@ IndexAndRefine::IndexingOutcome IndexAndRefine::DetermineLatticeAndSymmetry(Data
|
||||
}
|
||||
|
||||
auto indexer_result = indexer_->Run(experiment, recip);
|
||||
msg.indexing_time_s = indexer_result.indexing_time_s;
|
||||
|
||||
if (indexer_result.executed)
|
||||
msg.indexing_result = false;
|
||||
|
||||
if (indexer_result.lattice.empty())
|
||||
return outcome;
|
||||
if (!indexer_result.lattice.empty()) {
|
||||
auto latt = indexer_result.lattice[0];
|
||||
if (latt.CalcVolume() > 1.0) {
|
||||
auto sg = experiment.GetGemmiSpaceGroup();
|
||||
|
||||
auto latt = indexer_result.lattice[0];
|
||||
if (latt.CalcVolume() < 1.0)
|
||||
return outcome;
|
||||
|
||||
auto sg = experiment.GetGemmiSpaceGroup();
|
||||
|
||||
// If space group and cell provided => always enforce symmetry in refinement
|
||||
// If space group not provided => guess symmetry
|
||||
if (sg && experiment.GetUnitCell()) {
|
||||
outcome.symmetry = LatticeMessage{
|
||||
.centering = sg->centring_type(),
|
||||
.niggli_class = 0,
|
||||
.crystal_system = sg->crystal_system()
|
||||
};
|
||||
outcome.lattice_candidate = latt;
|
||||
} else {
|
||||
auto sym_result = LatticeSearch(latt);
|
||||
outcome.symmetry = LatticeMessage{
|
||||
.centering = sym_result.centering,
|
||||
.niggli_class = sym_result.niggli_class,
|
||||
.crystal_system = sym_result.system
|
||||
};
|
||||
outcome.lattice_candidate = sym_result.conventional;
|
||||
// If space group and cell provided => always enforce symmetry in refinement
|
||||
// If space group not provided => guess symmetry
|
||||
if (sg && experiment.GetUnitCell()) {
|
||||
outcome.symmetry = LatticeMessage{
|
||||
.centering = sg->centring_type(),
|
||||
.niggli_class = 0,
|
||||
.crystal_system = sg->crystal_system()
|
||||
};
|
||||
outcome.lattice_candidate = latt;
|
||||
} else {
|
||||
auto sym_result = LatticeSearch(latt);
|
||||
outcome.symmetry = LatticeMessage{
|
||||
.centering = sym_result.centering,
|
||||
.niggli_class = sym_result.niggli_class,
|
||||
.crystal_system = sym_result.system
|
||||
};
|
||||
outcome.lattice_candidate = sym_result.conventional;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto indexing_end_time = std::chrono::steady_clock::now();
|
||||
msg.indexing_time_s = std::chrono::duration<float>(indexing_end_time - indexing_start_time).count();
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@@ -242,6 +244,7 @@ void IndexAndRefine::ProcessImage(DataMessage &msg,
|
||||
return;
|
||||
|
||||
IndexingOutcome outcome(experiment);
|
||||
|
||||
if (rotation_indexer)
|
||||
outcome = DetermineLatticeAndSymmetryRotation(msg);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user