aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/detector.c12
-rw-r--r--src/diffraction-gpu.c3
-rw-r--r--src/pattern_sim.c4
3 files changed, 12 insertions, 7 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);
}
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c
index 851ed70c..69d21912 100644
--- a/src/diffraction-gpu.c
+++ b/src/diffraction-gpu.c
@@ -245,6 +245,9 @@ void get_diffraction_gpu(struct gpu_context *gctx, struct image *image,
if ( val < 0.0 ) {
ERROR("Extracting negative at %i,%i\n", x, y);
}
+ if ( isnan(val) ) {
+ ERROR("Extracting NaN at %i,%i\n", x, y);
+ }
tt = tt_ptr[x + image->width*y];
image->data[x + image->width*y] = val;
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index a29a8f0e..9542e494 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -307,10 +307,6 @@ int main(int argc, char *argv[])
for ( x=0; x<image.width; x++ ) {
for ( y=0; y<image.height; y++ ) {
powder[x+w*y] += (double)image.data[x+w*y];
- if ( image.data[x+w*y] < 0 ) {
- STATUS("Negative! %f %i %i\n",
- image.data[x+w*y], x, y);
- }
}
}