From 10cf235e8ecdffbeb9914cd91e9de4e0f8086a69 Mon Sep 17 00:00:00 2001 From: Alexandra Tolstikova Date: Fri, 17 Feb 2023 15:15:30 +0100 Subject: asdf: Restrict domain for search for peaks in frequency graph Previously, it was possible for the search to run over the part of the array initialised by FFTW. --- libcrystfel/src/indexers/asdf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/indexers/asdf.c b/libcrystfel/src/indexers/asdf.c index 4473b3f2..b1c1246a 100644 --- a/libcrystfel/src/indexers/asdf.c +++ b/libcrystfel/src/indexers/asdf.c @@ -397,6 +397,8 @@ static float find_ds_fft(double *projections, int N_projections, double d_max, int i_max = (int)(d_max * (projections_sorted[n - 1] - projections_sorted[0])); + if ( i_max > N / 2 ) i_max = N / 2; + int d = 1; double maxval = 0; for ( i=1; i<=i_max; i++ ) { -- cgit v1.2.3