aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-04 19:04:49 +0100
committerThomas White <taw@physics.org>2010-03-04 19:04:49 +0100
commitd8358c2158154ed14af37edb46b44f6c7b9feebb (patch)
tree992e044cbb4a4c8ce86bc5df88f72b7d96283686
parent27491c092a9d238bf25a10b23e4588a92af071ba (diff)
process_hkl: don't write output in results/, improve error message, output ZA with --no-analyse --zone-axis
-rw-r--r--src/process_hkl.c12
-rw-r--r--src/reflections.c3
2 files changed, 12 insertions, 3 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c
index abb4422f..d110695b 100644
--- a/src/process_hkl.c
+++ b/src/process_hkl.c
@@ -161,13 +161,13 @@ static void process_reflections(double *ref, double *trueref,
if ( do_rvsq ) {
/* Record graph of R against q for this N */
char name[64];
- snprintf(name, 63, "results/R_vs_q-%u.dat", n_patterns);
+ snprintf(name, 63, "R_vs_q-%u.dat", n_patterns);
write_RvsQ(name, ref, trueref, counts, scale, cell);
}
if ( do_zoneaxis ) {
char name[64];
- snprintf(name, 63, "results/ZA-%u.dat", n_patterns);
+ snprintf(name, 63, "ZA-%u.dat", n_patterns);
write_reflections(name, counts, ref, 1, cell);
}
@@ -342,6 +342,14 @@ int main(int argc, char *argv[])
write_reflections(output, counts, ref, 0, cell);
}
+ if ( config_zoneaxis ) {
+ char name[64];
+ UnitCell *cell = NULL;
+ if ( mol != NULL ) cell = mol->cell;
+ snprintf(name, 63, "ZA-%u.dat", n_patterns);
+ write_reflections(name, counts, ref, 1, cell);
+ }
+
STATUS("There were %u patterns.\n", n_patterns);
return 0;
diff --git a/src/reflections.c b/src/reflections.c
index 93cecca9..6c26150d 100644
--- a/src/reflections.c
+++ b/src/reflections.c
@@ -34,7 +34,7 @@ void write_reflections(const char *filename, unsigned int *counts,
}
if ( fh == NULL ) {
- ERROR("Couldn't open output file!\n");
+ ERROR("Couldn't open output file '%s'.\n", filename);
return;
}
@@ -45,6 +45,7 @@ void write_reflections(const char *filename, unsigned int *counts,
fprintf(fh, "a %5.3f nm\n", a*1e9);
fprintf(fh, "b %5.3f nm\n", b*1e9);
fprintf(fh, "angle %5.3f deg\n", rad2deg(gamma));
+ fprintf(fh, "scale 10\n");
}
for ( h=-INDMAX; h<INDMAX; h++ ) {