aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-05-10 16:10:07 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:25 +0100
commitc981c23d4c4296ffc29617b7b89f86b69bcd0c3f (patch)
treebf9b53ac60188f9fd0f5e23e663f55cb8cf8cfd0 /src/post-refinement.c
parent06d0998ac272c895a89beb95e0a285cdbace95a6 (diff)
"Correct" gradients
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index b7b87f8f..c3432af1 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -124,7 +124,7 @@ static double gradient(struct image *image, int k, Reflection *refl, double r)
g += partiality_gradient(r1, r);
}
if ( clamp_high == 0 ) {
- g += partiality_gradient(r2, r);
+ g -= partiality_gradient(r2, r);
}
//STATUS("clamp status low=%i high=%i\n", clamp_low, clamp_high);
//STATUS("excitation errors %e %e\n", r1, r2);
@@ -157,11 +157,11 @@ static double gradient(struct image *image, int k, Reflection *refl, double r)
case REF_CSX :
return -ls * sin(tt) * cos(azi) * g;
case REF_ASY :
- return hs * sin(tt) * g;
+ return hs * sin(tt) * sin(azi) * g;
case REF_BSY :
- return ks * sin(tt) * g;
+ return ks * sin(tt) * sin(azi) * g;
case REF_CSY :
- return ls * sin(tt) * g;
+ return ls * sin(tt) * sin(azi) * g;
case REF_ASZ :
return hs * cos(tt) * g;
case REF_BSZ :