diff options
author | Thomas White <taw@physics.org> | 2010-01-18 16:16:20 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-01-18 16:16:20 +0100 |
commit | fc055095a1321784ded839bdcee42182bc3e5469 (patch) | |
tree | de58fde0b77a30aad1837c1ae9d95ad78ab18842 /src/peaks.c | |
parent | 094e18eed46ea514ca108f0c3dfc602f0e5eeb0c (diff) |
Output more information with --dump-peaks
Diffstat (limited to 'src/peaks.c')
-rw-r--r-- | src/peaks.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/peaks.c b/src/peaks.c index d414c912..9722f125 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -22,6 +22,7 @@ #include "image.h" #include "utils.h" +#include "index.h" #define PEAK_WINDOW_SIZE (10) @@ -192,6 +193,10 @@ void search_peaks(struct image *image, int dump_peaks) } image->features = image_feature_list_new(); + if ( dump_peaks ) { + printf("x/px\ty/px\tq/nm^-1\tPeak I\n"); + } + for ( x=1; x<image->width-1; x++ ) { for ( y=1; y<image->height-1; y++ ) { @@ -274,7 +279,18 @@ void search_peaks(struct image *image, int dump_peaks) /* Map and record reflection */ if ( dump_peaks ) { - printf("%i %i\n", x, y); + + double q, rx, ry, rz; + + map_position(image, mask_x, mask_y, + &rx, &ry, &rz); + + + q = modulus(rx, ry, rz); + + printf("%i\t%i\t%f\t%i\n", x, y, q/1.0e9, + data[mask_x+width*mask_y]); + } image_add_feature(image->features, |