diff options
author | Yaroslav Gevorkov <yaroslav.gevorkov@desy.de> | 2019-11-05 15:56:57 +0100 |
---|---|---|
committer | Yaroslav Gevorkov <yaroslav.gevorkov@desy.de> | 2019-11-05 15:56:57 +0100 |
commit | 05c119d324e8792b2a7b83de86e4c082d401ea77 (patch) | |
tree | f1b08d5098bcbc0b8c6976b054c860537faa2047 | |
parent | 858e20d551bbb0912d9c8fba0d6d0ceb54b76c1a (diff) |
bug fix in Ewald sphere width calculation
-rw-r--r-- | libcrystfel/src/geometry.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c index 5230c642..e5506334 100644 --- a/libcrystfel/src/geometry.c +++ b/libcrystfel/src/geometry.c @@ -290,17 +290,16 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst, g = spectrum_get_gaussian(image->spectrum, i); /* Project lattice point onto Ewald sphere */ - x = xl; + x = xl; y = yl; z = zl + g.kcen; norm = 1.0/sqrt(x*x+y*y+z*z); x *= norm; y *= norm; z *= norm; - z -= 1.0; /* Width of Ewald sphere in the direction of the projection */ - sigma_proj = sqrt(x*x+y*y+z*z)*g.sigma; + sigma_proj = (1-z)*g.sigma; mean_variance(g.kcen, g.area, &sumw_k, &mean_k, &M2_k); M2_k += g.area * g.sigma * g.sigma; @@ -310,6 +309,7 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst, x *= g.kcen; y *= g.kcen; z *= g.kcen; + z -= g.kcen; /* Three because the general case fails in extreme cases */ if ( w0 / w1 <= DBL_MIN ) { |