diff options
author | Thomas White <taw@physics.org> | 2018-02-09 15:22:27 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-02-27 17:12:42 +0100 |
commit | 4f600e631539eb1c7f6320e240ab2090842003f0 (patch) | |
tree | 70ca795608dbcbc529e34b6a29186c4ad3118556 /src | |
parent | c5d4c58476ded238d8defb1146263f9fab3f969e (diff) |
write_gridscan(): Handle cycle=-1
Diffstat (limited to 'src')
-rw-r--r-- | src/post-refinement.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c index aaaa46fd..d21a7d0e 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -568,6 +568,7 @@ static void write_gridscan(int serial, Crystal *cr, int cycle, { FILE *fh; char fn[64]; + char ins[5]; const enum gparam par1 = GPARAM_ANG1; const enum gparam par2 = GPARAM_WAVELENGTH; gsl_vector *initial_vals; @@ -576,7 +577,14 @@ static void write_gridscan(int serial, Crystal *cr, int cycle, if ( initial_vals == NULL ) return; gsl_vector_memcpy(initial_vals, min->x); - snprintf(fn, 63, "pr-logs/grid-crystal%i-cycle%i.dat", serial, cycle); + if ( cycle >= 0 ) { + snprintf(ins, 4, "%i", cycle); + } else { + ins[0] = 'F'; + ins[1] = '\0'; + } + + snprintf(fn, 63, "pr-logs/grid-crystal%i-cycle%s.dat", serial, ins); fh = fopen(fn, "w"); if ( fh != NULL ) { double v1, v2; |