diff options
Diffstat (limited to 'src/ambigator.c')
-rw-r--r-- | src/ambigator.c | 9 |
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 ) { |