aboutsummaryrefslogtreecommitdiff
path: root/src/detector.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/detector.c')
-rw-r--r--src/detector.c12
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);
}