From b0c9de361ded510d1fb3facbdb21925b7f3625ab Mon Sep 17 00:00:00 2001 From: Helen Ginn Date: Fri, 27 Apr 2018 22:27:45 +0200 Subject: Change score for seed --- libcrystfel/src/taketwo.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'libcrystfel/src/taketwo.c') 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 */ -- cgit v1.2.3