aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/geometry.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-11-26 17:31:53 +0100
committerThomas White <taw@physics.org>2014-11-26 17:31:53 +0100
commitde9ffedf34b3bb5ab184e0f0598ca7f06a242da2 (patch)
tree2f79a7b793bd8b6fe9aa7b96cdac92f18bf8e0ab /libcrystfel/src/geometry.c
parent9c4af5b5577d091f323bc3e6ace4b0652e05c9da (diff)
Add find_intersections_to_res()
Diffstat (limited to 'libcrystfel/src/geometry.c')
-rw-r--r--libcrystfel/src/geometry.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c
index ae5488e0..43998c2b 100644
--- a/libcrystfel/src/geometry.c
+++ b/libcrystfel/src/geometry.c
@@ -268,6 +268,13 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst,
RefList *find_intersections(struct image *image, Crystal *cryst,
PartialityModel pmodel)
{
+ return find_intersections_to_res(image, cryst, pmodel, INFINITY);
+}
+
+
+RefList *find_intersections_to_res(struct image *image, Crystal *cryst,
+ PartialityModel pmodel, double max_res)
+{
double ax, ay, az;
double bx, by, bz;
double cx, cy, cz;
@@ -296,6 +303,7 @@ RefList *find_intersections(struct image *image, Crystal *cryst,
cell_get_cartesian(cell, &ax, &ay, &az, &bx, &by, &bz, &cx, &cy, &cz);
mres = largest_q(image);
+ if ( mres > max_res ) mres = max_res;
hmax = mres * modulus(ax, ay, az);
kmax = mres * modulus(bx, by, bz);
@@ -322,6 +330,7 @@ RefList *find_intersections(struct image *image, Crystal *cryst,
double xl, yl, zl;
if ( forbidden_reflection(cell, h, k, l) ) continue;
+ if ( 2.0*resolution(cell, h, k, l) > max_res ) continue;
/* Get the coordinates of the reciprocal lattice point */
xl = h*asx + k*bsx + l*csx;