diff options
author | Thomas White <taw@physics.org> | 2018-02-22 16:06:18 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-02-27 17:12:42 +0100 |
commit | 500b2962f771103cbaccb7c12573f6a54dca0a93 (patch) | |
tree | 279fbbe9408be0f2d224ea25269390166f6f12d5 | |
parent | c8117343347f7e19d0ce1721088096caaab16895 (diff) |
Take modulus of profile radius
A bit nasty, but avoids lots of NANs
-rw-r--r-- | libcrystfel/src/geometry.c | 4 | ||||
-rw-r--r-- | 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"); |