From a57e91ffc5b9aed57b2257d6b5e9b5cb59eb77ad Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 25 Oct 2010 18:51:22 +0200 Subject: Fix wavelength --- src/diffraction-gpu.c | 4 ++-- src/diffraction.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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 */ diff --git a/src/diffraction.c b/src/diffraction.c index 20490c99..29e30431 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -311,8 +311,8 @@ void get_diffraction(struct image *image, int na, int nb, int nc, /* Needed later for Lorentz calculation */ image->twotheta = malloc(image->width * image->height * sizeof(double)); - 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; for ( xs=0; xswidth*SAMPLING; xs++ ) { -- cgit v1.2.3