aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-04-30 18:01:07 +0200
committerThomas White <taw@physics.org>2013-04-30 18:01:07 +0200
commit6b18fa18fbdc1f272e65f81d04b22d973acafa1e (patch)
tree1e3821e7ebaad0e5da2b86b86e83ef515ff265e1 /src
parentd2675aac557f43909fde3070ca5ee068ff614fc3 (diff)
partialator: Add --min-measurements
Diffstat (limited to 'src')
-rw-r--r--src/hrs-scaling.c4
-rw-r--r--src/hrs-scaling.h3
-rw-r--r--src/partialator.c19
3 files changed, 21 insertions, 5 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index 46590f7e..c249ef46 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -493,12 +493,12 @@ static void calculate_esds(Crystal **crystals, int n, RefList *full,
/* Scale the stack of images */
RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
- int n_threads, int noscale, PartialityModel pmodel)
+ int n_threads, int noscale, PartialityModel pmodel,
+ int min_redundancy)
{
int i;
double max_corr;
RefList *full = NULL;
- const int min_redundancy = 2;
for ( i=0; i<n; i++ ) crystal_set_osf(crystals[i], 1.0);
diff --git a/src/hrs-scaling.h b/src/hrs-scaling.h
index 8ae12380..0979bb98 100644
--- a/src/hrs-scaling.h
+++ b/src/hrs-scaling.h
@@ -41,7 +41,8 @@
extern RefList *scale_intensities(Crystal **crystals, int n,
RefList *reference, int n_threads,
- int noscale, PartialityModel pmodel);
+ int noscale, PartialityModel pmodel,
+ int min_redundancy);
#endif /* HRS_SCALING_H */
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);