diff options
author | Thomas White <taw@physics.org> | 2013-04-30 18:01:07 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2013-04-30 18:01:07 +0200 |
commit | 6b18fa18fbdc1f272e65f81d04b22d973acafa1e (patch) | |
tree | 1e3821e7ebaad0e5da2b86b86e83ef515ff265e1 /src/partialator.c | |
parent | d2675aac557f43909fde3070ca5ee068ff614fc3 (diff) |
partialator: Add --min-measurements
Diffstat (limited to 'src/partialator.c')
-rw-r--r-- | src/partialator.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/partialator.c b/src/partialator.c index 58025b96..cfa3a6ba 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -80,6 +80,8 @@ static void show_help(const char *s) " instead of taking the mean of the intensity\n" " estimates.\n" " -m, --model=<model> Specify partiality model.\n" +" --min-measurements=<n> Require at least <n> measurements before a\n" +" reflection appears in the output. Default: 2\n" "\n" " -j <n> Run <n> analyses in parallel.\n"); } @@ -323,6 +325,8 @@ int main(int argc, char *argv[]) Crystal **crystals; char *pmodel_str = NULL; PartialityModel pmodel = PMODEL_SPHERE; + int min_measurements = 2; + char *rval; /* Long options */ const struct option longopts[] = { @@ -336,6 +340,7 @@ int main(int argc, char *argv[]) {"no-scale", 0, &noscale, 1}, {"reference", 1, NULL, 'r'}, {"model", 1, NULL, 'm'}, + {"min-measurements", 1, NULL, 2}, {0, 0, NULL, 0} }; @@ -398,6 +403,15 @@ int main(int argc, char *argv[]) reference_file = strdup(optarg); break; + case 2 : + errno = 0; + min_measurements = strtod(optarg, &rval); + if ( *rval != '\0' ) { + ERROR("Invalid value for --min-measurements.\n"); + return 1; + } + break; + case 0 : break; @@ -583,7 +597,7 @@ int main(int argc, char *argv[]) STATUS("Performing initial scaling.\n"); if ( noscale ) STATUS("Scale factors fixed at 1.\n"); full = scale_intensities(crystals, n_crystals, reference, - nthreads, noscale, pmodel); + nthreads, noscale, pmodel, min_measurements); sr = sr_titlepage(crystals, n_crystals, "scaling-report.pdf", infile, cmdline); @@ -621,7 +635,8 @@ int main(int argc, char *argv[]) /* Re-estimate all the full intensities */ reflist_free(full); full = scale_intensities(crystals, n_crystals, - reference, nthreads, noscale, pmodel); + reference, nthreads, noscale, pmodel, + min_measurements); sr_iteration(sr, i+1, crystals, n_crystals, full); |