From e4c995d82cd5348dbdb9dbb9f732b2c357df6b6f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 20 Aug 2013 18:07:00 +0200 Subject: Re-order peak tests The old version led to a curious situation where the number of saturated peaks could be much greater than the number of peaks, even without --no-use-saturated. --- libcrystfel/src/peaks.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libcrystfel/src/peaks.c') diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 369a543f..0f5d96a6 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -507,12 +507,10 @@ static void search_peaks_in_panel(struct image *image, float threshold, &f_fs, &f_ss, &intensity, &sigma, ir_inn, ir_mid, ir_out, NULL, &saturated); - if ( saturated ) { - image->num_saturated_peaks++; - if ( !use_saturated ) { - nrej_sat++; - continue; - } + if ( r ) { + /* Bad region - don't detect peak */ + nrej_fail++; + continue; } /* It is possible for the centroid to fall outside the image */ @@ -534,10 +532,12 @@ static void search_peaks_in_panel(struct image *image, float threshold, continue; } - if ( r ) { - /* Bad region - don't detect peak */ - nrej_fail++; - continue; + if ( saturated ) { + image->num_saturated_peaks++; + if ( !use_saturated ) { + nrej_sat++; + continue; + } } /* Add using "better" coordinates */ -- cgit v1.2.3