From c9a551b872ae4eb16a606d46a7cf118af24f75f5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 12 Nov 2009 18:03:12 +0100 Subject: Loads of lattice stuff --- src/main.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 8ab11c85..ee02d340 100644 --- a/src/main.c +++ b/src/main.c @@ -19,7 +19,7 @@ #include #include "image.h" -#include "relrod.h" +#include "diffraction.h" #include "cell.h" #include "utils.h" #include "hdf5-file.h" @@ -39,11 +39,9 @@ static void main_show_help(const char *s) int main(int argc, char *argv[]) { - int c, i; + int c; UnitCell *cell; struct image image; - int nrefl; - float t; while ((c = getopt(argc, argv, "h")) != -1) { @@ -70,28 +68,21 @@ int main(int argc, char *argv[]) image.width = 512; image.height = 512; image.omega = deg2rad(40.0); + image.tilt = deg2rad(0.0); image.fmode = FORMULATION_CLEN; image.x_centre = 255.5; image.y_centre = 255.5; image.camera_len = 0.2; /* 20 cm */ image.resolution = 5120; /* 512 pixels in 10 cm */ image.lambda = 0.2e-9; /* LCLS wavelength */ - image.data = malloc(512*512*2); - - for ( t=0.0; t<180.0; t+=10.0 ) { - - char filename[32]; - - memset(image.data, 0, 512*512*2); - image.tilt = deg2rad(t); - - get_diffraction(&image, cell); - - /* Write the output file */ - snprintf(filename, 32, "simulated-%.0f.h5", t); - hdf5_write(filename, image.data, image.width, image.height); - - } + image.qvecs = NULL; + image.sfacs = NULL; + image.data = NULL; + + get_diffraction(&image, cell); + + /* Write the output file */ + hdf5_write("results/sim.h5", image.sfacs, image.width, image.height); return 0; } -- cgit v1.2.3