25 lines
1.0 KiB
C++
25 lines
1.0 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#include "Indexer.h"
|
|
|
|
void Indexer::Setup(const DiffractionExperiment& experiment) {
|
|
geom = experiment.GetDiffractionGeometry();
|
|
indexing_tolerance = experiment.GetIndexingSettings().GetTolerance();
|
|
dist_tolerance_vs_reference = experiment.GetIndexingSettings().GetUnitCellDistTolerance();
|
|
viable_cell_min_spots = experiment.GetIndexingSettings().GetViableCellMinSpots();
|
|
index_ice_rings = experiment.GetIndexingSettings().GetIndexIceRings();
|
|
SetupUnitCell(experiment.GetUnitCell());
|
|
}
|
|
|
|
IndexerResult Indexer::Run(const std::vector<Coord> &coord) {
|
|
IndexerResult ret;
|
|
auto start = std::chrono::high_resolution_clock::now();
|
|
ret.lattice = RunInternal(coord, coord.size());
|
|
|
|
auto end = std::chrono::high_resolution_clock::now();
|
|
std::chrono::duration<float> duration = end - start;
|
|
ret.indexing_time_s = duration.count();
|
|
return ret;
|
|
}
|