From 7410b92018097e975535ea228e1f302a3d463f42 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 23 Mar 2011 15:36:57 +0100 Subject: Don't try to write reflections to file if not indexed --- src/indexamajig.c | 23 +++++++++++++++-------- src/stream.c | 12 ++++++++---- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/indexamajig.c b/src/indexamajig.c index 42a91e53..c8473fd6 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -311,17 +311,24 @@ static void process_image(void *pp, int cookie) //image.reflections = find_intersections(&image, // image.indexed_cell, 0); - image.reflections = find_projected_peaks(&image, - image.indexed_cell, - 0, 0.1); + if ( image.indexed_cell != NULL ) { + image.reflections = find_projected_peaks(&image, + image.indexed_cell, + 0, 0.1); - integrate_reflections(&image, config_polar, - pargs->static_args.config_closer); + integrate_reflections(&image, config_polar, + pargs->static_args.config_closer); - /* OR */ + /* OR */ - //image.reflections = integrate_pixels(&image, 0, 0.1, - // config_polar); + //image.reflections = integrate_pixels(&image, 0, 0.1, + // config_polar); + + } else { + + image.reflections = NULL; + + } pthread_mutex_lock(pargs->static_args.output_mutex); write_chunk(pargs->static_args.ofh, &image, diff --git a/src/stream.c b/src/stream.c index 97c38b77..4707f327 100644 --- a/src/stream.c +++ b/src/stream.c @@ -255,11 +255,15 @@ void write_chunk(FILE *ofh, struct image *i, int f) if ( (f & STREAM_PIXELS) || (f & STREAM_INTEGRATED) ) { - fprintf(ofh, "\n"); - fprintf(ofh, REFLECTION_START_MARKER"\n"); - write_reflections_to_file(ofh, i->reflections, i->indexed_cell); - fprintf(ofh, REFLECTION_END_MARKER"\n"); + if ( i->reflections != NULL ) { + + fprintf(ofh, "\n"); + fprintf(ofh, REFLECTION_START_MARKER"\n"); + write_reflections_to_file(ofh, i->reflections, + i->indexed_cell); + fprintf(ofh, REFLECTION_END_MARKER"\n"); + } } fprintf(ofh, CHUNK_END_MARKER"\n\n"); -- cgit v1.2.3