46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JFJOCH_QUICKINTEGRATE_H
|
|
#define JFJOCH_QUICKINTEGRATE_H
|
|
|
|
#include <vector>
|
|
#include "../common/DiffractionExperiment.h"
|
|
#include "../common/CrystalLattice.h"
|
|
#include "../common/Reflection.h"
|
|
|
|
struct QuickIntegrateResult {
|
|
std::vector<Reflection> reflections;
|
|
std::optional<float> b_factor;
|
|
};
|
|
|
|
class QuickIntegrate {
|
|
const DiffractionExperiment &experiment;
|
|
int32_t max_value = 30;
|
|
const float ewald_sphere_angle_cutoff = 0.2;
|
|
|
|
float r_1 = 4;
|
|
float r_2 = 5;
|
|
float r_3 = 8;
|
|
|
|
float r_1_sq = r_1 * r_1;
|
|
float r_2_sq = r_2 * r_2;
|
|
float r_3_sq = r_3 * r_3;
|
|
|
|
template <class T>
|
|
QuickIntegrateResult IntegrateInternal(const CompressedImage &image, const CrystalLattice &latt,
|
|
int64_t special_value, int64_t saturation,
|
|
float high_res_A);
|
|
|
|
template <class T>
|
|
bool IntegrateInternal(Reflection &r, const T* image,
|
|
size_t xpixel, size_t ypixel,
|
|
int64_t special_value, int64_t saturation);
|
|
public:
|
|
QuickIntegrate(const DiffractionExperiment &experiment);
|
|
QuickIntegrateResult Integrate(const CompressedImage &image, const CrystalLattice &latt, float high_res_A);
|
|
};
|
|
|
|
|
|
#endif //JFJOCH_QUICKINTEGRATE_H
|