aboutsummaryrefslogtreecommitdiff
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
parent9c4af5b5577d091f323bc3e6ace4b0652e05c9da (diff)
Add find_intersections_to_res()
-rw-r--r--libcrystfel/src/geometry.c9
-rw-r--r--libcrystfel/src/geometry.h3
2 files changed, 12 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;
diff --git a/libcrystfel/src/geometry.h b/libcrystfel/src/geometry.h
index 93aaf619..f39b6f8b 100644
--- a/libcrystfel/src/geometry.h
+++ b/libcrystfel/src/geometry.h
@@ -63,6 +63,9 @@ typedef enum {
extern RefList *find_intersections(struct image *image, Crystal *cryst,
PartialityModel pmodel);
+extern RefList *find_intersections_to_res(struct image *image, Crystal *cryst,
+ PartialityModel pmodel,
+ double max_res);
/* Deprecated: select reflections using Kirian-style pixel proximity */
extern RefList *select_intersections(struct image *image, Crystal *cryst);