Fix anomalous completeness approaching 200%
In anomalous mode (Friedel mates kept separate) unique_reflections counts I+ and I- of each acentric reflection as two unique members, but the possible-reflection count used the merged ASU, so completeness approached 200%. Count each acentric possible reflection twice (centric once) when not merging Friedel mates, matching how unique_reflections is counted; verified overall completeness 99.7% on the HEWL rotation set. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -478,7 +478,8 @@ void CalcPossibleReflections(int space_group_number ,
|
||||
double d_min,
|
||||
double d_max,
|
||||
const ResolutionShells &shells,
|
||||
std::vector<ShellAccum> &acc) {
|
||||
std::vector<ShellAccum> &acc,
|
||||
bool merge_friedel) {
|
||||
gemmi::UnitCell gemmi_cell = cell;
|
||||
const gemmi::SpaceGroup *sg = gemmi::find_spacegroup_by_number(space_group_number);
|
||||
if (sg == nullptr)
|
||||
@@ -487,6 +488,7 @@ void CalcPossibleReflections(int space_group_number ,
|
||||
|
||||
// Generate unique reflections
|
||||
std::vector<gemmi::Miller> possible_hkls = gemmi::make_miller_vector(gemmi_cell, sg, d_min, d_max, true);
|
||||
const gemmi::GroupOps gops = sg->operations();
|
||||
CrystalLattice lattice(cell);
|
||||
const auto astar = lattice.Astar();
|
||||
const auto bstar = lattice.Bstar();
|
||||
@@ -503,7 +505,10 @@ void CalcPossibleReflections(int space_group_number ,
|
||||
continue;
|
||||
const int s = *shell;
|
||||
if (s >= 0 && s < acc.size())
|
||||
acc[s].possible++;
|
||||
// Anomalous (no Friedel merge): an acentric reflection has two unique members (I+ and I-),
|
||||
// a centric one only one — match how unique_reflections is counted, so completeness stays
|
||||
// <=100% instead of approaching 200%.
|
||||
acc[s].possible += (merge_friedel || gops.is_reflection_centric(hkl)) ? 1 : 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -556,7 +561,7 @@ MergeStatistics MergeOnTheFly::MergeStats(const std::vector<MergedReflection> &m
|
||||
|
||||
if (reference_cell.has_value())
|
||||
CalcPossibleReflections(space_group_number, reference_cell.value(),
|
||||
d_min_pad, d_max_pad, shells, acc);
|
||||
d_min_pad, d_max_pad, shells, acc, scaling_settings.GetMergeFriedel());
|
||||
|
||||
CorrelationCoefficient cc_half_overall;
|
||||
CorrelationCoefficient cc_ref_overall;
|
||||
|
||||
Reference in New Issue
Block a user