diff options
author | Thomas White <taw@physics.org> | 2021-05-07 17:16:52 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-05-07 17:16:52 +0200 |
commit | 86995ac65ed3fd0ec20799a0e5a08a111c72b8a8 (patch) | |
tree | 4634d12bd87e928114381e5b589143ee9ada6088 /libcrystfel | |
parent | 36f0f48a9203e961fcaf546ded68451589d4dd18 (diff) |
Add has_unique_axis()
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/cell-utils.c | 22 | ||||
-rw-r--r-- | libcrystfel/src/cell-utils.h | 2 |
2 files changed, 23 insertions, 1 deletions
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); |