Skip to content

Commit

Permalink
switch to using cv2 rotmatrix for reproject
Browse files Browse the repository at this point in the history
  • Loading branch information
mileslucas committed Sep 15, 2024
1 parent 6959a91 commit 3c48aea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vampires_dpp/image_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ def register_hdul(

# if reprojecting, scale + rotate images
if tforms is not None:
shifted = warp_frame(shifted, tforms[wlidx].params[:2])
shifted_err = warp_frame(shifted_err, tforms[wlidx].params[:2])
rotmat = cv2.getRotationMatrix2D(
frame_center(shifted), np.rad2deg(tforms[wlidx].rotation), tforms[wlidx].scale
)
shifted = warp_frame(shifted, rotmat)
shifted_err = warp_frame(shifted_err, rotmat)

# pad output
aligned_cube[tidx, wlidx] = np.pad(shifted, npad, constant_values=np.nan)
Expand Down

0 comments on commit 3c48aea

Please sign in to comment.