Skip to content

Commit

Permalink
Suppress a single warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremykubica committed Dec 13, 2023
1 parent 0e35175 commit 2c1b4dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/kbmod/work_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

from astropy.io import fits
from astropy.table import Table
from astropy.utils.exceptions import AstropyWarning
from astropy.wcs import WCS
import numpy as np
from pathlib import Path
import warnings

from kbmod.configuration import SearchConfiguration
from kbmod.search import ImageStack, LayeredImage, PSF, RawImage
Expand Down Expand Up @@ -60,7 +62,11 @@ def from_fits(cls, filename):
config = SearchConfiguration.from_hdu(hdul["kbmod_config"])

# Read in the global WCS from extension 0 if the information exists.
global_wcs = extract_wcs(hdul[0])
# We filter the warning that the image dimension does not match the WCS dimension
# since the primary header does not have an image.
with warnings.catch_warnings():
warnings.simplefilter("ignore", AstropyWarning)
global_wcs = extract_wcs(hdul[0])

# Read the size and order information from the primary header.
num_images = hdul[0].header["NUMIMG"]
Expand Down

0 comments on commit 2c1b4dd

Please sign in to comment.