aboutsummaryrefslogtreecommitdiff
path: root/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-29 15:15:29 +0200
committerThomas White <taw@physics.org>2010-03-29 15:15:29 +0200
commite2b7964688457b12fa171ec1d8c6c5e7670f0e96 (patch)
tree724281d4cb17ee7ebab92d5d697edf0c3b370e00 /src/peaks.c
parentbdd926190e83f032d99e2a4946a4fab37cbd6ce3 (diff)
When measuring intensities, use nearby detected peak if present
Diffstat (limited to 'src/peaks.c')
-rw-r--r--src/peaks.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/peaks.c b/src/peaks.c
index 4afd0129..02ad6492 100644
--- a/src/peaks.c
+++ b/src/peaks.c
@@ -403,9 +403,20 @@ void output_intensities(struct image *image, UnitCell *cell)
for ( i=0; i<n_hits; i++ ) {
float x, y, intensity;
+ double d;
+ int idx;
+ struct imagefeature *f;
integrate_peak(image, hits[i].x, hits[i].y, &x, &y, &intensity);
+ /* Wait.. is there a closer feature which was detected? */
+ f = image_feature_closest(image->features, x, y, &d, &idx);
+ if ( (d < 10.0) && (f != NULL) ) {
+ x = f->x;
+ y = f->y;
+ intensity = f->intensity;
+ }
+
/* Write h,k,l, integrated intensity and centroid coordinates */
printf("%3i %3i %3i %6f (at %5.2f,%5.2f)\n",
hits[i].h, hits[i].k, hits[i].l, intensity, x, y);