From 4c835f2ca0af0e21578e11dac824309e73b997b9 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 20 Sep 2011 17:24:06 +0200 Subject: Don't predict reflections with 2theta > 90 degrees --- src/geometry.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/geometry.c b/src/geometry.c index 8d5ec6f8..ef6ec338 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -83,13 +83,13 @@ static signed int locate_peak(double x, double y, double z, double k, static double excitation_error(double xl, double yl, double zl, - double ds, double k, double divergence) + double ds, double k, double divergence, + double tt) { - double tt, al; + double al; double r; double delta; - tt = angle_between(0.0, 0.0, 1.0, xl, yl, zl+k); al = M_PI_2 - asin(-zl/ds); r = ( ds * sin(al) / sin(tt) ) - k; @@ -143,6 +143,7 @@ static Reflection *check_reflection(struct image *image, RefList *reflections, double lambda = image->lambda; double klow, kcen, khigh; /* Wavenumber */ Reflection *refl; + double tt; /* "low" gives the largest Ewald sphere, * "high" gives the smallest Ewald sphere. */ @@ -157,12 +158,15 @@ static Reflection *check_reflection(struct image *image, RefList *reflections, xl = h*asx + k*bsx + l*csx; yl = h*asy + k*bsy + l*csy; + tt = angle_between(0.0, 0.0, 1.0, xl, yl, zl+kcen); + if ( tt > deg2rad(90.0) ) return NULL; + ds_sq = modulus_squared(xl, yl, zl); /* d*^2 */ ds = sqrt(ds_sq); /* Calculate excitation errors */ - rlow = excitation_error(xl, yl, zl, ds, klow, -divergence); - rhigh = excitation_error(xl, yl, zl, ds, khigh, +divergence); + rlow = excitation_error(xl, yl, zl, ds, klow, -divergence, tt); + rhigh = excitation_error(xl, yl, zl, ds, khigh, +divergence, tt); /* Is the reciprocal lattice point close to either extreme of * the sphere, maybe just outside the "Ewald volume"? */ -- cgit v1.2.3