From de9ffedf34b3bb5ab184e0f0598ca7f06a242da2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 26 Nov 2014 17:31:53 +0100 Subject: Add find_intersections_to_res() --- libcrystfel/src/geometry.c | 9 +++++++++ libcrystfel/src/geometry.h | 3 +++ 2 files changed, 12 insertions(+) (limited to 'libcrystfel') 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 @@ -267,6 +267,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; @@ -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); -- cgit v1.2.3