aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-12-22 23:30:27 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-12-22 23:30:27 +0000
commitf68aaadb2c8b142432ccc7f57b60d250b2501417 (patch)
tree97c2a58f194ec0bd9f0e5a8927887e26732dfac9
parentb216f03366586b22d9a4bee0731620b0f2b33e2e (diff)
Improve debug output
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@239 bf6ca9ba-c028-0410-8290-897cf20841d1
-rw-r--r--src/basis.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/basis.c b/src/basis.c
index 090ea15..6e7aed8 100644
--- a/src/basis.c
+++ b/src/basis.c
@@ -20,6 +20,7 @@
#include "reflections.h"
#include "basis.h"
+#include "utils.h"
double basis_efom(ReflectionList *reflectionlist, Basis *basis) {
@@ -85,16 +86,16 @@ Basis basis_add(Basis u, Basis v) {
static void basis_print(Basis *cell) {
- printf("%12.8f %12.8f %12.8f\n", cell->a.x, cell->a.y, cell->a.z);
- printf("%12.8f %12.8f %12.8f\n", cell->b.x, cell->b.y, cell->b.z);
- printf("%12.8f %12.8f %12.8f\n", cell->c.x, cell->c.y, cell->c.z);
+ printf("%12.8f %12.8f %12.8f\n", cell->a.x/1e9, cell->a.y/1e9, cell->a.z/1e9);
+ printf("%12.8f %12.8f %12.8f\n", cell->b.x/1e9, cell->b.y/1e9, cell->b.z/1e9);
+ printf("%12.8f %12.8f %12.8f\n", cell->c.x/1e9, cell->c.y/1e9, cell->c.z/1e9);
}
static void cell_print(UnitCell *cell) {
- printf("%12.8f %12.8f %12.8f\n", cell->a, cell->b, cell->c);
- printf("%12.8f %12.8f %12.8f\n", cell->alpha, cell->beta, cell->gamma);
+ printf("%12.8f %12.8f %12.8f nm\n", cell->a*1e9, cell->b*1e9, cell->c*1e9);
+ printf("%12.8f %12.8f %12.8f deg\n", rad2deg(cell->alpha), rad2deg(cell->beta), rad2deg(cell->gamma));
}
@@ -110,7 +111,7 @@ UnitCell basis_get_cell(Basis *basis) {
// basis->a.x = 0.5; basis->a.y = 0.0; basis->a.z = 0.0;
// basis->b.x = 0.0; basis->b.y = 0.2; basis->b.z = 0.0;
// basis->c.x = 0.0; basis->c.y = 0.0; basis->c.z = 1.0;
- printf("Reciprocal-space cell:\n");
+ printf("Reciprocal-space cell (nm^-1):\n");
basis_print(basis);
m = gsl_matrix_alloc(3, 3);
@@ -131,11 +132,11 @@ UnitCell basis_get_cell(Basis *basis) {
ay = gsl_matrix_get(inv, 1, 0); by = gsl_matrix_get(inv, 1, 1); cy = gsl_matrix_get(inv, 1, 2);
az = gsl_matrix_get(inv, 2, 0); bz = gsl_matrix_get(inv, 2, 1); cz = gsl_matrix_get(inv, 2, 2);
- printf("Real-space cell:\n");
- printf("%12.8f %12.8f %12.8f\n", ax, ay, az);
- printf("%12.8f %12.8f %12.8f\n", bx, by, bz);
- printf("%12.8f %12.8f %12.8f\n", cx, cy, cz);
-
+ printf("Real-space cell (nm):\n");
+ printf("%12.8f %12.8f %12.8f\n", ax*1e9, ay*1e9, az*1e9);
+ printf("%12.8f %12.8f %12.8f\n", bx*1e9, by*1e9, bz*1e9);
+ printf("%12.8f %12.8f %12.8f\n", cx*1e9, cy*1e9, cz*1e9);
+
cell.a = sqrt(ax*ax + ay*ay + az*az);
cell.b = sqrt(bx*bx + by*by + bz*bz);
cell.c = sqrt(cx*cx + cy*cy + cz*cz);