From f5dab4ce7e8aea035ee25ca8f818e5779eb88726 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 16 Oct 2009 16:22:44 +0200 Subject: Read image and generate templates --- src/main.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 79dff45a..257a1169 100644 --- a/src/main.c +++ b/src/main.c @@ -20,6 +20,12 @@ #include #include +#include "cell.h" +#include "image.h" +#include "utils.h" +#include "hdf5-file.h" +#include "templates.h" + static void main_show_help(const char *s) { @@ -35,6 +41,9 @@ int main(int argc, char *argv[]) char **in_files; size_t nin; size_t i; + UnitCell *cell; + TemplateList *templates; + struct image template_parameters; while ((c = getopt(argc, argv, "h")) != -1) { @@ -60,11 +69,49 @@ int main(int argc, char *argv[]) return 1; } - printf("Generating templates...\n"); + /* Define unit cell */ + cell = cell_new_from_parameters(28.10e-9, + 28.10e-9, + 16.52e-9, + deg2rad(90.0), + deg2rad(90.0), + deg2rad(120.0)); + + /* Generate templates */ + template_parameters.width = 512; + template_parameters.height = 512; + template_parameters.fmode = FORMULATION_CLEN; + template_parameters.x_centre = 255.5; + template_parameters.y_centre = 255.5; + template_parameters.camera_len = 0.2; /* 20 cm */ + template_parameters.resolution = 5120; /* 512 pixels in 10 cm */ + template_parameters.lambda = 0.2e-9; /* LCLS wavelength */ + templates = generate_templates(cell, template_parameters); printf("Input files (%i):\n", nin); for ( i=0; i