aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-05-27 16:40:43 +0200
committerThomas White <taw@physics.org>2020-07-29 18:42:57 +0200
commitab352f28b1c9d2691e4f39730b0ad5adf056426b (patch)
treecc00ecb99d79e218c9b41d89765cc90b44963a7e /libcrystfel
parent17fc522b88a8eb425ff094077f8c9d5463647993 (diff)
Convert make_BgMask to detgeom
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/integration.c3
-rw-r--r--libcrystfel/src/peaks.c10
-rw-r--r--libcrystfel/src/peaks.h3
3 files changed, 10 insertions, 6 deletions
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 681aef02..85d7cd94 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1688,7 +1688,8 @@ void integrate_all_5(struct image *image, IntegrationMethod meth,
}
for ( i=0; i<image->det->n_panels; i++ ) {
- masks[i] = make_BgMask(image, &image->det->panels[i], ir_inn);
+ masks[i] = make_BgMask(image, &image->detgeom->panels[i],
+ i, ir_inn);
}
for ( i=0; i<image->n_crystals; i++ ) {
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index de024b0d..e4921058 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -64,7 +64,8 @@
/** \file peaks.h */
-static void add_crystal_to_mask(struct image *image, struct panel *p,
+static void add_crystal_to_mask(struct image *image,
+ struct detgeom_panel *p, int pn,
double ir_inn, int *mask, Crystal *cr)
{
Reflection *refl;
@@ -81,7 +82,7 @@ static void add_crystal_to_mask(struct image *image, struct panel *p,
get_detector_pos(refl, &pk2_fs, &pk2_ss);
/* Determine if reflection is in the same panel */
- if ( get_panel(refl) != p ) continue;
+ if ( get_panel_number(refl) != pn ) continue;
for ( dfs=-ir_inn; dfs<=ir_inn; dfs++ ) {
for ( dss=-ir_inn; dss<=ir_inn; dss++ ) {
@@ -110,7 +111,8 @@ static void add_crystal_to_mask(struct image *image, struct panel *p,
/* cfs, css relative to panel origin */
-int *make_BgMask(struct image *image, struct panel *p, double ir_inn)
+int *make_BgMask(struct image *image, struct detgeom_panel *p,
+ int pn, double ir_inn)
{
int *mask;
int i;
@@ -121,7 +123,7 @@ int *make_BgMask(struct image *image, struct panel *p, double ir_inn)
if ( image->crystals == NULL ) return mask;
for ( i=0; i<image->n_crystals; i++ ) {
- add_crystal_to_mask(image, p, ir_inn,
+ add_crystal_to_mask(image, p, pn, ir_inn,
mask, image->crystals[i]);
}
diff --git a/libcrystfel/src/peaks.h b/libcrystfel/src/peaks.h
index e4dbed40..1b949e31 100644
--- a/libcrystfel/src/peaks.h
+++ b/libcrystfel/src/peaks.h
@@ -66,7 +66,8 @@ extern const char *str_peaksearch(enum peak_search_method meth);
extern enum peak_search_method parse_peaksearch(const char *arg);
-extern int *make_BgMask(struct image *image, struct panel *p, double ir_inn);
+extern int *make_BgMask(struct image *image, struct detgeom_panel *p,
+ int pn, double ir_inn);
extern void search_peaks(struct image *image, float threshold,
float min_gradient, float min_snr, double ir_inn,