diff options
author | Thomas White <taw@physics.org> | 2010-09-10 17:43:15 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:57 +0100 |
commit | bc92f4d1a3e6a1ea983fc34814d5d664b827e12e (patch) | |
tree | 1321db4a49ad13145d5465ce0ca9b10ab03af49b /src/peaks.c | |
parent | f5276f34b53e558b3a72eb6d13c2ff3c41d674d1 (diff) |
indexamajig: Implement --no-closer-peak
Diffstat (limited to 'src/peaks.c')
-rw-r--r-- | src/peaks.c | 87 |
1 files changed, 56 insertions, 31 deletions
diff --git a/src/peaks.c b/src/peaks.c index 57736019..229037f7 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -613,44 +613,73 @@ void output_intensities(struct image *image, UnitCell *cell, float x, y, intensity; double d; int idx; - struct imagefeature *f; /* Wait.. is there a really close feature which was detected? */ - if ( image->features != NULL ) { - f = image_feature_closest(image->features, - image->hits[i].x, - image->hits[i].y, - &d, &idx); - } else { - f = NULL; - } - if ( (f != NULL) && (d < PEAK_REALLY_CLOSE) ) { + if ( use_closer ) { - int r; + struct imagefeature *f; - /* f->intensity was measured on the filtered pattern, - * so instead re-integrate using old coordinates. - * This will produce further revised coordinates. */ - r = integrate_peak(image, f->x, f->y, &x, &y, - &intensity, polar, sa); - if ( r ) { - /* The original peak (which also went through - * integrate_peak(), but with the mangled - * image data) would have been rejected if it - * was in a bad region. Integration of the same - * peak included a bad region this time. */ - n_veto_second++; - continue; + if ( image->features != NULL ) { + f = image_feature_closest(image->features, + image->hits[i].x, + image->hits[i].y, + &d, &idx); + } else { + f = NULL; + } + if ( (f != NULL) && (d < PEAK_REALLY_CLOSE) ) { + + int r; + + /* f->intensity was measured on the filtered + * pattern, so instead re-integrate using old + * coordinates. This will produce further + * revised coordinates. */ + r = integrate_peak(image, f->x, f->y, &x, &y, + &intensity, polar, sa); + if ( r ) { + /* The original peak (which also went + * through integrate_peak(), but with + * the mangled image data) would have + * been rejected if it was in a bad + * region. Integration of the same + * peak included a bad region this time. + */ + n_veto_second++; + continue; + } + intensity = f->intensity; + + } else { + + int r; + + r = integrate_peak(image, + image->hits[i].x, + image->hits[i].y, + &x, &y, &intensity, polar, + sa); + if ( r ) { + /* Plain old ordinary peak veto */ + n_veto++; + continue; + } + + } + + if ( (f != NULL) && (d < PEAK_CLOSE) ) { + n_indclose++; } - intensity = f->intensity; } else { int r; r = integrate_peak(image, - image->hits[i].x,image->hits[i].y, - &x, &y, &intensity, polar, sa); + image->hits[i].x, + image->hits[i].y, + &x, &y, &intensity, polar, + sa); if ( r ) { /* Plain old ordinary peak veto */ n_veto++; @@ -659,10 +688,6 @@ void output_intensities(struct image *image, UnitCell *cell, } - if ( (f != NULL) && (d < PEAK_CLOSE) ) { - n_indclose++; - } - /* Write h,k,l, integrated intensity and centroid coordinates */ printf("%3i %3i %3i %6f (at %5.2f,%5.2f)\n", image->hits[i].h, image->hits[i].k, image->hits[i].l, |