aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/geometry.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c
index 43998c2b..b55b696d 100644
--- a/libcrystfel/src/geometry.c
+++ b/libcrystfel/src/geometry.c
@@ -219,14 +219,6 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst,
cez = -cos(del/2.0) * klow;
rlow = klow - distance(cet, cez, tl, zl); /* Loss of precision */
- if ( unlikely(rlow < rhigh) ) {
- ERROR("Reflection with rlow < rhigh!\n");
- ERROR("%3i %3i %3i rlow = %e, rhigh = %e\n",
- h, k, l, rlow, rhigh);
- ERROR("div + m = %e, R = %e, bw = %e\n", del, pr, image->bw);
- return NULL;
- }
-
/* Condition for reflection to be excited at all */
if ( (signbit(rlow) == signbit(rhigh))
&& (fabs(rlow) > pr)
@@ -252,6 +244,15 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst,
set_detector_pos(refl, 0.0, xda, yda);
}
+ if ( unlikely(rlow < rhigh) ) {
+ ERROR("Reflection with rlow < rhigh!\n");
+ ERROR("%3i %3i %3i rlow = %e, rhigh = %e\n",
+ h, k, l, rlow, rhigh);
+ ERROR("div + m = %e, R = %e, bw = %e\n", del, pr, image->bw);
+ reflection_free(refl);
+ return NULL;
+ }
+
set_partial(refl, rlow, rhigh, part);
set_lorentz(refl, 1.0);
set_symmetric_indices(refl, h, k, l);