aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-29 15:29:33 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:22 +0100
commit0215205efb28d4ea24b93ce4005f4668a358cc32 (patch)
tree47b42b4c5b7b82a164a4513311ecd6948e8dfba7 /src/peaks.c
parentabb1edf5301c36a814e65b9851c0848e35f82173 (diff)
Improve bad pixel handling
Diffstat (limited to 'src/peaks.c')
-rw-r--r--src/peaks.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/peaks.c b/src/peaks.c
index e5ba5337..453f46e9 100644
--- a/src/peaks.c
+++ b/src/peaks.c
@@ -186,8 +186,16 @@ int integrate_peak(struct image *image, int cfs, int css,
/* Veto this peak if we tried to integrate in a bad region */
if ( image->flags != NULL ) {
+
flags = image->flags[idx];
- if ( !(flags & 0x01) ) return 1;
+
+ /* It must have all the "good" bits to be valid */
+ if ( !((flags & image->det->mask_good)
+ == image->det->mask_good) ) return 1;
+
+ /* If it has any of the "bad" bits, reject */
+ if ( flags & image->det->mask_bad ) return 1;
+
}
val = image->data[idx];