diff options
author | Thomas White <taw@physics.org> | 2010-02-26 10:58:13 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-02-26 13:40:11 +0100 |
commit | 86dd71e8640394f4e4f5aa71b2e5f51f5fea4a11 (patch) | |
tree | e7039c5d4e9b5477bc1e350e0330d157125d5c9f /src/intensities.c | |
parent | b4664bc2a399463bd4e01f331a153749b3947b8f (diff) |
Handle images as floats rather than int16_t
Also, remove bloom - it's not a useful model for what really happens and takes
too long (this isn't a detector simulation..)
Diffstat (limited to 'src/intensities.c')
-rw-r--r-- | src/intensities.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/intensities.c b/src/intensities.c index 4ec496c3..b0eef542 100644 --- a/src/intensities.c +++ b/src/intensities.c @@ -35,10 +35,10 @@ struct reflhit { }; -static int sum_nearby_points(int16_t *data, int width, int x, int y) +static double sum_nearby_points(float *data, int width, int x, int y) { int dx, dy; - int intensity = 0; + double intensity = 0; for ( dx=-3; dx<=3; dx++ ) { for ( dy=-3; dy<=3; dy++ ) { @@ -127,7 +127,7 @@ void output_intensities(struct image *image, UnitCell *cell) image->orientation.y, image->orientation.z); for ( i=0; i<n_hits; i++ ) { - int intensity; + double intensity; /* Bounds check */ if ( hits[i].x + 3 >= image->width ) continue; @@ -138,7 +138,7 @@ void output_intensities(struct image *image, UnitCell *cell) intensity = sum_nearby_points(image->data, image->width, hits[i].x, hits[i].y); - printf("%3i %3i %3i %6i (at %i,%i)\n", + printf("%3i %3i %3i %6f (at %i,%i)\n", hits[i].h, hits[i].k, hits[i].l, intensity, hits[i].x, hits[i].y); |