Skip to content

Commit

Permalink
Fix issue with WCSes that have no default units
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed May 18, 2023
1 parent 6da7f6c commit 5d1b682
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions reproject/mosaicking/wcs_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ def find_optimal_celestial_wcs(
# Construct WCS object centered on position
wcs_final = celestial_frame_to_wcs(frame, projection=projection)

if wcs_final.wcs.cunit[0] == "":
wcs_final.wcs.cunit[0] = "deg"

if wcs_final.wcs.cunit[1] == "":
wcs_final.wcs.cunit[1] = "deg"

rep = reference.represent_as("unitspherical")
wcs_final.wcs.crval = (
rep.lon.to_value(wcs_final.wcs.cunit[0]),
Expand Down

0 comments on commit 5d1b682

Please sign in to comment.