diff options
author | Thomas White <taw@physics.org> | 2012-10-20 19:40:02 -0700 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-10-20 19:40:02 -0700 |
commit | f62745115e6a66531bef56f8e1af4b575bdc457f (patch) | |
tree | 75bf8cd4468e3de0ac50a4f38b8773c5ab1797ec | |
parent | c36a8a09c3c163f795aa0762a68b491b49982513 (diff) |
integrate_peak(): Restore check for bad region
This fixes a regression introduced by ad2c84d0, predating the initial CrystFEL release.
-rw-r--r-- | libcrystfel/src/peaks.c | 10 |
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 */ |