diff options
author | Thomas White <taw@physics.org> | 2014-10-06 16:34:46 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-10-06 16:34:46 +0200 |
commit | fa005231eeb48c2ba04a8159de81f786f4dd12c8 (patch) | |
tree | 94f4fda96873d17c800bccba4c1844dc22fcdf50 /libcrystfel | |
parent | 111332cfe3289815d7458dc5fa6108e0d703d01e (diff) |
WIP on SCGaussian gradients
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/geometry.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index e08d9120..6bd18e0e 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -131,7 +131,7 @@ double sphere_fraction(double rlow, double rhigh, double pr) } -double gaussian_fraction(double rlow, double rhigh, double pr) +double gaussian_fraction(double rlow, double rhigh, double R) { double plow, phigh; const double ng = 2.6; @@ -144,13 +144,13 @@ double gaussian_fraction(double rlow, double rhigh, double pr) * zero) correspond to the six situations in Table 3 of Rossmann * et al. (1979). */ - if ( rlow < -pr ) rlow = -pr; - if ( rlow > +pr ) rlow = +pr; - if ( rhigh < -pr ) rhigh = -pr; - if ( rhigh > +pr ) rhigh = +pr; + if ( rlow < -R ) rlow = -R; + if ( rlow > +R ) rlow = +R; + if ( rhigh < -R ) rhigh = -R; + if ( rhigh > +R ) rhigh = +R; - plow = 0.5 * gsl_sf_erf(ng * rlow / (sqrt(2.0)*pr)); - phigh = 0.5 * gsl_sf_erf(ng * rhigh / (sqrt(2.0)*pr)); + 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))); return plow - phigh; } |