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 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'libcrystfel/src/integration.c') 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; -- cgit v1.2.3