aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorAlexandra Tolstikova <alexandra.tolstikova@desy.de>2023-02-17 15:15:30 +0100
committerThomas White <taw@physics.org>2023-02-17 15:15:30 +0100
commit10cf235e8ecdffbeb9914cd91e9de4e0f8086a69 (patch)
treed7044a068a5f5cf0c11625626e417324594ce6b0 /libcrystfel
parent76fd9489e49618fcb80bf8c6c12c3b4cfdc49c2d (diff)
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.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/indexers/asdf.c2
1 files changed, 2 insertions, 0 deletions
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++ ) {