diff options
author | Thomas White <taw@physics.org> | 2019-08-15 16:35:50 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-08-22 17:03:27 +0200 |
commit | da13e5c05e0762860df003812991c43225d7d379 (patch) | |
tree | 46185d007ac219c13ecf324aec400147450d67ae /libcrystfel | |
parent | e3f4046056cf92ce5e40e5e715cbcd53df7b0621 (diff) |
Add cell_get_G6() and corresponding structure
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/cell.c | 15 | ||||
-rw-r--r-- | libcrystfel/src/cell.h | 12 |
2 files changed, 27 insertions, 0 deletions
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); |