From 845c338b3032837ce37e02fbed0a82879030537d Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 8 Jan 2021 10:49:17 +0100 Subject: locate_peak_on_panel: Check sign of 1/mu --- libcrystfel/src/geometry.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libcrystfel/src/geometry.c') diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index 510fa833..e61f6fc8 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -103,6 +103,10 @@ static int locate_peak_on_panel(double x, double y, double z, double k, *pfs = fs; *pss = ss; + /* If "mu" is negative, then the reflection is in the + * wrong direction */ + if ( one_over_mu < 0.0 ) return 0; + /* Now, is this on this panel? */ if ( fs < 0.0 ) return 0; if ( fs >= p->w ) return 0; -- cgit v1.2.3