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 dac1a96e..583dff4c 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -210,6 +210,9 @@ 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++;
@@ -258,6 +261,9 @@ 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;