From bac26e8906fceab4ecf51ede2b4e5f026e4085b1 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 27 Nov 2024 09:49:23 -0500 Subject: [PATCH 1/3] Stop using `drizzle.util.is_blank` --- romancal/resample/gwcs_drizzle.py | 7 ++----- romancal/resample/resample.py | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/romancal/resample/gwcs_drizzle.py b/romancal/resample/gwcs_drizzle.py index 96e1018f8..f50d52815 100644 --- a/romancal/resample/gwcs_drizzle.py +++ b/romancal/resample/gwcs_drizzle.py @@ -1,7 +1,7 @@ import logging import numpy as np -from drizzle import cdrizzle, util +from drizzle import cdrizzle from . import resample_utils @@ -377,10 +377,7 @@ def dodrizzle( """ # Insure that the fillval parameter gets properly interpreted for use with tdriz - if util.is_blank(str(fillval)): - fillval = "INDEF" - else: - fillval = str(fillval) + fillval = "INDEF" if str(fillval).strip() == "" else str(fillval) if in_units == "cps": expscale = 1.0 diff --git a/romancal/resample/resample.py b/romancal/resample/resample.py index 0e11fd629..6d2a7f154 100644 --- a/romancal/resample/resample.py +++ b/romancal/resample/resample.py @@ -6,7 +6,7 @@ import numpy as np from astropy import units as u from astropy.coordinates import SkyCoord -from drizzle import cdrizzle, util +from drizzle import cdrizzle from roman_datamodels import datamodels, maker_utils, stnode from stcal.alignment.util import compute_s_region_keyword, compute_scale @@ -696,7 +696,7 @@ def drizzle_arrays( """ # Insure that the fillval parameter gets properly interpreted for use with tdriz - fillval = "INDEF" if util.is_blank(str(fillval)) else str(fillval) + fillval = "INDEF" if str(fillval).strip() == "" else str(fillval) if insci.dtype > np.float32: insci = insci.astype(np.float32) From dd053f29b55ee174959b7c95d74db4cb1ab50c99 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 27 Nov 2024 10:12:33 -0500 Subject: [PATCH 2/3] Fix deprication from stcal --- romancal/resample/resample_utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/romancal/resample/resample_utils.py b/romancal/resample/resample_utils.py index 0b399e68b..f9fab3df9 100644 --- a/romancal/resample/resample_utils.py +++ b/romancal/resample/resample_utils.py @@ -8,7 +8,7 @@ from astropy.modeling import Model from astropy.nddata.bitmask import bitfield_to_boolean_mask from roman_datamodels.dqflags import pixel -from stcal.alignment.util import wcs_from_footprints +from stcal.alignment.util import wcs_from_sregions from romancal.assign_wcs.utils import wcs_bbox_from_shape @@ -73,13 +73,14 @@ def make_output_wcs( if w.bounding_box is None: w.bounding_box = wcs_bbox_from_shape(i.data.shape) naxes = wcslist[0].output_frame.naxes + ref_wcs = wcslist[0] if naxes != 2: raise RuntimeError(f"Output WCS needs 2 axes.{wcslist[0]} has {naxes}.") - output_wcs = wcs_from_footprints( - wcslist, - None, + output_wcs = wcs_from_sregions( + [wcs.footprint() for wcs in wcslist], + ref_wcs, dict(input_models[0].meta.wcsinfo), pscale_ratio=pscale_ratio, pscale=pscale, From 4b84ee494f9c36c077ca728c5199528657cd8710 Mon Sep 17 00:00:00 2001 From: William Jamieson Date: Wed, 27 Nov 2024 10:26:38 -0500 Subject: [PATCH 3/3] Add changes --- changes/1546.general.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/1546.general.rst diff --git a/changes/1546.general.rst b/changes/1546.general.rst new file mode 100644 index 000000000..c0308a98a --- /dev/null +++ b/changes/1546.general.rst @@ -0,0 +1 @@ +Fix deprication warnings that have shown up in the tests.