Skip to content

Commit

Permalink
when applying refined rotation matrix to catalog stars, also apply re…
Browse files Browse the repository at this point in the history
…fined fov
  • Loading branch information
smroid committed Dec 27, 2024
1 parent 8be6417 commit 62a3e31
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tetra3/tetra3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1973,13 +1973,6 @@ 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 Expand Up @@ -2016,6 +2009,13 @@ def dist(pattern_hash):
image_centroids_undist = _undistort_centroids(image_centroids, (height, width), k)
matched_image_centroids_undist = image_centroids_undist[matched_stars[:, 0], :]

# Re-apply refined rotation matrix and FOV 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]

# Get vectors
final_match_vectors = _compute_vectors(
matched_image_centroids_undist, (height, width), fov)
Expand Down

0 comments on commit 62a3e31

Please sign in to comment.