aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/integration.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-08-11 12:09:33 +0200
committerThomas White <taw@physics.org>2014-08-11 12:09:33 +0200
commita82278dbdd8311c46676b0921c423934208ec81a (patch)
tree4e70476e4f2e6d1b9609dc37e286f8cc6569faf1 /libcrystfel/src/integration.c
parent55f6dd31901f05477d4c84437e4479d06059a56b (diff)
Take overlaps into account during integration
Diffstat (limited to 'libcrystfel/src/integration.c')
-rw-r--r--libcrystfel/src/integration.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index f42da36f..5e5ddd98 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1946,3 +1946,38 @@ IntegrationMethod integration_method(const char *str, int *err)
return meth;
}
+
+
+/**
+ * flag_overlaps:
+ * @image: An image structure
+ * @ir_inn: The radius of the peak region to use
+ *
+ * Flags, in the bad pixel mask for @image, every pixel for which more than one
+ * reflection is predicted to have its peak region.
+ *
+ */
+void flag_overlaps(struct image *image, double ir_inn)
+{
+ int i;
+
+ for ( i=0; i<image->det->n_panels; i++ ) {
+
+ int *mask;
+ int fs, ss;
+ struct panel *p = &image->det->panels[i];
+
+ mask = make_BgMask(image, p, ir_inn);
+
+ for ( ss=0; ss<p->h; ss++ ) {
+ for ( fs=0; fs<p->w; fs++ ) {
+ if ( mask[fs+p->w*ss] > 1 ) {
+ image->bad[i][fs+p->w*ss] = 1;
+ }
+ }
+ }
+
+ free(mask);
+
+ }
+}