aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-03-09 14:23:49 +0100
committerThomas White <taw@physics.org>2020-03-09 14:23:49 +0100
commitd4873dff09b3cf314fce0019d76e3a4ca64d7221 (patch)
tree8b6c7c45c4c03bc6e777a874fb83d6656310a180
parent118835f8b3fc5ded5c4d6958678db54365f45d2f (diff)
integrate_rings_once: Handle case where reflection is negative by < 1 photon
-rw-r--r--libcrystfel/src/integration.c5
1 files changed, 5 insertions, 0 deletions
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);