diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-02-27 12:12:04 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2010-02-27 12:12:04 +0100 |
commit | 732af8778a49cacbfffe3c451125be84d7f86ee2 (patch) | |
tree | c68b92d1c18c07c92e1318bc5d880feb6ba9f7a8 /src/detector.c | |
parent | 6170796e45768ed01b93304c1e363ef4a2b5a8fe (diff) |
More tests for odd situations
Diffstat (limited to 'src/detector.c')
-rw-r--r-- | src/detector.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/detector.c b/src/detector.c index f66ad525..92094639 100644 --- a/src/detector.c +++ b/src/detector.c @@ -85,6 +85,12 @@ void record_image(struct image *image, int do_poisson) if ( isinf(intensity) ) { ERROR("Infinity at %i,%i\n", x, y); } + if ( intensity < 0.0 ) { + ERROR("Infinity at %i,%i\n", x, y); + } + if ( isnan(intensity) ) { + ERROR("NaN at %i,%i\n", x, y); + } p = find_panel(&image->det, x, y); @@ -107,15 +113,15 @@ void record_image(struct image *image, int do_poisson) } else { cf = intensity * ph_per_e * sa * DQE; counts = rint(cf); - if ( counts < 0.0 ) { - ERROR("Negative at %i,%i %f\n", x, y, counts); - } } image->data[x + image->width*y] = counts * DETECTOR_GAIN; if ( isinf(image->data[x+image->width*y]) ) { ERROR("Processed infinity at %i,%i\n", x, y); } + if ( isnan(image->data[x+image->width*y]) ) { + ERROR("Processed NaN at %i,%i\n", x, y); + } if ( image->data[x+image->width*y] < 0.0 ) { ERROR("Processed negative at %i,%i %f\n", x, y, counts); } |