aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-07-30 18:43:14 -0700
committerThomas White <taw@bitwiz.org.uk>2012-07-30 18:43:14 -0700
commit31f6c26cd344c01e0c329fa812cf78a7ef9dc700 (patch)
tree53bee44adf30739f73385e2330ef462e9c5efe1d /libcrystfel
parent27f012b2e2181a8b4fa4f3044a8691739b74a869 (diff)
Immediately reject pixels above max_adu in the peak search
This leads to a big improvement in speed when (ab)using max_adu for gaps in the detector.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/peaks.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index 0a6a439c..16692a7f 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -434,6 +434,9 @@ static void search_peaks_in_panel(struct image *image, float threshold,
/* Overall threshold */
if ( data[fs+stride*ss] < threshold ) continue;
+ /* Immediate rejection of pixels above max_adu */
+ if ( data[fs+stride*ss] > p->max_adu ) continue;
+
/* Get gradients */
dx1 = data[fs+stride*ss] - data[(fs+1)+stride*ss];
dx2 = data[(fs-1)+stride*ss] - data[fs+stride*ss];