diff options
author | Thomas White <taw@physics.org> | 2013-11-22 21:46:05 -0800 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2013-11-23 02:52:52 -0800 |
commit | 130b1bd699079e6418f6f8d44fca191cfd102f70 (patch) | |
tree | 0ea36c62c1e4f0f43c14779a20cac708d68099db /src/indexamajig.c | |
parent | d1348f0f31f57bcf35d096f32a7d8325fe43195f (diff) |
indexamajig: Add --int-diag
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r-- | src/indexamajig.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c index 7d3747ba..823ebb79 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -144,6 +144,7 @@ static void show_help(const char *s) " validity.\n" " --no-peaks-in-stream Do not record peak search results in the stream.\n" " --no-refls-in-stream Do not record integrated reflections in the stream.\n" +" --int-diag=<r> Show debugging information about this reflection.\n" ); } @@ -173,6 +174,7 @@ int main(int argc, char *argv[]) char *intrad = NULL; char *int_str = NULL; char *tempdir = NULL; + char *int_diag = NULL; /* Defaults */ iargs.cell = NULL; @@ -201,6 +203,7 @@ int main(int argc, char *argv[]) iargs.no_revalidate = 0; iargs.stream_peaks = 1; iargs.stream_refls = 1; + iargs.int_diag = INTDIAG_NONE; iargs.copyme = new_copy_hdf5_field_list(); if ( iargs.copyme == NULL ) { ERROR("Couldn't allocate HDF5 field list.\n"); @@ -256,6 +259,7 @@ int main(int argc, char *argv[]) {"median-filter", 1, NULL, 15}, {"integration", 1, NULL, 16}, {"temp-dir", 1, NULL, 17}, + {"int-diag", 1, NULL, 18}, {0, 0, NULL, 0} }; @@ -384,6 +388,10 @@ int main(int argc, char *argv[]) tempdir = strdup(optarg); break; + case 18 : + int_diag = strdup(optarg); + break; + case 0 : break; @@ -527,6 +535,36 @@ int main(int argc, char *argv[]) iargs.cell = NULL; } + if ( int_diag != NULL ) { + + int r; + signed int h, k, l; + + if ( strcmp(int_diag, "random") == 0 ) { + iargs.int_diag = INTDIAG_RANDOM; + } + + if ( strcmp(int_diag, "all") == 0 ) { + iargs.int_diag = INTDIAG_ALL; + } + + r = sscanf(int_diag, "%i,%i,%i", &h, &k, &l); + if ( r == 3 ) { + iargs.int_diag = INTDIAG_INDICES; + iargs.int_diag_h = h; + iargs.int_diag_k = k; + iargs.int_diag_l = l; + } + + if ( iargs.int_diag == INTDIAG_NONE ) { + ERROR("Invalid value for --int-diag.\n"); + return 1; + } + + free(int_diag); + + } + ofd = open(outfile, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if ( ofd == -1 ) { ERROR("Failed to open stream '%s'\n", outfile); |