From eaff24431149de7708b524e857b3c0807cb17c96 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 20 Feb 2019 17:06:53 +0100 Subject: Simplify the output of cell_print() --- libcrystfel/src/cell-utils.c | 26 +++++++++++++++++++------- libcrystfel/src/cell-utils.h | 1 + 2 files changed, 20 insertions(+), 7 deletions(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c index 3d63249d..39e893cf 100644 --- a/libcrystfel/src/cell-utils.c +++ b/libcrystfel/src/cell-utils.c @@ -219,11 +219,6 @@ int right_handed(UnitCell *cell) void cell_print(UnitCell *cell) { - double asx, asy, asz; - double bsx, bsy, bsz; - double csx, csy, csz; - double a, b, c, alpha, beta, gamma; - double ax, ay, az, bx, by, bz, cx, cy, cz; LatticeType lt; char cen; @@ -251,12 +246,31 @@ void cell_print(UnitCell *cell) } if ( cell_has_parameters(cell) ) { + + double a, b, c, alpha, beta, gamma; cell_get_parameters(cell, &a, &b, &c, &alpha, &beta, &gamma); STATUS("a b c alpha beta gamma\n"); STATUS("%6.2f %6.2f %6.2f A %6.2f %6.2f %6.2f deg\n", a*1e10, b*1e10, c*1e10, rad2deg(alpha), rad2deg(beta), rad2deg(gamma)); + } else { + STATUS("Unit cell parameters are not specified.\n"); + } +} + + +void cell_print_full(UnitCell *cell) +{ + + cell_print(cell); + + if ( cell_has_parameters(cell) ) { + + double asx, asy, asz; + double bsx, bsy, bsz; + double csx, csy, csz; + double ax, ay, az, bx, by, bz, cx, cy, cz; cell_get_cartesian(cell, &ax, &ay, &az, &bx, &by, &bz, &cx, &cy, &cz); @@ -283,8 +297,6 @@ void cell_print(UnitCell *cell) STATUS("Cell representation is %s.\n", cell_rep(cell)); - } else { - STATUS("Unit cell parameters are not specified.\n"); } } diff --git a/libcrystfel/src/cell-utils.h b/libcrystfel/src/cell-utils.h index cf736e4a..47145481 100644 --- a/libcrystfel/src/cell-utils.h +++ b/libcrystfel/src/cell-utils.h @@ -52,6 +52,7 @@ extern UnitCell *rotate_cell(UnitCell *in, double omega, double phi, extern UnitCell *transform_cell_gsl(UnitCell *in, gsl_matrix *m); extern void cell_print(UnitCell *cell); +extern void cell_print_full(UnitCell *cell); extern UnitCell *match_cell(UnitCell *cell, UnitCell *tempcell, int verbose, const float *ltl, int reduce); -- cgit v1.2.3