aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.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/post-refinement.c
parent79993f9373e4a7fdcbff8a7d83af4b7289622cf3 (diff)
Add the possibility to have different partiality models
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 1439b148..f6f4caa5 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -88,7 +88,7 @@ static double partiality_rgradient(double r, double profile_radius)
/* Return the gradient of parameter 'k' given the current status of 'image'. */
-double gradient(Crystal *cr, int k, Reflection *refl)
+double gradient(Crystal *cr, int k, Reflection *refl, PartialityModel pmodel)
{
double ds, azix, aziy;
double ttlow, tthigh, tt;
@@ -364,7 +364,8 @@ static gsl_vector *solve_svd(gsl_vector *v, gsl_matrix *M)
/* Perform one cycle of post refinement on 'image' against 'full' */
-static double pr_iterate(Crystal *cr, const RefList *full)
+static double pr_iterate(Crystal *cr, const RefList *full,
+ PartialityModel pmodel)
{
gsl_matrix *M;
gsl_vector *v;
@@ -420,7 +421,7 @@ static double pr_iterate(Crystal *cr, const RefList *full)
/* Calculate all gradients for this reflection */
for ( k=0; k<NUM_PARAMS; k++ ) {
double gr;
- gr = gradient(cr, k, refl);
+ gr = gradient(cr, k, refl, pmodel);
gradients[k] = gr;
}
@@ -532,7 +533,7 @@ static double guide_dev(Crystal *cr, const RefList *full)
}
-void pr_refine(Crystal *cr, const RefList *full)
+void pr_refine(Crystal *cr, const RefList *full, PartialityModel pmodel)
{
double max_shift, dev;
int i;
@@ -557,9 +558,9 @@ void pr_refine(Crystal *cr, const RefList *full)
cell_get_reciprocal(crystal_get_cell(cr), &asx, &asy, &asz,
&bsx, &bsy, &bsz, &csx, &csy, &csz);
- max_shift = pr_iterate(cr, full);
+ max_shift = pr_iterate(cr, full, pmodel);
- update_partialities(cr);
+ update_partialities(cr, pmodel);
if ( verbose ) {
dev = guide_dev(cr, full);