From f094e70fd60899579a8452c1c08121f25e0be885 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 5 Dec 2015 13:35:56 -0800 Subject: Add option for per-pixel saturation values --- libcrystfel/src/integration.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libcrystfel/src/integration.c') diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index 730a14ae..b3bee120 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -804,6 +804,7 @@ static int check_box(struct intcontext *ic, struct peak_box *bx, int *sat) double hd, kd, ld; signed int h, k, l; struct rvec dv; + float lsat; fs = bx->cfs + p; ss = bx->css + q; @@ -844,9 +845,13 @@ static int check_box(struct intcontext *ic, struct peak_box *bx, int *sat) } } + /* Per-pixel saturation value */ + lsat = ic->image->sat[bx->pn][fs + bx->p->w*ss]; if ( (bx->bm[p+ic->w*q] != BM_IG) && (bx->bm[p+ic->w*q] != BM_BH) - && (boxi(ic, bx, p, q) > bx->p->max_adu) ) { + && ((boxi(ic, bx, p, q) > bx->p->max_adu) + || (boxi(ic, bx, p, q) > lsat)) ) + { if ( sat != NULL ) *sat = 1; } -- cgit v1.2.3