aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-06-25 16:01:51 +0200
committerThomas White <taw@physics.org>2014-06-25 16:01:51 +0200
commitcf34597c5f8583f68eaad22d85c849e1050c922b (patch)
tree4bf919b7591cc6f701157bb48885238e4b3afbfc /libcrystfel/src
parentdef8bd0c541252e7f606c9286912eb67d3ac5929 (diff)
Pass the partiality model down from the API level
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/geometry.c6
-rw-r--r--libcrystfel/src/geometry.h5
-rw-r--r--libcrystfel/src/integration.c31
-rw-r--r--libcrystfel/src/integration.h7
4 files changed, 36 insertions, 13 deletions
diff --git a/libcrystfel/src/geometry.c b/libcrystfel/src/geometry.c
index c1d433c8..5cc46b2e 100644
--- a/libcrystfel/src/geometry.c
+++ b/libcrystfel/src/geometry.c
@@ -257,7 +257,8 @@ static Reflection *check_reflection(struct image *image, Crystal *cryst,
}
-RefList *find_intersections(struct image *image, Crystal *cryst)
+RefList *find_intersections(struct image *image, Crystal *cryst,
+ PartialityModel pmodel)
{
double ax, ay, az;
double bx, by, bz;
@@ -319,7 +320,7 @@ RefList *find_intersections(struct image *image, Crystal *cryst)
yl = h*asy + k*bsy + l*csy;
zl = h*asz + k*bsz + l*csz;
- refl = check_reflection(image, cryst, PMODEL_SPHERE,
+ refl = check_reflection(image, cryst, pmodel,
h, k, l, xl, yl, zl);
if ( refl != NULL ) {
@@ -334,6 +335,7 @@ RefList *find_intersections(struct image *image, Crystal *cryst)
}
+/* Deprecated: select reflections using Kirian-style pixel proximity */
RefList *select_intersections(struct image *image, Crystal *cryst)
{
double ax, ay, az;
diff --git a/libcrystfel/src/geometry.h b/libcrystfel/src/geometry.h
index 7188f6ed..1f465167 100644
--- a/libcrystfel/src/geometry.h
+++ b/libcrystfel/src/geometry.h
@@ -62,7 +62,10 @@ typedef enum {
} PartialityModel;
-extern RefList *find_intersections(struct image *image, Crystal *cryst);
+extern RefList *find_intersections(struct image *image, Crystal *cryst,
+ PartialityModel pmodel);
+
+/* Deprecated: select reflections using Kirian-style pixel proximity */
extern RefList *select_intersections(struct image *image, Crystal *cryst);
extern void update_partialities(Crystal *cryst, PartialityModel pmodel);
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 46e1451d..a0d23d2d 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1464,8 +1464,8 @@ static void setup_profile_boxes(struct intcontext *ic, RefList *list)
}
-static void integrate_prof2d(IntegrationMethod meth, Crystal *cr,
- struct image *image, IntDiag int_diag,
+static void integrate_prof2d(IntegrationMethod meth, PartialityModel pmodel,
+ Crystal *cr, struct image *image, IntDiag int_diag,
signed int idh, signed int idk, signed int idl,
double ir_inn, double ir_mid, double ir_out)
{
@@ -1478,7 +1478,7 @@ static void integrate_prof2d(IntegrationMethod meth, Crystal *cr,
cell = crystal_get_cell(cr);
/* Create initial list of reflections with nominal parameters */
- list = find_intersections(image, cr);
+ list = find_intersections(image, cr, pmodel);
ic.halfw = ir_out;
ic.image = image;
@@ -1719,8 +1719,8 @@ static double estimate_resolution(UnitCell *cell, ImageFeatureList *flist)
}
-static void integrate_rings(IntegrationMethod meth, Crystal *cr,
- struct image *image, IntDiag int_diag,
+static void integrate_rings(IntegrationMethod meth, PartialityModel pmodel,
+ Crystal *cr, struct image *image, IntDiag int_diag,
signed int idh, signed int idk, signed int idl,
double ir_inn, double ir_mid, double ir_out)
{
@@ -1730,7 +1730,7 @@ static void integrate_rings(IntegrationMethod meth, Crystal *cr,
UnitCell *cell;
struct intcontext ic;
- list = find_intersections(image, cr);
+ list = find_intersections(image, cr, pmodel);
if ( list == NULL ) return;
if ( num_reflections(list) == 0 ) return;
@@ -1799,8 +1799,8 @@ static void apply_resolution_cutoff(Crystal *cr, double res)
}
-void integrate_all_2(struct image *image, IntegrationMethod meth,
- double push_res,
+void integrate_all_3(struct image *image, IntegrationMethod meth,
+ PartialityModel pmodel, double push_res,
double ir_inn, double ir_mid, double ir_out,
IntDiag int_diag,
signed int idh, signed int idk, signed int idl)
@@ -1818,7 +1818,7 @@ void integrate_all_2(struct image *image, IntegrationMethod meth,
break;
case INTEGRATION_RINGS :
- integrate_rings(meth, cr, image,
+ integrate_rings(meth, pmodel, cr, image,
int_diag, idh, idk, idl,
ir_inn, ir_mid, ir_out);
res = estimate_resolution(crystal_get_cell(cr),
@@ -1826,7 +1826,7 @@ void integrate_all_2(struct image *image, IntegrationMethod meth,
break;
case INTEGRATION_PROF2D :
- integrate_prof2d(meth, cr, image,
+ integrate_prof2d(meth, pmodel, cr, image,
int_diag, idh, idk, idl,
ir_inn, ir_mid, ir_out);
res = estimate_resolution(crystal_get_cell(cr),
@@ -1848,6 +1848,17 @@ void integrate_all_2(struct image *image, IntegrationMethod meth,
}
+void integrate_all_2(struct image *image, IntegrationMethod meth,
+ double push_res,
+ double ir_inn, double ir_mid, double ir_out,
+ IntDiag int_diag,
+ signed int idh, signed int idk, signed int idl)
+{
+ integrate_all_3(image, meth, PMODEL_SPHERE, 0.0, ir_inn, ir_mid, ir_out,
+ int_diag, idh, idk, idl);
+}
+
+
void integrate_all(struct image *image, IntegrationMethod meth,
double ir_inn, double ir_mid, double ir_out,
IntDiag int_diag,
diff --git a/libcrystfel/src/integration.h b/libcrystfel/src/integration.h
index 84c1b900..f077be32 100644
--- a/libcrystfel/src/integration.h
+++ b/libcrystfel/src/integration.h
@@ -34,6 +34,8 @@
#endif
+#include "geometry.h"
+
typedef enum {
INTDIAG_NONE,
@@ -97,6 +99,11 @@ extern void integrate_all_2(struct image *image, IntegrationMethod meth,
IntDiag int_diag,
signed int idh, signed int idk, signed int idl);
+extern void integrate_all_3(struct image *image, IntegrationMethod meth,
+ PartialityModel pmodel, double push_res,
+ double ir_inn, double ir_mid, double ir_out,
+ IntDiag int_diag,
+ signed int idh, signed int idk, signed int idl);
#ifdef __cplusplus
}