aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2014-03-10 10:40:49 +0100
committerThomas White <taw@bitwiz.org.uk>2014-03-10 10:40:49 +0100
commit18f3a3a08794c933ed422a51580cf39e3c324cf7 (patch)
treed3b6b2051f5f94d979effde6214c7cecaace604c
parentf9f8eac82c1b5a947965626fa3d471e4a1f33988 (diff)
ncorr limit and default
-rw-r--r--src/ambigator.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ambigator.c b/src/ambigator.c
index 4387d252..42838b41 100644
--- a/src/ambigator.c
+++ b/src/ambigator.c
@@ -633,7 +633,8 @@ int main(int argc, char *argv[])
double rmax = INFINITY; /* m^-1 */
FILE *fgfh = NULL;
struct cc_list *ccs;
- int ncorr = 1000;
+ int ncorr;
+ int ncorr_set = 0;
int stop_after = 0;
float mean_nac;
int n_threads = 1;
@@ -717,6 +718,8 @@ int main(int argc, char *argv[])
if ( sscanf(optarg, "%i", &ncorr) != 1 ) {
ERROR("Invalid value for --ncorr\n");
return 1;
+ } else {
+ ncorr_set = 1;
}
break;
@@ -870,6 +873,10 @@ int main(int argc, char *argv[])
}
}
+ if ( !ncorr_set || (ncorr > n_crystals) ) {
+ ncorr = n_crystals;
+ }
+
ccs = calc_ccs(crystals, n_crystals, ncorr, amb, rng, &mean_nac,
n_threads);
if ( ccs == NULL ) {