diff options
Diffstat (limited to 'libcrystfel/src/geometry.c')
-rw-r--r-- | libcrystfel/src/geometry.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index 10a7fa19..7bcb8d8f 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -306,7 +306,7 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst, z -= g.kcen; /* Three because the general case fails in extreme cases */ - if ( w0 / w1 <= DBL_MIN ) { + if ( isinf(w0) || (w0 / w1 <= DBL_MIN) ) { /* 'Laue' corner case */ kpred = g.kcen; @@ -352,6 +352,7 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst, /* Revert the 'Lorentz' factor */ partiality *= sqrt( ( R*R + M2_k/sumw_k) / ( R*R ) ); + if ( isnan(partiality) ) partiality = 0.0; if ( (updateme == NULL) && ( partiality < min_partiality ) ) return NULL; |