aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction-gpu.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-10-25 18:51:22 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:03 +0100
commita57e91ffc5b9aed57b2257d6b5e9b5cb59eb77ad (patch)
tree0bce34b84d14d678399b1cc95baa51e6cb95c9bb /src/diffraction-gpu.c
parent89fc199308230dd77757f7b02c26974e46712ee9 (diff)
Fix wavelength
Diffstat (limited to 'src/diffraction-gpu.c')
-rw-r--r--src/diffraction-gpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c
index 825f6372..7f05471f 100644
--- a/src/diffraction-gpu.c
+++ b/src/diffraction-gpu.c
@@ -136,8 +136,8 @@ 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 */
- klow = 1.0/(image->lambda + image->beam->bandwidth/2.0);
- khigh = 1.0/(image->lambda - image->beam->bandwidth/2.0);
+ klow = 1.0/(image->lambda*(1.0 + image->beam->bandwidth/2.0));
+ khigh = 1.0/(image->lambda*(1.0 - image->beam->bandwidth/2.0));
bwstep = (khigh-klow) / BWSAMPLING;
/* Orientation */