aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction-gpu.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-10-25 16:29:01 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:03 +0100
commit4e6691e2f6c0aa2ef92b8d3be03b513336cc3586 (patch)
treeaa28060c8bca2997d4b56bc4ff44eab305439d83 /src/diffraction-gpu.c
parent0b51b862bca321d465b90a672aaa6028406b6ef7 (diff)
Update definition of bandwidth to match documentation
Diffstat (limited to 'src/diffraction-gpu.c')
-rw-r--r--src/diffraction-gpu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c
index 409178b9..825f6372 100644
--- a/src/diffraction-gpu.c
+++ b/src/diffraction-gpu.c
@@ -113,7 +113,7 @@ void get_diffraction_gpu(struct gpu_context *gctx, struct image *image,
double ax, ay, az;
double bx, by, bz;
double cx, cy, cz;
- float k, klow;
+ float klow, khigh;
cl_event *event;
int p;
float *tt_ptr;
@@ -136,9 +136,9 @@ void get_diffraction_gpu(struct gpu_context *gctx, struct image *image,
cell.s[6] = cx; cell.s[7] = cy; cell.s[8] = cz;
/* Calculate wavelength */
- k = 1.0/image->lambda; /* Centre value */
- klow = k - k*(image->beam->bandwidth/2.0); /* Lower value */
- bwstep = k * image->beam->bandwidth / BWSAMPLING;
+ klow = 1.0/(image->lambda + image->beam->bandwidth/2.0);
+ khigh = 1.0/(image->lambda - image->beam->bandwidth/2.0);
+ bwstep = (khigh-klow) / BWSAMPLING;
/* Orientation */
orientation.s[0] = image->orientation.w;