Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings #1546

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/1546.general.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix deprication warnings that have shown up in the tests.
7 changes: 2 additions & 5 deletions romancal/resample/gwcs_drizzle.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

import numpy as np
from drizzle import cdrizzle, util
from drizzle import cdrizzle

from . import resample_utils

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions romancal/resample/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down
9 changes: 5 additions & 4 deletions romancal/resample/resample_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
Loading