aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-10-14 16:17:44 +0200
committerThomas White <taw@physics.org>2014-10-14 16:17:44 +0200
commit8030ccdc24abd2b1c807ceb7c1bb501f6e44d129 (patch)
tree4d86b279c9546b909fd6510d60689ada0fe8cf1f /libcrystfel
parentab566d34cfa925eaf0c4ea4bbba5c088b276b119 (diff)
Final gradients for SCGaussian
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/geometry.c5
1 files changed, 3 insertions, 2 deletions
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;
}