From f85ba18977f85797c14b997ecb88e328d71ff5bd Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 22 Oct 2014 13:49:58 +0200 Subject: whirligig: Add some options, write out stream logs --- src/whirligig.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 12 deletions(-) (limited to 'src/whirligig.c') diff --git a/src/whirligig.c b/src/whirligig.c index 12896037..9bb310f8 100644 --- a/src/whirligig.c +++ b/src/whirligig.c @@ -130,20 +130,35 @@ static int find_common_reflections(RefList *list1, RefList *list2) static void process_series(struct image *images, signed int *ser, - IntegerMatrix **mat, int len) + IntegerMatrix **mat, int len, const char *outdir, + int snum) { int i; RefList **p; + char filename[256]; + FILE *fh; printf("\n"); STATUS("Found a rotation series of %i views\n", len); + snprintf(filename, 256, "%s/series-%i.log", outdir, snum); + fh = fopen(filename, "w"); + if ( fh == NULL ) { + ERROR("Failed to open log file '%s'\n", filename); + goto out; + } + p = calloc(len, sizeof(RefList *)); if ( p == NULL ) return; + fprintf(fh, "%i frames in series\n\n", len); + fprintf(fh, " # Serial Filename EventID Crystal\n"); for ( i=0; iimg+ser_start, win->ser[sn]+ser_start, win->mat[sn]+ser_start, - ser_len); + ser_len, outdir, *n_series); in_series = 0; + (*n_series)++; } @@ -200,17 +222,19 @@ static void find_ser(struct window *win, int sn, int is_last_frame) process_series(win->img+ser_start, win->ser[sn]+ser_start, win->mat[sn]+ser_start, - ser_len); + ser_len, outdir, *n_series); + (*n_series)++; } } -static void find_and_process_series(struct window *win, int is_last_frame) +static void find_and_process_series(struct window *win, int is_last_frame, + int *n_series, const char *outdir) { int i; for ( i=0; i