aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-06-30 16:00:49 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:28 +0100
commit54fee1620387697a5624d9573f541bf0c081ae11 (patch)
tree17648498fc2c845edba5e19219eb4d001ba533a8
parent5aa573dd448a53ba30844336b1e70c086432f017 (diff)
indexamajig: Derive Zaefferer window size from peak separation in geometry description
-rw-r--r--src/peaks.c13
1 files changed, 5 insertions, 8 deletions
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++ ) {