aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-08-20 18:07:00 +0200
committerThomas White <taw@physics.org>2013-08-20 18:07:55 +0200
commite4c995d82cd5348dbdb9dbb9f732b2c357df6b6f (patch)
tree0c3898d27dbbda7c7130ca454b655d4b7cafe00c /libcrystfel
parent0c399b8bc976d86721a3a29a9d789cab84e56952 (diff)
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.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/peaks.c20
1 files changed, 10 insertions, 10 deletions
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 */