From 6445bd6887ac815d07f38692a98d0b1dd166fed6 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 6 Jan 2021 15:03:26 +0100 Subject: partialator: Reject crystals with obviously too large profile radii The criterion for "too large" is 20% of the 1/d value for the lowest reflection which is not systematically absent according to the centering. A profile radius larger than the 1/d value for a reflection will crash the xsphere partiality model, and some visualisation shows that this is a clearly non-physical situation. The profile radius shouldn't be anywhere near the inter-Bragg spacing for reasonable data. However, feedback shows that this is happening quite often in real data, probably due to bad indexing. --- src/partialator.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/partialator.c b/src/partialator.c index 31ebb8c9..8422c05a 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -3,7 +3,7 @@ * * Scaling and post refinement for coherent nanocrystallography * - * Copyright © 2012-2020 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2021 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: @@ -1430,12 +1430,23 @@ int main(int argc, char *argv[]) Crystal **crystals_new; RefList *cr_refl; struct image *image_for_crystal; + double lowest_r; n_crystals_seen++; if ( n_crystals_seen <= start_after ) continue; if ( crystal_get_resolution_limit(image->crystals[i]) < min_res ) continue; + lowest_r = lowest_reflection(crystal_get_cell(image->crystals[i])); + if ( crystal_get_profile_radius(image->crystals[i]) > 0.2*lowest_r ) { + ERROR("Rejecting %s %s crystal %i because " + "profile radius is obviously too big (%e %e).\n", + image->filename, image->ev, i, + crystal_get_profile_radius(image->crystals[i]), + lowest_r); + continue; + } + crystals_new = realloc(crystals, (n_crystals+1)*sizeof(Crystal *)); if ( crystals_new == NULL ) { -- cgit v1.2.3