diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-12-07 18:44:06 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-12-07 18:44:06 +0000 |
commit | 9d689af8e563441560fa0b7bde3a8c2d2093fb15 (patch) | |
tree | 75e7c36f1b2a77e7cabb85d1fc247b54728f6f14 /src/intensities.c | |
parent | acdeee2c5432855cb959c2c2f21d141cd9f4dfb7 (diff) |
Save lattice parameters with reflection data
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@228 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/intensities.c')
-rw-r--r-- | src/intensities.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/intensities.c b/src/intensities.c index 8c02592..d5f345d 100644 --- a/src/intensities.c +++ b/src/intensities.c @@ -18,6 +18,8 @@ #include "image.h" #include "reproject.h" #include "displaywindow.h" +#include "utils.h" +#include "basis.h" /* Extract integrated reflection intensities by estimating the spike function * based on the observed intensity and the calculated excitation error from @@ -108,12 +110,23 @@ void intensities_extract(ControlContext *ctx) { } -static int intensities_do_save(ReflectionList *integrated, const char *filename) { +static int intensities_do_save(ReflectionList *integrated, Basis *cell, const char *filename) { FILE *fh; Reflection *reflection; + UnitCell rcell; fh = fopen(filename, "w"); + + rcell = basis_get_cell(cell); + fprintf(fh, "a %12.8f\n", rcell.a*1e9); + fprintf(fh, "b %12.8f\n", rcell.b*1e9); + fprintf(fh, "c %12.8f\n", rcell.c*1e9); + fprintf(fh, "alpha %12.8f\n", rad2deg(rcell.alpha)); + fprintf(fh, "beta %12.8f\n", rad2deg(rcell.beta)); + fprintf(fh, "gamma %12.8f\n", rad2deg(rcell.gamma)); + + reflection = integrated->reflections; while ( reflection ) { fprintf(fh, "%3i %3i %3i %12.8f\n", reflection->h, reflection->k, reflection->l, reflection->intensity); @@ -130,7 +143,7 @@ static gint intensities_save_response(GtkWidget *widget, gint response, ControlC if ( response == GTK_RESPONSE_ACCEPT ) { char *filename; filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget)); - if ( intensities_do_save(ctx->integrated, filename) ) { + if ( intensities_do_save(ctx->integrated, ctx->cell, filename) ) { displaywindow_error("Failed to save cache file.", ctx->dw); } g_free(filename); |