diff options
author | Thomas White <taw@physics.org> | 2014-11-28 17:53:09 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-11-28 17:54:01 +0100 |
commit | ca37981099e3eabd70f7b57eb22fd1cde551bd0f (patch) | |
tree | 920476fb0e83187a6b119e9b58a7201ada031e1e /libcrystfel/src/geometry.c | |
parent | 396c424b561966259467c8ab7fd31d133f209562 (diff) |
Check for rlow<rhigh only if reflection is excited and hits detector
Diffstat (limited to 'libcrystfel/src/geometry.c')
-rw-r--r-- | libcrystfel/src/geometry.c | 17 |
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); |