aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-06-16 14:49:48 +0200
committerThomas White <taw@physics.org>2023-07-28 13:22:05 +0200
commit4d7b87c1e9d57773733b22608d0c20513fad923d (patch)
treece41e951e73d966cc16f4b2c43b3d252b12452b4 /libcrystfel/src
parente9906650fd078b3a8c60581847d8d423f6c22e5e (diff)
Fix horribly confusing rotation labels
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/crystfel-mille.c26
-rw-r--r--libcrystfel/src/crystfel-mille.h3
-rw-r--r--libcrystfel/src/geometry.h3
3 files changed, 18 insertions, 14 deletions
diff --git a/libcrystfel/src/crystfel-mille.c b/libcrystfel/src/crystfel-mille.c
index 6bdcb51a..4230dadc 100644
--- a/libcrystfel/src/crystfel-mille.c
+++ b/libcrystfel/src/crystfel-mille.c
@@ -54,7 +54,7 @@ static const enum gparam rv[] =
};
-int mille_label(int hierarchy_level, int member_index, char param)
+int mille_label(int hierarchy_level, int member_index, enum gparam param)
{
int label;
@@ -62,12 +62,12 @@ int mille_label(int hierarchy_level, int member_index, char param)
label = 100000*hierarchy_level + 100*member_index;
switch ( param ) {
- case 'x' : return label+1; /* x-shift */
- case 'y' : return label+2; /* y-shift */
- case 'z' : return label+3; /* z-shift */
- case 'a' : return label+4; /* Rotation around x */
- case 'b' : return label+5; /* Rotation around y */
- case 'c' : return label+6; /* Rotation around z */
+ case GPARAM_DETX : return label+1; /* x-shift */
+ case GPARAM_DETY : return label+2; /* y-shift */
+ case GPARAM_CLEN : return label+3; /* z-shift */
+ case GPARAM_ROTX : return label+4; /* Rotation around x */
+ case GPARAM_ROTY : return label+5; /* Rotation around y */
+ case GPARAM_ROTZ : return label+6; /* Rotation around z */
default : abort();
}
}
@@ -116,15 +116,15 @@ void write_mille(Mille *mille, int n, UnitCell *cell,
while ( group != NULL ) {
global_gradients[j] = -1.0;
- labels[j] = mille_label(group->hierarchy_level, group->member_index, 'x');
+ labels[j] = mille_label(group->hierarchy_level, group->member_index, GPARAM_DETX);
j++;
global_gradients[j] = -xl / (kpred+zl);
- labels[j] = mille_label(group->hierarchy_level, group->member_index, 'z');
+ labels[j] = mille_label(group->hierarchy_level, group->member_index, GPARAM_CLEN);
j++;
global_gradients[j] = -(ypk - group->cy);
- labels[j] = mille_label(group->hierarchy_level, group->member_index, 'c');
+ labels[j] = mille_label(group->hierarchy_level, group->member_index, GPARAM_ROTZ);
j++;
group = group->parent;
@@ -148,15 +148,15 @@ void write_mille(Mille *mille, int n, UnitCell *cell,
while ( group != NULL ) {
global_gradients[j] = -1.0;
- labels[j] = mille_label(group->hierarchy_level, group->member_index, 'y');
+ labels[j] = mille_label(group->hierarchy_level, group->member_index, GPARAM_DETY);
j++;
global_gradients[j] = -yl / (kpred+zl);
- labels[j] = mille_label(group->hierarchy_level, group->member_index, 'z');
+ labels[j] = mille_label(group->hierarchy_level, group->member_index, GPARAM_CLEN);
j++;
global_gradients[j] = xpk - group->cx;
- labels[j] = mille_label(group->hierarchy_level, group->member_index, 'c');
+ labels[j] = mille_label(group->hierarchy_level, group->member_index, GPARAM_ROTZ);
j++;
group = group->parent;
diff --git a/libcrystfel/src/crystfel-mille.h b/libcrystfel/src/crystfel-mille.h
index 7b4f84cf..696ee9e1 100644
--- a/libcrystfel/src/crystfel-mille.h
+++ b/libcrystfel/src/crystfel-mille.h
@@ -34,6 +34,7 @@ typedef void *Mille;
#include "cell.h"
#include "image.h"
#include "predict-refine.h"
+#include "geometry.h"
/**
* \file crystfel-mille.h
@@ -46,7 +47,7 @@ extern Mille *crystfel_mille_new(const char *outFileName,
extern void crystfel_mille_free(Mille *m);
-extern int mille_label(int hierarchy_level, int member_index, char param);
+extern int mille_label(int hierarchy_level, int member_index, enum gparam param);
extern void write_mille(Mille *mille, int n, UnitCell *cell,
struct reflpeak *rps, struct image *image,
diff --git a/libcrystfel/src/geometry.h b/libcrystfel/src/geometry.h
index 19c6a23a..21bd4d39 100644
--- a/libcrystfel/src/geometry.h
+++ b/libcrystfel/src/geometry.h
@@ -83,6 +83,9 @@ enum gparam {
GPARAM_ANG1, /* Out of plane rotation angles of crystal */
GPARAM_ANG2,
GPARAM_WAVELENGTH,
+ GPARAM_ROTX, /* Detector panel rotation about +x */
+ GPARAM_ROTY, /* Detector panel rotation about +y */
+ GPARAM_ROTZ, /* Detector panel rotation about +z */
GPARAM_EOL /* End of list */
};