From 2600c19c6d9b994de1cb2d5e634571a55434c707 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 23 Oct 2009 11:30:39 +0200 Subject: Initial fork from template_index to pattern_sim --- src/main.c | 109 ++++++++++++++++++++++++++++--------------------------------- 1 file changed, 50 insertions(+), 59 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 967fbb58..04f806f2 100644 --- a/src/main.c +++ b/src/main.c @@ -1,11 +1,9 @@ /* * main.c * - * "Main" - * * (c) 2006-2009 Thomas White * - * template_index - Indexing diffraction patterns by template matching + * pattern_sim - Simulate diffraction patterns from small crystals * */ @@ -20,11 +18,15 @@ #include #include -#include "cell.h" #include "image.h" +#include "relrod.h" +#include "cell.h" #include "utils.h" #include "hdf5-file.h" -#include "templates.h" + + +/* Crystal size in metres */ +#define CRYSTAL_SIZE (500.0e-9) static void main_show_help(const char *s) @@ -37,13 +39,11 @@ static void main_show_help(const char *s) int main(int argc, char *argv[]) { - int c; - char **in_files; - size_t nin; - size_t i; + int c, i; UnitCell *cell; - TemplateList *templates; - struct image template_parameters; + struct image image; + int nrefl; + float t; while ((c = getopt(argc, argv, "h")) != -1) { @@ -58,17 +58,6 @@ int main(int argc, char *argv[]) } - if ( optind < argc ) { - nin = argc-optind; - in_files = malloc(nin*sizeof(char *)); - for ( i=0; ix; + y = f->y; /* Discards digits after the decimal point */ + + image.data[y*image.width+x] = 1; + + } - printf("%+8.2f %+8.2f deg\n", rad2deg(image.omega), - rad2deg(image.tilt)); + /* Write the output file */ + snprintf(filename, 32, "simulated-%.0f.h5", t); + hdf5_write(filename, image.data, image.width, image.height); } -- cgit v1.2.3