// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute // 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) { 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 duration = end - start; ret.indexing_time_s = duration.count(); return ret; }