From 8030ccdc24abd2b1c807ceb7c1bb501f6e44d129 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 14 Oct 2014 16:17:44 +0200 Subject: Final gradients for SCGaussian --- libcrystfel/src/geometry.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libcrystfel/src/geometry.c') diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index 6bd18e0e..221fe96d 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -135,6 +135,7 @@ double gaussian_fraction(double rlow, double rhigh, double R) { double plow, phigh; const double ng = 2.6; + const double sig = R/ng; /* If the "lower" Ewald sphere is a long way away, use the * position at which the Ewald sphere would just touch the @@ -149,8 +150,8 @@ double gaussian_fraction(double rlow, double rhigh, double R) if ( rhigh < -R ) rhigh = -R; if ( rhigh > +R ) rhigh = +R; - plow = 0.5 * (1.0 + gsl_sf_erf(pow(ng*rlow /R, 2.0)/sqrt(2.0))); - phigh = 0.5 * (1.0 + gsl_sf_erf(pow(ng*rhigh/R, 2.0)/sqrt(2.0))); + plow = 0.5*(1.0 + gsl_sf_erf(rlow/(sig*sqrt(2.0)))); + phigh = 0.5*(1.0 + gsl_sf_erf(rhigh/(sig*sqrt(2.0)))); return plow - phigh; } -- cgit v1.2.3