From bd5d2ec01be4aef4731498424fe777e3cdb797ef Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 26 Feb 2018 17:21:50 +0100 Subject: Add --force-bandwidth and --force-radius --- src/partialator.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'src/partialator.c') diff --git a/src/partialator.c b/src/partialator.c index e9053841..0d5a8a84 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -329,7 +329,9 @@ static void show_help(const char *s) " --max-rel-B Maximum allowable relative |B| factor.\n" " --no-logs Do not write extensive log files.\n" " -w Apparent point group for resolving ambiguities.\n" -" --operator= Indexing ambiguity operator for resolving.\n"); +" --operator= Indexing ambiguity operator for resolving.\n" +" --force-bandwidth= Set all bandwidths to (fraction).\n" +" --force-radius= Set all profile radii to nm^-1.\n"); } @@ -858,6 +860,8 @@ int main(int argc, char *argv[]) int no_logs = 0; char *w_sym_str = NULL; char *operator = NULL; + double force_bandwidth = -1.0; + double force_radius = -1.0; /* Long options */ const struct option longopts[] = { @@ -882,6 +886,8 @@ int main(int argc, char *argv[]) {"max-rel-b", 1, NULL, 7}, /* compat */ {"reference", 1, NULL, 8}, /* ssshhh! */ {"operator", 1, NULL, 9}, + {"force-bandwidth", 1, NULL, 10}, + {"force-radius", 1, NULL, 11}, {"no-scale", 0, &no_scale, 1}, {"no-pr", 0, &no_pr, 1}, @@ -1020,6 +1026,25 @@ int main(int argc, char *argv[]) operator = strdup(optarg); break; + case 10 : + errno = 0; + force_bandwidth = strtod(optarg, &rval); + if ( *rval != '\0' ) { + ERROR("Invalid value for --force-bandwidth.\n"); + return 1; + } + break; + + case 11 : + errno = 0; + force_radius = strtod(optarg, &rval); + if ( *rval != '\0' ) { + ERROR("Invalid value for --force-radius.\n"); + return 1; + } + force_radius *= 1e9; + break; + case 0 : break; @@ -1278,6 +1303,12 @@ int main(int argc, char *argv[]) STATUS("Initial partiality calculation...\n"); for ( i=0; i 0.0 ) { + crystal_get_image(cr)->bw = force_bandwidth; + } + if ( force_radius > 0.0 ) { + crystal_set_profile_radius(cr, force_radius); + } update_predictions(cr); calculate_partialities(cr, pmodel); } -- cgit v1.2.3