aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/integration.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/integration.c')
-rw-r--r--libcrystfel/src/integration.c7
1 files changed, 6 insertions, 1 deletions
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;
}