From 86995ac65ed3fd0ec20799a0e5a08a111c72b8a8 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 7 May 2021 17:16:52 +0200 Subject: Add has_unique_axis() --- libcrystfel/src/cell-utils.c | 22 ++++++++++++++++++++++ libcrystfel/src/cell-utils.h | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c index b2708fb2..31ba9d35 100644 --- a/libcrystfel/src/cell-utils.c +++ b/libcrystfel/src/cell-utils.c @@ -116,6 +116,28 @@ LatticeType lattice_from_str(const char *s) } +int has_unique_axis(LatticeType l) +{ + switch ( l ) + { + case L_MONOCLINIC : + case L_HEXAGONAL : + case L_TETRAGONAL : + return 1; + + case L_TRICLINIC : + case L_ORTHORHOMBIC : + case L_RHOMBOHEDRAL : + case L_CUBIC : + return 0; + + default: + ERROR("Unrecognised lattice type %i\n", l); + return 1; + } +} + + static int check_centering(char cen) { switch ( cen ) { diff --git a/libcrystfel/src/cell-utils.h b/libcrystfel/src/cell-utils.h index 8eefe800..b473a4c5 100644 --- a/libcrystfel/src/cell-utils.h +++ b/libcrystfel/src/cell-utils.h @@ -68,7 +68,7 @@ extern UnitCell *uncenter_cell(UnitCell *in, IntegerMatrix **pC, RationalMatrix **pCi); extern int bravais_lattice(UnitCell *cell); - +extern int has_unique_axis(LatticeType l); extern int right_handed(UnitCell *cell); extern const char *str_lattice(LatticeType l); -- cgit v1.2.3