aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-09-04 17:31:52 +0200
committerThomas White <taw@physics.org>2015-09-04 17:31:52 +0200
commit6aeb5402080162c0d0ada81404e1ef025e295099 (patch)
tree42c61120809f5a6d48085febf5f9af672fc47cb9
parent33a6c556eeca952744ada623e0e3cc1d049e93e2 (diff)
compare_hkl: Avoid double counting of reflections with anomalous FoMs
-rw-r--r--src/compare_hkl.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/compare_hkl.c b/src/compare_hkl.c
index abb84e43..3dd4662e 100644
--- a/src/compare_hkl.c
+++ b/src/compare_hkl.c
@@ -805,6 +805,19 @@ static void do_fom(RefList *list1, RefList *list2, UnitCell *cell,
return;
}
+ for ( refl1 = first_refl(list1, &iter);
+ refl1 != NULL;
+ refl1 = next_refl(refl1, iter) )
+ {
+ Reflection *refl2;
+ signed int h, k, l;
+ set_flag(refl1, 0);
+ get_indices(refl1, &h, &k, &l);
+ refl2 = find_refl(list2, h, k, l);
+ assert(refl2 != NULL);
+ set_flag(refl2, 0);
+ }
+
n_out = 0;
for ( refl1 = first_refl(list1, &iter);
refl1 != NULL;
@@ -853,6 +866,15 @@ static void do_fom(RefList *list1, RefList *list2, UnitCell *cell,
refl2_bij = find_refl(list2, hb, kb, lb);
}
+ /* Each reflection must only be counted once, whether
+ * we are visiting it now as "normal" or "bij" */
+ if ( get_flag(refl1) ) continue;
+ assert(!get_flag(refl2));
+ set_flag(refl1, 1);
+ set_flag(refl1_bij, 1);
+ set_flag(refl2, 1);
+ set_flag(refl2_bij, 1);
+
assert(refl1_bij != NULL);
assert(refl2_bij != NULL);