diff options
author | Thomas White <taw@physics.org> | 2011-05-09 16:40:37 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:25 +0100 |
commit | edc3b1bda229d2516f19bcd697b6f2f89e258ecf (patch) | |
tree | 30cd710bb50fc97c64acd045b61ca810b320e99b /src | |
parent | d9c85a9c92789fa51ce2790be550b0db97b8af4a (diff) |
Works for asx and one reflection only
Diffstat (limited to 'src')
-rw-r--r-- | src/post-refinement.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c index 9298086d..2566c56b 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -151,11 +151,11 @@ static double gradient(struct image *image, int k, Reflection *refl, double r) /* Cell parameters and orientation */ case REF_ASX : - return hs * sin(tt) * cos(azi) * g / image->osf; + return -hs * sin(tt) * cos(azi) * g; case REF_BSX : - return ks * sin(tt) * g; + return -ks * sin(tt) * cos(azi) * g; case REF_CSX : - return ls * sin(tt) * g; + return -ls * sin(tt) * cos(azi) * g; case REF_ASY : return hs * sin(tt) * g; case REF_BSY : @@ -286,12 +286,12 @@ static double pr_iterate(struct image *image, const RefList *full, assert(match != NULL); /* Never happens because all scalable * reflections had their LSQ intensities * calculated in lsq_intensities(). */ - I_full = image->osf * get_intensity(match); + I_full = get_intensity(match); /* Actual measurement of this reflection from this pattern? */ I_partial = get_intensity(refl); p = get_partiality(refl); - delta_I = I_partial - (p * I_full); + delta_I = I_partial - (p * image->osf * I_full); /* Calculate all gradients for this reflection */ for ( k=0; k<NUM_PARAMS; k++ ) { @@ -311,7 +311,7 @@ static double pr_iterate(struct image *image, const RefList *full, double M_c, M_curr; M_c = gradients[g] * gradients[k]; - M_c *= pow(I_full, 2.0); + M_c *= pow(image->osf * I_full, 2.0); M_curr = gsl_matrix_get(M, g, k); gsl_matrix_set(M, g, k, M_curr + M_c); @@ -319,7 +319,7 @@ static double pr_iterate(struct image *image, const RefList *full, } gr = gradients[k]; - v_c = delta_I * I_full * gr; + v_c = delta_I * image->osf * I_full * gr; v_curr = gsl_vector_get(v, k); gsl_vector_set(v, k, v_curr + v_c); |