diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-06-05 21:58:44 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2010-06-05 21:58:44 +0200 |
commit | 997b02dbf9b458a7831a3b74bb21265f3b82996a (patch) | |
tree | 6b572c2db77796308ad915c57043e77889bb5510 | |
parent | f5eb7d1566c583a73fd9d44b7f119309e68de10a (diff) |
pattern_sim: Specify filename for powder pattern on the command line
-rw-r--r-- | src/pattern_sim.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c index 227bbc85..65999718 100644 --- a/src/pattern_sim.c +++ b/src/pattern_sim.c @@ -59,8 +59,8 @@ static void show_help(const char *s) " files produced are sim-1.h5, sim-2.h5 and so on.\n" " -r, --random-orientation Use a randomly generated orientation\n" " (a new orientation will be used for each image).\n" -" --powder Write a summed pattern of all images simulated by\n" -" this invocation to results/integr.h5.\n" +" --powder=<file> Write a summed pattern of all images simulated by\n" +" this invocation as the given filename.\n" " -i, --intensities=<file> Specify file containing reflection intensities\n" " (and phases) to use.\n" " -g, --gradients=<method> Use <method> for the calculation of shape\n" @@ -183,7 +183,7 @@ int main(int argc, char *argv[]) int config_nonoise = 0; int config_nosfac = 0; int config_gpu = 0; - int config_powder = 0; + char *powder_fn = NULL; char *filename = NULL; char *grad_str = NULL; char *outfile = NULL; @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) {"no-water", 0, &config_nowater, 1}, {"no-noise", 0, &config_nonoise, 1}, {"intensities", 1, NULL, 'i'}, - {"powder", 0, &config_powder, 1}, + {"powder", 1, NULL, 'w'}, {"gradients", 1, NULL, 'g'}, {"pdb", 1, NULL, 'p'}, {"output", 1, NULL, 'o'}, @@ -253,6 +253,11 @@ int main(int argc, char *argv[]) break; } + case 'w' : { + powder_fn = strdup(optarg); + break; + } + case 0 : { break; } @@ -403,7 +408,7 @@ int main(int argc, char *argv[]) output_intensities(&image, cell, NULL, 1); } - if ( config_powder ) { + if ( powder_fn != NULL ) { int x, y, w; @@ -416,7 +421,7 @@ int main(int argc, char *argv[]) } if ( !(ndone % 10) ) { - hdf5_write("results/integr.h5", powder, + hdf5_write(powder_fn, powder, image.width, image.height, H5T_NATIVE_DOUBLE); } |