From d4873dff09b3cf314fce0019d76e3a4ca64d7221 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 9 Mar 2020 14:23:49 +0100 Subject: integrate_rings_once: Handle case where reflection is negative by < 1 photon --- libcrystfel/src/integration.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index c922f703..3d8258c1 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -1487,6 +1487,11 @@ static int integrate_rings_once(Reflection *refl, struct image *image, * appropriate size */ if ( intensity < -aduph ) { sig2_poisson = -aduph*intensity; + } else if ( intensity < 0.0 ) { + /* If the intensity is negative (by less than one + * photon), assume the reflection is very weak and + * therefore has a Poisson error of one photon. */ + sig2_poisson = aduph; } sigma = sqrt(sig2_poisson + bx->m*sig2_bg); -- cgit v1.2.3