aboutsummaryrefslogtreecommitdiff
path: root/src
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
parentbdd926190e83f032d99e2a4946a4fab37cbd6ce3 (diff)
When measuring intensities, use nearby detected peak if present
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c1
-rw-r--r--src/peaks.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 03711d56..9a878e0b 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -139,6 +139,7 @@ static struct image *get_simage(struct image *template, int alternate)
}
image->lambda = ph_en_to_lambda(eV_to_J(1.8e3));
+ image->features = template->features;
return image;
}
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);