From 54fee1620387697a5624d9573f541bf0c081ae11 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 30 Jun 2011 16:00:49 +0200 Subject: indexamajig: Derive Zaefferer window size from peak separation in geometry description --- src/peaks.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/peaks.c') diff --git a/src/peaks.c b/src/peaks.c index 663ed17f..a544f868 100644 --- a/src/peaks.c +++ b/src/peaks.c @@ -44,10 +44,6 @@ /* Degree of polarisation of X-ray beam */ #define POL (1.0) -/* Window size for Zaefferer peak detection */ -#define PEAK_WINDOW_SIZE (10) - - static int cull_peaks_in_panel(struct image *image, struct panel *p) { int i, n; @@ -298,6 +294,7 @@ static void search_peaks_in_panel(struct image *image, float threshold, int nrej_bad = 0; int nacc = 0; int ncull; + const int pws = p->peak_sep/2; data = image->data; stride = image->width; @@ -340,14 +337,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-PEAK_WINDOW_SIZE/2, + for ( s_ss=biggest(mask_ss-pws/2, p->min_ss); - s_ss<=smallest(mask_ss+PEAK_WINDOW_SIZE/2, + s_ss<=smallest(mask_ss+pws/2, p->max_ss); s_ss++ ) { - for ( s_fs=biggest(mask_fs-PEAK_WINDOW_SIZE/2, + for ( s_fs=biggest(mask_fs-pws/2, p->min_fs); - s_fs<=smallest(mask_fs+PEAK_WINDOW_SIZE/2, + s_fs<=smallest(mask_fs+pws/2, p->max_fs); s_fs++ ) { -- cgit v1.2.3