From 500b2962f771103cbaccb7c12573f6a54dca0a93 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 22 Feb 2018 16:06:18 +0100 Subject: Take modulus of profile radius A bit nasty, but avoids lots of NANs --- libcrystfel/src/geometry.c | 4 ++-- src/post-refinement.c | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index aaa8b06c..16a92102 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -253,7 +253,7 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst, /* Calculate the limiting wavelengths, lambda0 and lambda1 * = 1/k0 and 1/k1 respectively */ - R = crystal_get_profile_radius(cryst); + R = fabs(crystal_get_profile_radius(cryst)); top = R*R - xl*xl - yl*yl - zl*zl; k0 = top/(2.0*(zl+R)); khalf = (- xl*xl - yl*yl - zl*zl) / (2.0*zl); @@ -671,7 +671,7 @@ static void ginn_spectrum_partialities(Crystal *cryst) &bsx, &bsy, &bsz, &csx, &csy, &csz); - r0 = crystal_get_profile_radius(cryst); + r0 = fabs(crystal_get_profile_radius(cryst)); m = crystal_get_mosaicity(cryst); lambda = image->lambda; sig = image->bw * lambda; diff --git a/src/post-refinement.c b/src/post-refinement.c index 1f867d35..5c6faeaa 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -324,12 +324,6 @@ static double residual_f(const gsl_vector *v, void *pp) crystal_set_image(cr, &im); apply_parameters(v, pv->initial, pv->rv, cr); - if ( crystal_get_profile_radius(cr) <= 0.0 ) { - crystal_free(cr); - if ( pv->verbose ) STATUS("R < 0\n"); - return GSL_NAN; - } - if ( im.lambda <= 0.0 ) { crystal_free(cr); if ( pv->verbose ) STATUS("lambda < 0\n"); -- cgit v1.2.3