From e8549ceba2a5936e0bef11c00dd989e22b190370 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 26 Mar 2021 14:50:32 +0100 Subject: Add str_integration_method --- libcrystfel/src/integration.c | 37 +++++++++++++++++++++++++++++++++++++ libcrystfel/src/integration.h | 2 ++ 2 files changed, 39 insertions(+) (limited to 'libcrystfel/src') 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, -- cgit v1.2.3