diff options
author | Thomas White <taw@physics.org> | 2013-04-18 18:11:48 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2013-04-18 18:11:48 +0200 |
commit | 7df069a4b8f8ae1431d46a166e9d81d2ce68b213 (patch) | |
tree | 2efb61b7edb96babec82e78148cfb78bace94ecd /libcrystfel/src/cell-utils.c | |
parent | 7cdb05aa7f3b7df0f31cbd79a4799c5e60ec3d3f (diff) |
Read/write lattice type, centering and unique axis information from/to stream
Diffstat (limited to 'libcrystfel/src/cell-utils.c')
-rw-r--r-- | libcrystfel/src/cell-utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c index b1604815..8b881178 100644 --- a/libcrystfel/src/cell-utils.c +++ b/libcrystfel/src/cell-utils.c @@ -113,6 +113,21 @@ const char *str_lattice(LatticeType l) } +LatticeType lattice_from_str(const char *s) +{ + if ( strcmp(s, "triclinic") == 0 ) return L_TRICLINIC; + if ( strcmp(s, "monoclinic") == 0 ) return L_MONOCLINIC; + if ( strcmp(s, "orthorhombic") == 0 ) return L_ORTHORHOMBIC; + if ( strcmp(s, "tetragonal") == 0 ) return L_TETRAGONAL; + if ( strcmp(s, "rhombohedral") == 0 ) return L_RHOMBOHEDRAL; + if ( strcmp(s, "hexagonal") == 0 ) return L_HEXAGONAL; + if ( strcmp(s, "cubic") == 0 ) return L_CUBIC; + + ERROR("Unrecognised lattice type '%s'\n", s); + return L_TRICLINIC; +} + + int right_handed(UnitCell *cell) { double asx, asy, asz; |