aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-09-20 17:24:06 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:37 +0100
commit4c835f2ca0af0e21578e11dac824309e73b997b9 (patch)
tree3b6ae33dfe5f47c7e08880e450d8885e096becf6
parent218a9f3e23291bd6ac3f87a9a0a2b713fa3888e8 (diff)
Don't predict reflections with 2theta > 90 degrees
-rw-r--r--src/geometry.c14
1 files 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"? */