diff options
author | Thomas White <taw@physics.org> | 2015-07-17 15:19:38 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2015-07-17 15:27:05 +0200 |
commit | 93a708ef17d6bc314a343e837ce41ac4739cfc51 (patch) | |
tree | 823c7e2edc2a9983cd50a4e08172e8d99b14c87b | |
parent | 6080da714069610e2c5ef53d374f97b1cd29f1bb (diff) |
partialator: Add --no-pr
-rw-r--r-- | doc/man/partialator.1 | 11 | ||||
-rw-r--r-- | src/partialator.c | 7 | ||||
-rw-r--r-- | src/post-refinement.c | 17 | ||||
-rw-r--r-- | src/post-refinement.h | 2 |
4 files changed, 26 insertions, 11 deletions
diff --git a/doc/man/partialator.1 b/doc/man/partialator.1 index 5c3c24bb..272c97a9 100644 --- a/doc/man/partialator.1 +++ b/doc/man/partialator.1 @@ -62,7 +62,12 @@ Run \fIn\fR cycles of scaling and post refinement. .PD 0 .IP \fB--no-scale\fR .PD -Fix all the overall scaling factors to be unity. +Disable the scaling part of the refinement calculation. + +.PD 0 +.IP \fB--no-pr\fR +.PD +Disable the orientation/physics model part of the refinement calculation. .PD 0 .IP "\fB-m\fR \fImodel\fR" @@ -149,6 +154,10 @@ partialator -i \fImy.stream \fR-o \fImy.hkl\fR -y \fImypointgroup \fB--model=uni .PD partialator -i \fImy.stream \fR-o \fImy.hkl\fR -y \fImypointgroup \fB--model=scsphere --iterations=0\fR +.IP "Merging with partialities, with scaling but without post-refinement:" +.PD +partialator -i \fImy.stream \fR-o \fImy.hkl\fR -y \fImypointgroup \fB--model=scsphere --iterations=1 --no-pr\fR + .IP "Merging with partialities, post-refinement and scaling:" .PD partialator -i \fImy.stream \fR-o \fImy.hkl\fR -y \fImypointgroup \fB--model=scsphere --iterations=1\fR diff --git a/src/partialator.c b/src/partialator.c index 4398c9f8..2ad20094 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -74,7 +74,8 @@ static void show_help(const char *s) " --start-after=<n> Skip <n> crystals at the start of the stream.\n" " --stop-after=<n> Stop after merging <n> crystals.\n" " -n, --iterations=<n> Run <n> cycles of scaling and post-refinement.\n" -" --no-scale Fix all the scaling factors at unity.\n" +" --no-scale Disable scale factor (G, B) refinement.\n" +" --no-pr Disable orientation/physics refinement.\n" " -m, --model=<model> Specify partiality model.\n" " --min-measurements=<n> Minimum number of measurements to require.\n" " --no-polarisation Disable polarisation correction.\n" @@ -370,6 +371,7 @@ int main(int argc, char *argv[]) int n_crystals_seen = 0; char cmdline[1024]; int no_scale = 0; + int no_pr = 0; Stream *st; Crystal **crystals; char *pmodel_str = NULL; @@ -405,6 +407,7 @@ int main(int argc, char *argv[]) {"res-push", 1, NULL, 5}, /* compat */ {"no-scale", 0, &no_scale, 1}, + {"no-pr", 0, &no_pr, 1}, {"no-polarisation", 0, &polarisation, 0}, {"no-polarization", 0, &polarisation, 0}, {"polarisation", 0, &polarisation, 1}, /* compat */ @@ -726,7 +729,7 @@ int main(int argc, char *argv[]) /* Refine all crystals to get the best fit */ refine_all(crystals, n_crystals, full, nthreads, pmodel, - no_scale, &init_dev, &init_free_dev, + no_scale, no_pr, &init_dev, &init_free_dev, &final_dev, &final_free_dev); STATUS("Overall residual: initial = %e, final = %e\n", diff --git a/src/post-refinement.c b/src/post-refinement.c index 9484da43..d62d9323 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -326,8 +326,8 @@ static void apply_shift(Crystal *cr, int k, double shift) /* Perform one cycle of post refinement on 'image' against 'full' */ static double pr_iterate(Crystal *cr, const RefList *full, - PartialityModel pmodel, int no_scale, int *n_filtered, - int verbose) + PartialityModel pmodel, int no_scale, int no_pr, + int *n_filtered, int verbose) { gsl_matrix *M; gsl_vector *v; @@ -346,7 +346,7 @@ static double pr_iterate(Crystal *cr, const RefList *full, /* If partiality model is anything other than "unity", refine all the * geometrical parameters */ - if ( pmodel != PMODEL_UNITY ) { + if ( (pmodel != PMODEL_UNITY) && !no_pr ) { rv[num_params++] = GPARAM_ASX; rv[num_params++] = GPARAM_ASY; rv[num_params++] = GPARAM_ASZ; @@ -547,7 +547,7 @@ static double residual(Crystal *cr, const RefList *full, int verbose, int free) static struct prdata pr_refine(Crystal *cr, const RefList *full, - PartialityModel pmodel, int no_scale) + PartialityModel pmodel, int no_scale, int no_pr) { int i; int verbose = 0; @@ -584,7 +584,8 @@ static struct prdata pr_refine(Crystal *cr, const RefList *full, cell_get_reciprocal(crystal_get_cell(cr), &asx, &asy, &asz, &bsx, &bsy, &bsz, &csx, &csy, &csz); - pr_iterate(cr, full, pmodel, no_scale, &prdata.n_filtered, 0); + pr_iterate(cr, full, pmodel, no_scale, no_pr, + &prdata.n_filtered, verbose); update_partialities(cr, pmodel); @@ -622,6 +623,7 @@ struct refine_args Crystal *crystal; PartialityModel pmodel; int no_scale; + int no_pr; struct prdata prdata; }; @@ -646,7 +648,7 @@ static void refine_image(void *task, int id) Crystal *cr = pargs->crystal; pargs->prdata = pr_refine(cr, pargs->full, pargs->pmodel, - pargs->no_scale); + pargs->no_scale, pargs->no_pr); } @@ -684,7 +686,7 @@ static void done_image(void *vqargs, void *task) void refine_all(Crystal **crystals, int n_crystals, RefList *full, int nthreads, PartialityModel pmodel, - int no_scale, + int no_scale, int no_pr, double *initial_residual, double *initial_free_residual, double *final_residual, double *final_free_residual) { @@ -697,6 +699,7 @@ void refine_all(Crystal **crystals, int n_crystals, task_defaults.prdata.refined = 0; task_defaults.prdata.n_filtered = 0; task_defaults.no_scale = no_scale; + task_defaults.no_pr = no_pr; qargs.task_defaults = task_defaults; qargs.n_started = 0; diff --git a/src/post-refinement.h b/src/post-refinement.h index a0d27591..b59ae24f 100644 --- a/src/post-refinement.h +++ b/src/post-refinement.h @@ -57,7 +57,7 @@ struct prdata extern void refine_all(Crystal **crystals, int n_crystals, RefList *full, int nthreads, PartialityModel pmodel, - int no_scale, + int no_scale, int no_pr, double *initial_residual, double *initial_free_residual, double *final_residual, double *final_free_residual); |