aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-11-17 11:26:13 +0100
committerThomas White <taw@physics.org>2014-11-17 11:26:13 +0100
commitcd04f8b5bd80862322d4e518345b7b9d15dda186 (patch)
tree0cef6fa145e48af6f41ce415d7588fbed8d730ae /libcrystfel
parente4f6fcfe5aeac9d5e02e93436f9c22686155cb25 (diff)
pattern_sim: Add saturation
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/detector.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index e29b6d39..513d08f1 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -396,6 +396,9 @@ void record_image(struct image *image, int do_poisson, double background,
/* Convert to ADU */
dval *= p->adu_per_eV * ph_lambda_to_eV(image->lambda);
+ /* Saturation */
+ if ( dval > p->max_adu ) dval = p->max_adu;
+
image->data[x + image->width*y] = dval;
/* Sanity checks */