aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-05-21 15:52:06 +0200
committerThomas White <taw@physics.org>2012-05-21 15:52:06 +0200
commit934e9aeee2232692f289ef0faef2280017617d80 (patch)
treeaf2afda4dc60a02396395a174f67de8a2f5eaeb9 /libcrystfel/src/peaks.c
parent4aa325f2d840d8a2d0eeaff3d0c72bab39b51b5e (diff)
ADU limit in peak integration
Diffstat (limited to 'libcrystfel/src/peaks.c')
-rw-r--r--libcrystfel/src/peaks.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index 78a68185..91a8c949 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -211,6 +211,9 @@ static int integrate_peak(struct image *image, int cfs, int css,
val = image->data[idx];
+ /* Veto peak if it contains saturation in bg region */
+ if ( val > p->max_adu ) return 1;
+
bg_tot += val;
bg_tot_sq += pow(val, 2.0);
bg_counts++;
@@ -259,6 +262,9 @@ static int integrate_peak(struct image *image, int cfs, int css,
val = image->data[idx] - bg_mean;
+ /* Veto peak if it contains saturation */
+ if ( val > p->max_adu ) return 1;
+
pk_counts++;
pk_total += val;