aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-10-20 19:40:02 -0700
committerThomas White <taw@physics.org>2012-10-20 19:40:02 -0700
commitf62745115e6a66531bef56f8e1af4b575bdc457f (patch)
tree75bf8cd4468e3de0ac50a4f38b8773c5ab1797ec /libcrystfel/src
parentc36a8a09c3c163f795aa0762a68b491b49982513 (diff)
integrate_peak(): Restore check for bad region
This fixes a regression introduced by ad2c84d0, predating the initial CrystFEL release.
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/peaks.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index b0b48c2e..4ae4bb30 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -264,6 +264,11 @@ static int integrate_peak(struct image *image, int cfs, int css,
if ( (p_cfs+dfs >= p_w) || (p_css+dss >= p_h)
|| (p_cfs+dfs < 0 ) || (p_css+dss < 0) ) return 1;
+ /* Wandered into a bad region? */
+ if ( in_bad_region(image->det, p_cfs+dfs, p_css+dss) ) {
+ return 1;
+ }
+
/* Check if there is a peak in the background region */
if ( (bgPkMask != NULL)
&& bgPkMask[(p_cfs+dfs) + p_w*(p_css+dss)] ) continue;
@@ -318,6 +323,11 @@ static int integrate_peak(struct image *image, int cfs, int css,
if ( (p_cfs+dfs >= p_w) || (p_css+dss >= p_h)
|| (p_cfs+dfs < 0 ) || (p_css+dss < 0) ) return 1;
+ /* Wandered into a bad region? */
+ if ( in_bad_region(image->det, p_cfs+dfs, p_css+dss) ) {
+ return 1;
+ }
+
idx = dfs+cfs+image->width*(dss+css);
/* Veto this peak if we tried to integrate in a bad region */