aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-10-05 17:42:15 +0200
committerThomas White <taw@physics.org>2012-10-05 17:42:15 +0200
commitb36b1aeb7356c18fc9de1441fa225953856fe7c4 (patch)
tree6946760917ff823244e06f8aa235ff13fc7d8c40 /src
parent783d96028697582c9a0a1e32d4704ddcc4c255e7 (diff)
compare_hkl: Add --shell-file, update documentation
Diffstat (limited to 'src')
-rw-r--r--src/compare_hkl.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/compare_hkl.c b/src/compare_hkl.c
index e25b4746..c6f46be4 100644
--- a/src/compare_hkl.c
+++ b/src/compare_hkl.c
@@ -86,6 +86,7 @@ static void show_help(const char *s)
" CCF, CCI, CCFstar, CCIstar.\n"
" --nshells=<n> Use <n> resolution shells.\n"
" -u Force scale factor to 1.\n"
+" --shell-file=<file> Write resolution shells to <file>.\n"
"\n"
"You can control which reflections are included in the calculation:\n"
"\n"
@@ -316,7 +317,7 @@ static double fom_shell(struct fom_context *fctx, int i)
static void do_fom(RefList *list1, RefList *list2, UnitCell *cell,
double rmin, double rmax, enum fom fom,
- int config_unity, int nshells)
+ int config_unity, int nshells, const char *filename)
{
int *cts;
double *rmins;
@@ -436,9 +437,9 @@ static void do_fom(RefList *list1, RefList *list2, UnitCell *cell,
}
- fh = fopen("shells.dat", "w");
+ fh = fopen(filename, "w");
if ( fh == NULL ) {
- ERROR("Couldn't open 'shells.dat'\n");
+ ERROR("Couldn't open '%s'\n", filename);
return;
}
@@ -530,6 +531,7 @@ int main(int argc, char *argv[])
int config_zeronegs = 0;
int config_unity = 0;
int nshells = 10;
+ char *shell_file = NULL;
/* Long options */
const struct option longopts[] = {
@@ -541,6 +543,7 @@ int main(int argc, char *argv[])
{"fom", 1, NULL, 4},
{"sigma-cutoff", 1, NULL, 5},
{"nshells", 1, NULL, 6},
+ {"shell-file", 1, NULL, 7},
{"ignore-negs", 0, &config_ignorenegs, 1},
{"zero-negs", 0, &config_zeronegs, 1},
{0, 0, NULL, 0}
@@ -604,6 +607,10 @@ int main(int argc, char *argv[])
}
break;
+ case 7 :
+ shell_file = strdup(optarg);
+ break;
+
default :
ERROR("Unhandled option '%c'\n", c);
break;
@@ -652,6 +659,8 @@ int main(int argc, char *argv[])
exit(1);
}
+ if ( shell_file == NULL ) shell_file = strdup("shells.dat");
+
cell = load_cell_from_pdb(pdb);
free(pdb);
@@ -812,8 +821,9 @@ int main(int argc, char *argv[])
reflist_free(list2);
do_fom(list1_acc, list2_acc, cell, rmin, rmax, fom, config_unity,
- nshells);
+ nshells, shell_file);
+ free(shell_file);
reflist_free(list1_acc);
reflist_free(list2_acc);