39fef1bcef
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 14m35s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 15m45s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 15m51s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 16m9s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 16m10s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 17m16s
Build Packages / build:rpm (rocky8) (push) Successful in 14m52s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 13m54s
Build Packages / Generate python client (push) Successful in 27s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 12m57s
Build Packages / Create release (push) Skipped
Build Packages / build:rpm (ubuntu2404) (push) Successful in 14m27s
Build Packages / XDS test (durin plugin) (push) Successful in 13m17s
Build Packages / Build documentation (push) Successful in 54s
Build Packages / build:rpm (rocky9) (push) Successful in 15m42s
Build Packages / DIALS test (push) Successful in 16m54s
Build Packages / XDS test (neggia plugin) (push) Successful in 5m44s
Build Packages / Unit tests (push) Successful in 59m15s
47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include "HKLKey.h"
|
|
#include "Merge.h"
|
|
#include "../../common/DiffractionExperiment.h"
|
|
#include "ScalingResult.h"
|
|
|
|
#include <map>
|
|
|
|
|
|
struct ScaleOnTheFlyResult {
|
|
double B = 0;
|
|
double G = 1.0;
|
|
double mos = 0.1;
|
|
double wedge = 0.1;
|
|
double cc = NAN;
|
|
size_t cc_n = 0;
|
|
float time_s = 0.0;
|
|
bool succesful = false;
|
|
};
|
|
|
|
class ScaleOnTheFly {
|
|
constexpr static size_t MIN_REFLECTIONS = 20;
|
|
|
|
const std::optional<gemmi::SpaceGroup> sg;
|
|
const PartialityModel model;
|
|
const ScalingSettings s;
|
|
const std::optional<double> rot_wedge_deg;
|
|
const bool refine_rot_wedge;
|
|
const HKLKeyGenerator hkl_key_generator;
|
|
std::map<HKLKey, double> reference_data;
|
|
|
|
bool Accept(const Reflection &r);
|
|
[[nodiscard]] std::pair<double, size_t> CalculateGlobalCC(const std::vector<Reflection> &reflections) const;
|
|
public:
|
|
ScaleOnTheFly(const DiffractionExperiment &x, const std::vector<MergedReflection> &ref);
|
|
ScaleOnTheFlyResult Scale(std::vector<Reflection> &r, std::optional<float> mosaicity_deg);
|
|
|
|
ScalingResult Scale(std::vector<std::vector<Reflection> > &reflections,
|
|
const std::vector<float> &mosaicity,
|
|
size_t nthreads = 0);
|
|
};
|
|
|