aboutsummaryrefslogtreecommitdiff
path: root/src/detector.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-12-03 11:08:08 +0100
committerThomas White <taw@physics.org>2009-12-03 11:08:08 +0100
commit903d944cb22d818096e8bba23274a18902396e4c (patch)
treeafff4e91fa0c8db5db298b8e56da1ef7e71f93fe /src/detector.c
parentd30508aa7b57b17601c487a7761f1e4a2505a54a (diff)
Add --no-noise option
Diffstat (limited to 'src/detector.c')
-rw-r--r--src/detector.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/detector.c b/src/detector.c
index 222e539c..de1efc2b 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -142,7 +142,7 @@ static uint16_t *bloom(int *hdr_in, int width, int height)
}
-void record_image(struct image *image, int do_water)
+void record_image(struct image *image, int do_water, int do_poisson)
{
int x, y;
double total_energy, energy_density;
@@ -171,6 +171,7 @@ void record_image(struct image *image, int do_water)
for ( y=0; y<image->height; y++ ) {
int counts;
+ double cf;
double intensity, sa, water;
double complex val;
double dsq, proj_area;
@@ -198,7 +199,12 @@ void record_image(struct image *image, int do_water)
/* Projected area of pixel divided by distance squared */
sa = proj_area / (dsq + Lsq);
- counts = poisson_noise(intensity * ph_per_e * sa * DQE);
+ if ( do_poisson ) {
+ counts = poisson_noise(intensity * ph_per_e * sa * DQE);
+ } else {
+ cf = intensity * ph_per_e * sa * DQE;
+ counts = (int)cf;
+ }
image->hdr[x + image->width*y] = counts;