aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/peaks.c
diff options
context:
space:
mode:
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..477d9345 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 ( image->data[idx] > p->max_adu ) return 1;
+
pk_counts++;
pk_total += val;