aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-03-26 14:50:32 +0100
committerThomas White <taw@physics.org>2021-03-26 17:02:01 +0100
commite8549ceba2a5936e0bef11c00dd989e22b190370 (patch)
treeb443516efee6267ea11028c8397421a2b445b4ca /libcrystfel
parent9cf79c4a2de4b75759935cc332e233ff8e726428 (diff)
Add str_integration_method
Diffstat (limited to 'libcrystfel')
-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,