diff options
author | Thomas White <taw@physics.org> | 2014-08-11 12:09:33 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-08-11 12:09:33 +0200 |
commit | a82278dbdd8311c46676b0921c423934208ec81a (patch) | |
tree | 4e70476e4f2e6d1b9609dc37e286f8cc6569faf1 /libcrystfel/src | |
parent | 55f6dd31901f05477d4c84437e4479d06059a56b (diff) |
Take overlaps into account during integration
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/integration.c | 35 | ||||
-rw-r--r-- | libcrystfel/src/integration.h | 2 | ||||
-rw-r--r-- | libcrystfel/src/peaks.c | 2 |
3 files changed, 38 insertions, 1 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); + + } +} diff --git a/libcrystfel/src/integration.h b/libcrystfel/src/integration.h index 9e1c8ee1..6e80405c 100644 --- a/libcrystfel/src/integration.h +++ b/libcrystfel/src/integration.h @@ -112,6 +112,8 @@ extern void integrate_all_4(struct image *image, IntegrationMethod meth, signed int idh, signed int idk, signed int idl, int results_pipe); +extern void flag_overlaps(struct image *image, double ir_inn); + #ifdef __cplusplus } diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index a38e4d4d..ca5a6951 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -191,7 +191,7 @@ static void add_crystal_to_mask(struct image *image, struct panel *p, if ( fs < 0 ) continue; if ( ss < 0 ) continue; - mask[fs + ss*w] = 1; + mask[fs + ss*w]++; } } |