aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorHelen Ginn <helen@strubi.ox.ac.uk>2018-04-27 22:27:45 +0200
committerThomas White <taw@physics.org>2018-05-02 09:46:14 +0200
commitb0c9de361ded510d1fb3facbdb21925b7f3625ab (patch)
tree0ffde886fd9403b75a418f71050907784847ea70 /libcrystfel
parent51269217ef086a38c1244c3f7154c1efef191449 (diff)
Change score for seed
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/taketwo.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libcrystfel/src/taketwo.c b/libcrystfel/src/taketwo.c
index a24a30c0..bbd3883d 100644
--- a/libcrystfel/src/taketwo.c
+++ b/libcrystfel/src/taketwo.c
@@ -714,6 +714,9 @@ static int obs_vecs_match_angles(int her, int his,
struct rvec *her_match = &her_obs->matches[i].vec;
struct rvec *his_match = &his_obs->matches[j].vec;
+ double her_dist = rvec_length(*her_match);
+ double his_dist = rvec_length(*his_match);
+
double theory_angle = rvec_angle(*her_match,
*his_match);
@@ -729,7 +732,7 @@ static int obs_vecs_match_angles(int her, int his,
double add = angle_diff;
if (add == add) {
- score += add;
+ score += add * her_dist * his_dist;
}
/* If the angles are too close to 0
@@ -751,13 +754,15 @@ static int obs_vecs_match_angles(int her, int his,
obs_angle = rvec_angle(her_obs->obsvec, obs_diff);
angle_diff = fabs(obs_angle - theory_angle);
+ double diff_dist = rvec_length(obs_diff);
+
if (angle_diff > ANGLE_TOLERANCE) {
continue;
}
add = angle_diff;
if (add == add) {
- score += add;
+ score += add * her_dist * diff_dist;
}
theory_angle = rvec_angle(*his_match,
@@ -770,7 +775,7 @@ static int obs_vecs_match_angles(int her, int his,
add = angle_diff;
if (add == add) {
- score += add;
+ score += add * his_dist * diff_dist;
}
/* we add a new seed to the array */