From fe414fa905261a11b1af2055c1e871d2d7f826f2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 4 Dec 2009 11:54:33 +0100 Subject: Add --zone-axis option --- src/process_hkl.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 9 deletions(-) (limited to 'src/process_hkl.c') diff --git a/src/process_hkl.c b/src/process_hkl.c index 259cefc0..0cb784bf 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -47,7 +47,9 @@ static void show_help(const char *s) " -r, --rvsq Output lists of R vs |q| (\"Luzzatti plots\") when\n" " analysing figures of merit.\n" " --stop-after= Stop after processing n patterns (zero means\n" -" keep going until the end of the input).\n"); +" keep going until the end of the input).\n" +" --zone-axis Output an [001] zone axis pattern each time the\n" +" figures of merit are analysed.\n"); } @@ -123,20 +125,42 @@ static void write_RvsQ(const char *name, double *ref, double *trueref, static void write_reflections(const char *filename, unsigned int *counts, - double *ref) + double *ref, int zone_axis, UnitCell *cell) { FILE *fh; signed int h, k, l; fh = fopen(filename, "w"); + + /* Write spacings and angle if zone axis pattern */ + if ( zone_axis ) { + double a, b, c, alpha, beta, gamma; + cell_get_parameters(cell, &a, &b, &c, &alpha, &beta, &gamma); + fprintf(fh, "a %5.3f nm\n", a*1e9); + fprintf(fh, "b %5.3f nm\n", b*1e9); + fprintf(fh, "angle %5.3f deg\n", rad2deg(gamma)); + fprintf(fh, "scale 10\n"); + } + for ( h=-INDMAX; hreflections); + write_reflections("results/ideal-reflections.hkl", NULL, trueref, 1, + mol->cell); + if ( strcmp(filename, "-") == 0 ) { fh = stdin; } else { @@ -309,7 +344,8 @@ int main(int argc, char *argv[]) if ( n_patterns % config_every == 0 ) { process_reflections(ref, trueref, counts, n_patterns, mol->cell, - config_rvsq); + config_rvsq, + config_zoneaxis); } if ( n_patterns == config_stopafter ) break; @@ -337,7 +373,9 @@ int main(int argc, char *argv[]) fclose(fh); - write_reflections("results/reflections.hkl", counts, ref); + write_reflections("results/reflections.hkl", counts, ref, 0, NULL); + + STATUS("There were %u patterns.\n", n_patterns); return 0; } -- cgit v1.2.3