aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/integration.c25
-rw-r--r--libcrystfel/src/integration.h7
2 files changed, 27 insertions, 5 deletions
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index e9ba259d..d6fc6ce5 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1062,6 +1062,7 @@ static void measure_all_intensities(IntegrationMethod meth, RefList *list,
* in overall data block */
int cfs, css; /* Corner coordinates */
int saturated;
+ int r;
set_redundancy(refl, 0);
@@ -1089,7 +1090,12 @@ static void measure_all_intensities(IntegrationMethod meth, RefList *list,
/* Which reference profile? */
bx->rp = 0;//bx->pn;
- if ( center_and_check_box(&ic, bx, &saturated) ) {
+ if ( meth & INTEGRATION_CENTER ) {
+ r = center_and_check_box(&ic, bx, &saturated);
+ } else {
+ r = check_box(&ic, bx, &saturated);
+ }
+ if ( r ) {
delete_box(&ic, bx);
continue;
}
@@ -1489,6 +1495,7 @@ static void integrate_rings(IntegrationMethod meth, Crystal *cr,
double sigma, snr;
int saturated;
double one_over_d;
+ int r;
set_redundancy(refl, 0);
@@ -1513,7 +1520,12 @@ static void integrate_rings(IntegrationMethod meth, Crystal *cr,
bx->p = p;
bx->pn = pn;
- if ( center_and_check_box(&ic, bx, &saturated) ) {
+ if ( meth & INTEGRATION_CENTER ) {
+ r = center_and_check_box(&ic, bx, &saturated);
+ } else {
+ r = check_box(&ic, bx, &saturated);
+ }
+ if ( r ) {
delete_box(&ic, bx);
continue;
}
@@ -1615,6 +1627,15 @@ IntegrationMethod integration_method(const char *str, int *err)
} else if ( strcmp(methods[i], "sat") == 0) {
meth |= INTEGRATION_SATURATED;
+ } else if ( strcmp(methods[i], "nosat") == 0) {
+ meth &= ~INTEGRATION_SATURATED;
+
+ } else if ( strcmp(methods[i], "cen") == 0) {
+ meth |= INTEGRATION_CENTER;
+
+ } else if ( strcmp(methods[i], "nocen") == 0) {
+ meth &= ~INTEGRATION_CENTER;
+
} else {
ERROR("Bad integration method: '%s'\n", str);
if ( err != NULL ) *err = 1;
diff --git a/libcrystfel/src/integration.h b/libcrystfel/src/integration.h
index fe939e21..913297fa 100644
--- a/libcrystfel/src/integration.h
+++ b/libcrystfel/src/integration.h
@@ -33,8 +33,8 @@
#include <config.h>
#endif
-#define INTEGRATION_DEFAULTS_RINGS (INTEGRATION_RINGS)
-#define INTEGRATION_DEFAULTS_PROF2D (INTEGRATION_PROF2D)
+#define INTEGRATION_DEFAULTS_RINGS (INTEGRATION_RINGS | INTEGRATION_CENTER)
+#define INTEGRATION_DEFAULTS_PROF2D (INTEGRATION_PROF2D | INTEGRATION_CENTER)
/**
* IntegrationMethod:
@@ -56,7 +56,8 @@ typedef enum {
/* Bits at the top of the IntegrationMethod are flags which modify the
* behaviour of the integration. */
- INTEGRATION_SATURATED = 256
+ INTEGRATION_SATURATED = 256,
+ INTEGRATION_CENTER = 512,
} IntegrationMethod;