From 5d1b68213939add5f5313cf72c464c6e10368ecd Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 18 May 2023 14:37:00 +0100 Subject: [PATCH] Fix issue with WCSes that have no default units --- reproject/mosaicking/wcs_helpers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reproject/mosaicking/wcs_helpers.py b/reproject/mosaicking/wcs_helpers.py index d0c8551ab..79f314461 100644 --- a/reproject/mosaicking/wcs_helpers.py +++ b/reproject/mosaicking/wcs_helpers.py @@ -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]),