From cd04f8b5bd80862322d4e518345b7b9d15dda186 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 17 Nov 2014 11:26:13 +0100 Subject: pattern_sim: Add saturation --- libcrystfel/src/detector.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libcrystfel/src/detector.c') 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 */ -- cgit v1.2.3