ScaleOnTheFly: mosaicity input is float, for consistence with other code

This commit is contained in:
2026-05-17 09:14:32 +02:00
parent 6852908dff
commit 83ae1f0ced
3 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ class IndexAndRefine {
mutable std::mutex reflections_mutex;
std::vector<std::vector<Reflection>> reflections;
std::vector<double> mosaicity;
std::vector<float> mosaicity;
std::vector<uint8_t> merge_mask;
IndexingOutcome DetermineLatticeAndSymmetryRotation(DataMessage &msg);
+4 -3
View File
@@ -166,7 +166,8 @@ std::pair<double, size_t> ScaleOnTheFly::CalculateGlobalCC(const std::vector<Ref
return {cov / std::sqrt(var_x * var_y), n};
}
ScaleOnTheFlyResult ScaleOnTheFly::Scale(std::vector<Reflection> &reflections, std::optional<double> mosaicity_deg) {
ScaleOnTheFlyResult ScaleOnTheFly::Scale(std::vector<Reflection> &reflections,
std::optional<float> mosaicity_deg) {
auto start = std::chrono::steady_clock::now();
ceres::Problem problem;
@@ -296,7 +297,7 @@ ScaleOnTheFlyResult ScaleOnTheFly::Scale(std::vector<Reflection> &reflections, s
}
ScalingResult ScaleOnTheFly::Scale(std::vector<std::vector<Reflection> > &reflections,
const std::vector<double> &mosaicity,
const std::vector<float> &mosaicity,
size_t nthreads) {
ScalingResult result(reflections.size());
@@ -305,7 +306,7 @@ ScalingResult ScaleOnTheFly::Scale(std::vector<std::vector<Reflection> > &reflec
if (nthreads <= 1) {
for (int i = 0; i < reflections.size(); i++) {
std::optional<double> mos_val;
std::optional<float> mos_val;
if (model == PartialityModel::Rotation
&& mosaicity.size() > i
&& std::isfinite(mosaicity[i])
+2 -2
View File
@@ -37,10 +37,10 @@ class ScaleOnTheFly {
[[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<double> mosaicity_deg);
ScaleOnTheFlyResult Scale(std::vector<Reflection> &r, std::optional<float> mosaicity_deg);
ScalingResult Scale(std::vector<std::vector<Reflection> > &reflections,
const std::vector<double> &mosaicity,
const std::vector<float> &mosaicity,
size_t nthreads = 0);
};