Skip to content

Commit

Permalink
revert change to mismatch probability; apply refined rotation matrix …
Browse files Browse the repository at this point in the history
…for returned catalog stars
  • Loading branch information
smroid committed Dec 27, 2024
1 parent df88d44 commit 8be6417
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tetra3/tetra3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,14 +1921,14 @@ def dist(pattern_hash):
nearby_cat_star_centroids = nearby_cat_star_centroids[kept, :]
nearby_cat_star_vectors = nearby_cat_star_vectors[kept, :]
nearby_cat_star_inds = nearby_cat_star_inds[kept]
num_nearby_catalog_stars = len(nearby_cat_star_centroids)
# Only keep as many nearby stars as the image centroids. The 2x "fudge factor"
# is because image centroids brightness rankings might not match the nearby star
# catalog brightness rankings, so keeping some extra nearby stars helps ensure
# more matches.
nearby_cat_star_centroids = nearby_cat_star_centroids[:2*num_centroids]
nearby_cat_star_vectors = nearby_cat_star_vectors[:2*num_centroids]
nearby_cat_star_inds = nearby_cat_star_inds[:2*num_centroids]
num_nearby_catalog_stars = len(nearby_cat_star_centroids)

# Match the image centroids to the nearby star centroids.
matched_stars = _find_centroid_matches(
Expand Down Expand Up @@ -1973,6 +1973,13 @@ def dist(pattern_hash):
roll = np.rad2deg(np.arctan2(rotation_matrix[1, 2],
rotation_matrix[2, 2])) % 360

# Re-apply refined rotation matrix to nearby_cat_star_vectors.
nearby_cat_star_vectors_derot = np.dot(rotation_matrix, nearby_cat_star_vectors.T).T
(nearby_cat_star_centroids, kept) = _compute_centroids(
nearby_cat_star_vectors_derot, (height, width), fov)
nearby_cat_star_centroids = nearby_cat_star_centroids[kept, :]
nearby_cat_star_inds = nearby_cat_star_inds[kept]

if distortion is None:
# Compare mutual angles in catalogue to those with current
# FOV estimate in order to scale accurately for fine FOV
Expand Down

0 comments on commit 8be6417

Please sign in to comment.