aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-11-06 14:46:49 +0100
committerThomas White <taw@physics.org>2018-11-06 14:46:49 +0100
commit0632f90091e2dbee2c0e3837130e859e5b5ce708 (patch)
treec85118b59af16433b25663666083b014141540b5
parentfc916fa289b857a869190d4cfb2826555b39854b (diff)
Exclude flagged crystals from deltaCChalf calculation
-rw-r--r--src/rejection.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rejection.c b/src/rejection.c
index 397aa97a..ebca6957 100644
--- a/src/rejection.c
+++ b/src/rejection.c
@@ -218,9 +218,11 @@ static double calculate_cchalf(RefList *template, RefList *full,
res = resolution(crystal_get_cell(c->contrib_crystals[0]),
h, k, l);
- /* Remove contribution(s) from the excluded crystal */
- if ( exclude != NULL ) {
- refl = find_refl(crystal_get_reflections(exclude), h, k, l);
+ /* Remove contribution(s) from the excluded crystal.
+ * If the crystal is marked as bad, we should not remove it
+ * because it did not contribute in the first place. */
+ if ( exclude != NULL && !crystal_get_user_flag(exclude) ) {
+ exrefl = find_refl(crystal_get_reflections(exclude), h, k, l);
} else {
exrefl = NULL;
}