aboutsummaryrefslogtreecommitdiff
path: root/src/partialator.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-03-07 10:50:13 +0100
committerThomas White <taw@physics.org>2013-04-17 17:33:48 +0200
commitbc628cd85f512d962828e9b8c5df5a6e6d22fac5 (patch)
tree95d9ac47def582023b54884fab131bbc09a746b9 /src/partialator.c
parent79993f9373e4a7fdcbff8a7d83af4b7289622cf3 (diff)
Add the possibility to have different partiality models
Diffstat (limited to 'src/partialator.c')
-rw-r--r--src/partialator.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/partialator.c b/src/partialator.c
index a4af3c18..079e078e 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -88,6 +88,7 @@ struct refine_args
{
RefList *full;
Crystal *crystal;
+ PartialityModel pmodel;
};
@@ -106,7 +107,7 @@ static void refine_image(void *task, int id)
struct refine_args *pargs = task;
Crystal *cr = pargs->crystal;
- pr_refine(cr, pargs->full);
+ pr_refine(cr, pargs->full, pargs->pmodel);
}
@@ -314,6 +315,8 @@ int main(int argc, char *argv[])
int noscale = 0;
Stream *st;
Crystal **crystals;
+ char *pmodel_str = NULL;
+ PartialityModel pmodel = PMODEL_SPHERE;
/* Long options */
const struct option longopts[] = {
@@ -326,6 +329,7 @@ int main(int argc, char *argv[])
{"iterations", 1, NULL, 'n'},
{"no-scale", 0, &noscale, 1},
{"reference", 1, NULL, 'r'},
+ {"partiality", 1, NULL, 'm'},
{0, 0, NULL, 0}
};
@@ -336,7 +340,7 @@ int main(int argc, char *argv[])
}
/* Short options */
- while ((c = getopt_long(argc, argv, "hi:o:g:b:y:n:r:j:",
+ while ((c = getopt_long(argc, argv, "hi:o:g:b:y:n:r:j:m:",
longopts, NULL)) != -1)
{
@@ -370,6 +374,10 @@ int main(int argc, char *argv[])
n_iter = atoi(optarg);
break;
+ case 'm' :
+ pmodel_str = strdup(optarg);
+ break;
+
case 'b' :
beam = get_beam_parameters(optarg);
if ( beam == NULL ) {
@@ -434,6 +442,17 @@ int main(int argc, char *argv[])
return 1;
}
+ if ( pmodel_str != NULL ) {
+ if ( strcmp(pmodel_str, "sphere") == 0 ) {
+ pmodel = PMODEL_SPHERE;
+ } else if ( strcmp(pmodel_str, "unity") == 0 ) {
+ pmodel = PMODEL_UNITY;
+ } else {
+ ERROR("Unknown partiality model '%s'.\n", pmodel_str);
+ return 1;
+ }
+ }
+
if ( reference_file != NULL ) {
RefList *list;
@@ -544,7 +563,7 @@ int main(int argc, char *argv[])
crystal_set_image(cryst, &images[i]);
/* Now it's safe to do the following */
- update_partialities(cryst);
+ update_partialities(cryst, pmodel);
as = crystal_get_reflections(cryst);
nobs += select_scalable_reflections(as, reference);