aboutsummaryrefslogtreecommitdiff
path: root/src/diffraction.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-09 15:07:37 +0100
committerThomas White <taw@physics.org>2010-02-09 15:07:37 +0100
commita122cc94e01bbfb34243d9db5268284a23aed116 (patch)
treef0dacfea947c1371d2e4ba67fd0085425bae5945 /src/diffraction.c
parentd273ade6ec56734dce9c2b0eecc632e31e494b74 (diff)
Weight bandwidth samples properly
Diffstat (limited to 'src/diffraction.c')
-rw-r--r--src/diffraction.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/diffraction.c b/src/diffraction.c
index bcd0e100..88b50d1f 100644
--- a/src/diffraction.c
+++ b/src/diffraction.c
@@ -23,9 +23,9 @@
#include "sfac.h"
-#define SAMPLING (2)
+#define SAMPLING (5)
#define BWSAMPLING (10)
-#define BANDWIDTH (0.015)
+#define BANDWIDTH (1.0 / 100.0)
static double lattice_factor(struct rvec q, double ax, double ay, double az,
@@ -231,6 +231,8 @@ void get_diffraction(struct image *image, int na, int nb, int nc, int no_sfac)
for ( kstep=0; kstep<BWSAMPLING; kstep++ ) {
float k;
+ double kw = 1.0/BWSAMPLING;
+ double complex val;
/* Calculate k this time round */
k = kc + (kstep-(BWSAMPLING/2)) *
@@ -250,7 +252,8 @@ void get_diffraction(struct image *image, int na, int nb, int nc, int no_sfac)
ax,ay,az,bx,by,bz,cx,cy,cz);
}
- image->sfacs[x + image->width*y] += sw * f_molecule * f_lattice;
+ val = sw * kw * f_molecule * f_lattice;
+ image->sfacs[x + image->width*y] += val;
}