Skip to content

Commit

Permalink
Ignore warning from spacetelescope/gwcs#522 (#1193)
Browse files Browse the repository at this point in the history
because there is nothing we can do about it here
  • Loading branch information
pllim authored Nov 13, 2024
1 parent 12256f1 commit 170d70f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions specutils/io/default_loaders/jwst_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,11 @@ def _jwst_s2d_loader(filename, **kwargs):

# Get the wavelength array from the GWCS object which returns a
# tuple of (RA, Dec, lambda)
grid = grid_from_bounding_box(wcs.bounding_box)
with warnings.catch_warnings():
# https://github.com/spacetelescope/gwcs/pull/522
warnings.filterwarnings(
"ignore", message="The bounding_box was set in C order.*")
grid = grid_from_bounding_box(wcs.bounding_box)
_, _, lam = wcs(*grid)
_, _, lam_unit = wcs.output_frame.unit

Expand Down Expand Up @@ -587,7 +591,11 @@ def _jwst_s3d_loader(filename, **kwargs):
# tuple of (RA, Dec, lambda).
# Since the spatial and spectral axes are orthogonal in s3d data,
# it is much faster to compute a slice down the spectral axis.
grid = grid_from_bounding_box(wcs.bounding_box)[:, :, 0, 0]
with warnings.catch_warnings():
# https://github.com/spacetelescope/gwcs/pull/522
warnings.filterwarnings(
"ignore", message="The bounding_box was set in C order.*")
grid = grid_from_bounding_box(wcs.bounding_box)[:, :, 0, 0]
_, _, wavelength_array = wcs(*grid)
_, _, wavelength_unit = wcs.output_frame.unit

Expand Down

0 comments on commit 170d70f

Please sign in to comment.