From 0632f90091e2dbee2c0e3837130e859e5b5ce708 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 6 Nov 2018 14:46:49 +0100 Subject: Exclude flagged crystals from deltaCChalf calculation --- src/rejection.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/rejection.c') 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; } -- cgit v1.2.3