diff --git a/image_analysis/scale_merge/HKLKey.cpp b/image_analysis/scale_merge/HKLKey.cpp index 1cbb3852..76490f94 100644 --- a/image_analysis/scale_merge/HKLKey.cpp +++ b/image_analysis/scale_merge/HKLKey.cpp @@ -4,11 +4,12 @@ #include #include "HKLKey.h" +#include "gemmi/symmetry.hpp" -HKLKey CanonicalHKL(const Reflection &r, bool merge_friedel, const std::optional &sg) { +HKLKey CanonicalHKL(const Reflection &r, bool merge_friedel, const std::optional &in_sg) { HKLKey key{r.h, r.k, r.l, true}; - if (!sg.has_value()) { + if (!in_sg.has_value()) { if (!merge_friedel) { const HKLKey neg{-r.h, -r.k, -r.l, true}; if (std::tie(key.h, key.k, key.l) < std::tie(neg.h, neg.k, neg.l)) { @@ -19,8 +20,9 @@ HKLKey CanonicalHKL(const Reflection &r, bool merge_friedel, const std::optional } } } else { - const auto ops = sg->operations(); - const gemmi::ReciprocalAsu asu(sg.get()); + gemmi::SpaceGroup sg = in_sg.value(); + const auto ops = sg.operations(); + const gemmi::ReciprocalAsu asu(&sg); const gemmi::Op::Miller in{r.h, r.k, r.l}; const auto [hkl, sign_plus] = asu.to_asu_sign(in, ops);