diff options
author | Thomas White <taw@physics.org> | 2010-02-05 17:45:10 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-02-05 17:45:10 +0100 |
commit | bd233188cce2c0f8203dd2a4c60eecd9abcb9bbf (patch) | |
tree | c4e054d0e959f693fbcf98d41a37bd61cad2de4c /src/diffraction.c | |
parent | 32f0796c1906818edb1f7cbfe57c76290fd97d56 (diff) |
Add (slow) bandwidth and multisampling
Diffstat (limited to 'src/diffraction.c')
-rw-r--r-- | src/diffraction.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/diffraction.c b/src/diffraction.c index 27037839..b9430ba7 100644 --- a/src/diffraction.c +++ b/src/diffraction.c @@ -174,20 +174,25 @@ void get_diffraction(struct image *image, int na, int nb, int nc, int no_sfac) double complex f_molecule; struct rvec q; double complex val; + int i; - q = image->qvecs[x + image->width*y]; + for ( i=0; i<image->nspheres; i++ ) { - f_lattice = lattice_factor(q, ax,ay,az,bx,by,bz,cx,cy,cz, - na, nb, nc); - if ( no_sfac ) { - f_molecule = 1.0; - } else { - f_molecule = molecule_factor(image->molecule, q, - ax,ay,az,bx,by,bz,cx,cy,cz); - } + q = image->qvecs[i][x + image->width*y]; + + f_lattice = lattice_factor(q, ax,ay,az,bx,by,bz,cx,cy,cz, + na, nb, nc); + if ( no_sfac ) { + f_molecule = 10000.0; + } else { + f_molecule = molecule_factor(image->molecule, q, + ax,ay,az,bx,by,bz,cx,cy,cz); + } - val = f_molecule * f_lattice; - image->sfacs[x + image->width*y] = val; + val = f_molecule * f_lattice; + image->sfacs[x + image->width*y] = val; + + } } progress_bar(x, image->width-1, "Calculating lattice factors"); |