aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/peaks.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-06-28 17:23:46 +0200
committerThomas White <taw@physics.org>2012-06-28 17:24:01 +0200
commit172293570b790ffcde14128404d9c0e294ca1f30 (patch)
treeaf63838617e2a0d0919eaf69f175ab5e96783436 /libcrystfel/src/peaks.c
parent51f5ed0461208f813a7c4ab45546516223dd4d5b (diff)
Remove peak_sep from detector geometry file, use ir_inn instead
Diffstat (limited to 'libcrystfel/src/peaks.c')
-rw-r--r--libcrystfel/src/peaks.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index fe836c3f..121ecb6c 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -390,7 +390,6 @@ static void search_peaks_in_panel(struct image *image, float threshold,
int nrej_snr = 0;
int nacc = 0;
int ncull;
- const int pws = p->peak_sep/2;
data = image->data;
stride = image->width;
@@ -433,16 +432,14 @@ static void search_peaks_in_panel(struct image *image, float threshold,
max = data[mask_fs+stride*mask_ss];
did_something = 0;
- for ( s_ss=biggest(mask_ss-pws/2,
- p->min_ss);
- s_ss<=smallest(mask_ss+pws/2,
- p->max_ss);
- s_ss++ ) {
- for ( s_fs=biggest(mask_fs-pws/2,
- p->min_fs);
- s_fs<=smallest(mask_fs+pws/2,
- p->max_fs);
- s_fs++ ) {
+ for ( s_ss=biggest(mask_ss-ir_inn, p->min_ss);
+ s_ss<=smallest(mask_ss+ir_inn, p->max_ss);
+ s_ss++ )
+ {
+ for ( s_fs=biggest(mask_fs-ir_inn, p->min_fs);
+ s_fs<=smallest(mask_fs+ir_inn, p->max_fs);
+ s_fs++ )
+ {
if ( data[s_fs+stride*s_ss] > max ) {
max = data[s_fs+stride*s_ss];
@@ -455,8 +452,7 @@ static void search_peaks_in_panel(struct image *image, float threshold,
}
/* Abort if drifted too far from the foot point */
- if ( distance(mask_fs, mask_ss, fs, ss) >
- p->peak_sep/2.0 )
+ if ( distance(mask_fs, mask_ss, fs, ss) > ir_inn )
{
break;
}
@@ -464,7 +460,7 @@ static void search_peaks_in_panel(struct image *image, float threshold,
} while ( did_something );
/* Too far from foot point? */
- if ( distance(mask_fs, mask_ss, fs, ss) > p->peak_sep/2.0 ) {
+ if ( distance(mask_fs, mask_ss, fs, ss) > ir_inn ) {
nrej_dis++;
continue;
}
@@ -500,7 +496,7 @@ static void search_peaks_in_panel(struct image *image, float threshold,
/* Check for a nearby feature */
image_feature_closest(image->features, f_fs, f_ss, &d, &idx);
- if ( d < p->peak_sep/2.0 ) {
+ if ( d < 2.0*ir_inn ) {
nrej_pro++;
continue;
}