ScaleOnTheFly: DiffractionExperiment is first argument to constructor, as this is convention used elsewhere

This commit is contained in:
2026-05-17 09:12:05 +02:00
parent 7212f5a628
commit b0a64fb254
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -275,7 +275,7 @@ std::optional<RotationIndexerResult> IndexAndRefine::Finalize() {
}
IndexAndRefine &IndexAndRefine::ReferenceIntensities(std::vector<MergedReflection> &reference) {
scaling_engine = std::make_unique<ScaleOnTheFly>(reference, experiment);
scaling_engine = std::make_unique<ScaleOnTheFly>(experiment, reference);
return *this;
}
@@ -299,7 +299,7 @@ void IndexAndRefine::ScaleImage(DataMessage &msg) {
}
ScalingResult IndexAndRefine::ScaleAllImages(const std::vector<MergedReflection> &reference, size_t nthreads) {
ScaleOnTheFly scaling(reference, experiment);
ScaleOnTheFly scaling(experiment, reference);
auto result = scaling.Scale(reflections, mosaicity, nthreads);
merge_mask = CalcMergeMask(experiment, result);
return result;
+1 -1
View File
@@ -87,7 +87,7 @@ namespace {
};
}
ScaleOnTheFly::ScaleOnTheFly(const std::vector<MergedReflection> &ref, const DiffractionExperiment &x)
ScaleOnTheFly::ScaleOnTheFly(const DiffractionExperiment &x, const std::vector<MergedReflection> &ref)
: sg(x.GetGemmiSpaceGroup()),
model(x.GetPartialityModel()),
s(x.GetScalingSettings()),
+1 -1
View File
@@ -36,7 +36,7 @@ class ScaleOnTheFly {
bool Accept(const Reflection &r);
[[nodiscard]] std::pair<double, size_t> CalculateGlobalCC(const std::vector<Reflection> &reflections) const;
public:
ScaleOnTheFly(const std::vector<MergedReflection> &ref, const DiffractionExperiment &x);
ScaleOnTheFly(const DiffractionExperiment &x, const std::vector<MergedReflection> &ref);
ScaleOnTheFlyResult Scale(std::vector<Reflection> &r, std::optional<double> mosaicity_deg);
ScalingResult Scale(std::vector<std::vector<Reflection> > &reflections,
+2 -2
View File
@@ -250,11 +250,11 @@ auto mosaicity = dataset->mosaicity_deg;
if (reference_data.empty()) {
auto merged = MergeAll(experiment, reflections);
ScaleOnTheFly scaling(merged, experiment);
ScaleOnTheFly scaling(experiment, merged);
// TODO: Fix mosaicty
scale_result = scaling.Scale(reflections,{});
} else {
ScaleOnTheFly scaling(reference_data, experiment);
ScaleOnTheFly scaling(experiment, reference_data);
scale_result = scaling.Scale(reflections,{});
}