diff options
author | Thomas White <taw@physics.org> | 2010-10-25 16:29:01 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:03 +0100 |
commit | 4e6691e2f6c0aa2ef92b8d3be03b513336cc3586 (patch) | |
tree | aa28060c8bca2997d4b56bc4ff44eab305439d83 /src/diffraction.c | |
parent | 0b51b862bca321d465b90a672aaa6028406b6ef7 (diff) |
Update definition of bandwidth to match documentation
Diffstat (limited to 'src/diffraction.c')
-rw-r--r-- | src/diffraction.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/diffraction.c b/src/diffraction.c index 66a2ba27..20490c99 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -301,7 +301,7 @@ void get_diffraction(struct image *image, int na, int nb, int nc, double ax, ay, az; double bx, by, bz; double cx, cy, cz; - float k, klow, bwstep; + float klow, khigh, bwstep; cell_get_cartesian(cell, &ax, &ay, &az, &bx, &by, &bz, &cx, &cy, &cz); @@ -311,9 +311,9 @@ 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)); - 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; for ( xs=0; xs<image->width*SAMPLING; xs++ ) { for ( ys=0; ys<image->height*SAMPLING; ys++ ) { |