From a82278dbdd8311c46676b0921c423934208ec81a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 11 Aug 2014 12:09:33 +0200 Subject: Take overlaps into account during integration --- libcrystfel/src/integration.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'libcrystfel/src/integration.c') 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; idet->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; ssh; ss++ ) { + for ( fs=0; fsw; fs++ ) { + if ( mask[fs+p->w*ss] > 1 ) { + image->bad[i][fs+p->w*ss] = 1; + } + } + } + + free(mask); + + } +} -- cgit v1.2.3