From da13e5c05e0762860df003812991c43225d7d379 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 15 Aug 2019 16:35:50 +0200 Subject: Add cell_get_G6() and corresponding structure --- libcrystfel/src/cell.c | 15 +++++++++++++++ libcrystfel/src/cell.h | 12 ++++++++++++ 2 files changed, 27 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c index 6b1d58c7..e785c1c8 100644 --- a/libcrystfel/src/cell.c +++ b/libcrystfel/src/cell.c @@ -579,6 +579,21 @@ LatticeType cell_get_lattice_type(UnitCell *cell) } +struct g6 cell_get_G6(UnitCell *cell) +{ + double a, b, c, al, be, ga; + struct g6 g; + cell_get_parameters(cell, &a, &b, &c, &al, &be, &ga); + g.A = a*a; + g.B = b*b; + g.C = c*c; + g.D = 2.0*b*c*cos(al); + g.E = 2.0*a*c*cos(be); + g.F = 2.0*a*b*cos(ga); + return g; +} + + char cell_get_unique_axis(UnitCell *cell) { return cell->unique_axis; diff --git a/libcrystfel/src/cell.h b/libcrystfel/src/cell.h index 4bbc1be2..e12fc209 100644 --- a/libcrystfel/src/cell.h +++ b/libcrystfel/src/cell.h @@ -132,6 +132,18 @@ extern void cell_set_reciprocal(UnitCell *cell, extern LatticeType cell_get_lattice_type(UnitCell *cell); extern void cell_set_lattice_type(UnitCell *cell, LatticeType lattice_type); +struct g6 +{ + double A; + double B; + double C; + double D; + double E; + double F; +}; + +extern struct g6 cell_get_G6(UnitCell *cell); + extern char cell_get_centering(UnitCell *cell); extern void cell_set_centering(UnitCell *cell, char centering); -- cgit v1.2.3