aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-02-27 17:06:35 +0100
committerThomas White <taw@physics.org>2018-02-27 17:12:42 +0100
commit3684bb0dc691c5b6d7c3f0590737e417295219ee (patch)
tree39055733362684862c7ab221e66ad0050e80fd45 /src/post-refinement.c
parentcd7a8f580a89dd5ad940a09ea49f10abba675ff4 (diff)
Write spectrum graph at end again
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index e85783fb..939f11b2 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -489,8 +489,8 @@ void try_reindex(Crystal *crin, const RefList *full)
}
-static void write_specgraph(const RefList *full, Crystal *crystal, signed int in,
- const char *suff)
+void write_specgraph(Crystal *crystal, const RefList *full,
+ signed int cycle, int serial)
{
FILE *fh;
char tmp[256];
@@ -502,9 +502,9 @@ static void write_specgraph(const RefList *full, Crystal *crystal, signed int in
struct image *image = crystal_get_image(crystal);
char ins[5];
- snprintf(tmp, 256, "pr-logs/specgraph%s.dat", suff);
+ snprintf(tmp, 256, "pr-logs/specgraph-crystal%i.dat", serial);
- if ( in == 0 ) {
+ if ( cycle == 0 ) {
fh = fopen(tmp, "w");
} else {
fh = fopen(tmp, "a");
@@ -515,7 +515,7 @@ static void write_specgraph(const RefList *full, Crystal *crystal, signed int in
return;
}
- if ( in == 0 ) {
+ if ( cycle == 0 ) {
fprintf(fh, "Image: %s %s\n",
image->filename, get_event_string(image->event));
fprintf(fh, "khalf/m 1/d(m) pcalc pobs iteration\n");
@@ -523,8 +523,8 @@ static void write_specgraph(const RefList *full, Crystal *crystal, signed int in
cell = crystal_get_cell(crystal);
- if ( in >= 0 ) {
- snprintf(ins, 4, "%i", in);
+ if ( cycle >= 0 ) {
+ snprintf(ins, 4, "%i", cycle);
} else {
ins[0] = 'F';
ins[1] = '\0';
@@ -610,8 +610,8 @@ static gsl_multimin_fminimizer *setup_minimiser(Crystal *cr, const RefList *full
}
-static void write_gridscan(Crystal *cr, const RefList *full,
- int cycle, int serial)
+void write_gridscan(Crystal *cr, const RefList *full,
+ signed int cycle, int serial)
{
FILE *fh;
char fn[64];
@@ -713,9 +713,7 @@ static void do_pr_refine(Crystal *cr, const RefList *full,
char fn[64];
write_gridscan(cr, full, cycle, serial);
-
- snprintf(fn, 63, "-crystal%i", serial);
- write_specgraph(full, cr, cycle, fn);
+ write_specgraph(cr, full, cycle, serial);
snprintf(fn, 63, "pr-logs/crystal%i-cycle%i.log", serial, cycle);
fh = fopen(fn, "w");