diff options
author | Thomas White <taw@physics.org> | 2010-10-01 14:23:20 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:00 +0100 |
commit | c56336d82f151b8eea7ce17cb34a177ba5656ecd (patch) | |
tree | 8c2ba8b5eafa8aa8aa29d51ef440e57c524633c3 /src | |
parent | ce045961f4d1cee94b98cbb8580141b20bb0a00f (diff) |
Put I0 and found peaks in stream
Diffstat (limited to 'src')
-rw-r--r-- | src/indexamajig.c | 4 | ||||
-rw-r--r-- | src/peaks.c | 14 | ||||
-rw-r--r-- | src/peaks.h | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c index 2f25d58a..742e950e 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -336,7 +336,9 @@ static void process_image(struct process_args *pargs) free(image.data); image.data = data_for_measurement; - if ( config_dumpfound ) dump_peaks(&image, pargs->output_mutex); + if ( config_dumpfound ) { + dump_peaks(&image, pargs->ofh, pargs->output_mutex); + } /* Not indexing nor writing xfel.drx? * Then there's nothing left to do. */ diff --git a/src/peaks.c b/src/peaks.c index 05de8fee..44359973 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -417,15 +417,15 @@ void search_peaks(struct image *image, float threshold) } -void dump_peaks(struct image *image, pthread_mutex_t *mutex) +void dump_peaks(struct image *image, FILE *ofh, pthread_mutex_t *mutex) { int i; /* Get exclusive access to the output stream if necessary */ if ( mutex != NULL ) pthread_mutex_lock(mutex); - printf("Peaks from peak search in %s\n", image->filename); - printf(" x/px y/px (1/d)/nm^-1 Intensity\n"); + fprintf(ofh, "Peaks from peak search in %s\n", image->filename); + fprintf(ofh, " x/px y/px (1/d)/nm^-1 Intensity\n"); for ( i=0; i<image_feature_count(image->features); i++ ) { @@ -439,12 +439,12 @@ void dump_peaks(struct image *image, pthread_mutex_t *mutex) r = get_q(image, f->x, f->y, 1, NULL, 1.0/image->lambda); q = modulus(r.u, r.v, r.w); - printf("%8.3f %8.3f %8.3f %12.3f\n", + fprintf(ofh, "%8.3f %8.3f %8.3f %12.3f\n", f->x, f->y, q/1.0e9, f->intensity); } - printf("\n"); + fprintf(ofh, "\n"); if ( mutex != NULL ) pthread_mutex_unlock(mutex); } @@ -661,10 +661,10 @@ void output_intensities(struct image *image, UnitCell *cell, csx/1e9, csy/1e9, csz/1e9); if ( image->f0_available ) { - printf("f0 = %7.5f (arbitrary gas detector units)\n", + fprintf(ofh, "f0 = %7.5f (arbitrary gas detector units)\n", image->f0); } else { - printf("f0 = invalid\n"); + fprintf(ofh, "f0 = invalid\n"); } for ( i=0; i<image->n_hits; i++ ) { diff --git a/src/peaks.h b/src/peaks.h index 55cd9ded..27f4dfc7 100644 --- a/src/peaks.h +++ b/src/peaks.h @@ -20,7 +20,7 @@ #include <pthread.h> extern void search_peaks(struct image *image, float threshold); -extern void dump_peaks(struct image *image, pthread_mutex_t *mutex); +extern void dump_peaks(struct image *image, FILE *ofh, pthread_mutex_t *mutex); extern void output_intensities(struct image *image, UnitCell *cell, pthread_mutex_t *mutex, int polar, int sa, int use_closer, FILE *ofh, int circular_domain, |