38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JFJOCH_INDEXER_H
|
|
#define JFJOCH_INDEXER_H
|
|
|
|
#include <optional>
|
|
|
|
#include "../../common/CrystalLattice.h"
|
|
|
|
#include "../../common/DiffractionExperiment.h"
|
|
#include "../../common/JFJochMessages.h"
|
|
#include "../../common/SpotToSave.h"
|
|
|
|
|
|
class Indexer {
|
|
protected:
|
|
constexpr const static uint32_t viable_cell_min_spots = 9;
|
|
constexpr const static float min_percentage_spots = 0.20f;
|
|
float indexing_tolerance = 0.1;
|
|
float indexing_tolerance_sq = indexing_tolerance * indexing_tolerance;
|
|
float dist_tolerance_vs_reference = 0.05;
|
|
|
|
float max_angle_from_ewald_deg = 0.2;
|
|
DiffractionGeometry geom;
|
|
std::optional<GoniometerAxis> axis;
|
|
std::optional<UnitCell> reference_unit_cell;
|
|
|
|
virtual void SetupUnitCell(const std::optional<UnitCell>& cell) = 0;
|
|
public:
|
|
virtual ~Indexer() = default;
|
|
void Setup(const DiffractionExperiment& experiment);
|
|
virtual std::vector<CrystalLattice> Run(const std::vector<Coord> &coord, size_t nspots) = 0;
|
|
std::optional<CrystalLattice> Run(DataMessage &message);
|
|
};
|
|
|
|
#endif //JFJOCH_INDEXER_H
|