aboutsummaryrefslogtreecommitdiff
path: root/src/detector.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2009-12-02 11:34:45 +0100
committerThomas White <taw@physics.org>2009-12-02 11:34:45 +0100
commit14ed5b7569dedf5905deafcb892084ccb2f1f4a3 (patch)
tree9820c5c5526fcb88bcd96333a285534a19f1d88d /src/detector.c
parent6d8e2e53e444f65930c1b92f32991f062bbfbaf3 (diff)
Add option not to include water background
Diffstat (limited to 'src/detector.c')
-rw-r--r--src/detector.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/detector.c b/src/detector.c
index 8f59db67..222e539c 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)
+void record_image(struct image *image, int do_water)
{
int x, y;
double total_energy, energy_density;
@@ -178,12 +178,15 @@ void record_image(struct image *image)
val = image->sfacs[x + image->width*y];
intensity = pow(cabs(val), 2.0);
- /* Add intensity contribution from water */
- water = water_intensity(image->qvecs[x + image->width*y],
- image->xray_energy,
- BEAM_RADIUS, WATER_RADIUS);
+ if ( do_water ) {
- intensity += water;
+ /* Add intensity contribution from water */
+ water = water_intensity(image->qvecs[x + image->width*y],
+ image->xray_energy,
+ BEAM_RADIUS, WATER_RADIUS);
+ intensity += water;
+
+ }
/* Area of pixel as seen from crystal (approximate) */
proj_area = pix_area * cos(image->twotheta[x + image->width*y]);