aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-08-13 15:22:37 +0200
committerThomas White <taw@physics.org>2014-08-13 15:23:20 +0200
commit6771d485ac6ed1bfa1cf813df8d3e45c571cdfad (patch)
tree320fd1c36687bddbdd682a7a4962ea92aa724f2f
parent2e2eeec338757beaf0bdd770f6f2a95caa6708b4 (diff)
Respect all bad pixels during peak detection
Not just no_index panels and bad regions
-rw-r--r--libcrystfel/src/peaks.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index 9fd36037..15f37a4e 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -244,10 +244,11 @@ static int integrate_peak(struct image *image, int cfs, int css,
double var;
double aduph;
int p_cfs, p_css, p_w, p_h;
+ signed int pn;
- p = find_panel(image->det, cfs, css);
- if ( p == NULL ) return 2;
- if ( p->no_index ) return 3;
+ pn = find_panel_number(image->det, cfs, css);
+ if ( pn == -1 ) return 2;
+ p = &image->det->panels[pn];
if ( saturated != NULL ) *saturated = 0;
@@ -280,9 +281,7 @@ static int integrate_peak(struct image *image, int cfs, int css,
|| (p_cfs+dfs < 0 ) || (p_css+dss < 0) ) return 4;
/* Wandered into a bad region? */
- if ( in_bad_region(image->det, p->min_fs+p_cfs+dfs,
- p->min_ss+p_css+dss) )
- {
+ if ( image->bad[pn][p_cfs+dfs + p->w*(p_css+dss)] ) {
return 14;
}