aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/integration.c37
-rw-r--r--libcrystfel/src/integration.h2
2 files changed, 39 insertions, 0 deletions
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 4c813a11..84763a08 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1777,6 +1777,43 @@ void integrate_all(struct image *image, IntegrationMethod meth,
}
+char *str_integration_method(IntegrationMethod m)
+{
+ char tmp[64];
+ switch ( m & INTEGRATION_METHOD_MASK ) {
+ case INTEGRATION_NONE :
+ strcpy(tmp, "none");
+ break;
+
+ case INTEGRATION_RINGS :
+ strcpy(tmp, "rings");
+ break;
+
+ case INTEGRATION_PROF2D :
+ strcpy(tmp, "prof2d");
+ break;
+
+ default :
+ strcpy(tmp, "unknown");
+ break;
+ }
+
+ if ( m & INTEGRATION_SATURATED ) {
+ strcat(tmp, "-sat");
+ }
+
+ if ( m & INTEGRATION_CENTER ) {
+ strcat(tmp, "-cen");
+ }
+
+ if ( m & INTEGRATION_GRADIENTBG ) {
+ strcat(tmp, "-grad");
+ }
+
+ return strdup(tmp);
+}
+
+
IntegrationMethod integration_method(const char *str, int *err)
{
int n, i;
diff --git a/libcrystfel/src/integration.h b/libcrystfel/src/integration.h
index f230201d..15af3173 100644
--- a/libcrystfel/src/integration.h
+++ b/libcrystfel/src/integration.h
@@ -113,6 +113,8 @@ struct intcontext;
extern IntegrationMethod integration_method(const char *t, int *err);
+extern char *str_integration_method(IntegrationMethod m);
+
extern struct intcontext *intcontext_new(struct image *image,
UnitCell *cell,
IntegrationMethod meth,