Commit fc8ba89f authored by Thomas White's avatar Thomas White
Browse files

Random particle sizes

parent 64acc8cd
......@@ -31,9 +31,6 @@ static double lattice_factor(struct threevec q, double ax, double ay, double az,
{
struct threevec Udotq;
double f1, f2, f3;
int na = 4;
int nb = 4;
int nc = 30;
Udotq.u = ax*q.u + ay*q.v + az*q.w;
Udotq.v = bx*q.u + by*q.v + bz*q.w;
......@@ -136,7 +133,7 @@ double water_intensity(struct threevec q, double en,
}
void get_diffraction(struct image *image)
void get_diffraction(struct image *image, int na, int nb, int nc)
{
int x, y;
double ax, ay, az;
......@@ -172,7 +169,8 @@ void get_diffraction(struct image *image)
q = image->qvecs[x + image->width*y];
f_lattice = lattice_factor(q, ax,ay,az,bx,by,bz,cx,cy,cz);
f_lattice = lattice_factor(q, ax,ay,az,bx,by,bz,cx,cy,cz,
na, nb, nc);
f_molecule = molecule_factor(image->molecule, q,
ax,ay,az,bx,by,bz,cx,cy,cz);
......
......@@ -19,7 +19,7 @@
#include "image.h"
#include "cell.h"
extern void get_diffraction(struct image *image);
extern void get_diffraction(struct image *image, int na, int nb, int nc);
extern double water_intensity(struct threevec q, double en,
double beam_r, double water_r);
......
......@@ -225,12 +225,9 @@ int main(int argc, char *argv[])
int na, nb, nc;
//na = 8*random()/RAND_MAX + 4;
//nb = 8*random()/RAND_MAX + 4;
//nc = 16*random()/RAND_MAX + 30;
na = 4;
nb = 4;
nc = 30;
na = 8*random()/RAND_MAX + 4;
nb = 8*random()/RAND_MAX + 4;
nc = 16*random()/RAND_MAX + 30;
STATUS("Particle size = %i x %i x %i\n", na, nb, nc);
/* Read quaternion from stdin */
......@@ -256,7 +253,7 @@ int main(int argc, char *argv[])
image.twotheta = NULL;
image.hdr = NULL;
get_diffraction(&image);
get_diffraction(&image, na, nb, nc);
record_image(&image, !config_nowater, !config_nonoise,
!config_nobloom);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment