Skip to content

Commit

Permalink
Merge pull request #393 from lsst/tickets/DM-43620
Browse files Browse the repository at this point in the history
DM-43620: When reading stamps, ignore non-image binary tables
  • Loading branch information
timj authored Nov 6, 2024
2 parents f8bc214 + 15d20b2 commit ca434f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/lsst/meas/algorithms/stamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ def readFitsWithOptions(filename, stamp_factory, options):
for idx in range(nExtensions - 1):
dtype = None
md = readMetadata(filename, hdu=idx + 1)
# Skip binary tables that aren't images or archives.
if md["XTENSION"] == "BINTABLE" and not ("ZIMAGE" in md and md["ZIMAGE"]):
if md["EXTNAME"] != "ARCHIVE_INDEX":
continue
if md["EXTNAME"] in ("IMAGE", "VARIANCE"):
reader = ImageFitsReader(filename, hdu=idx + 1)
if md["EXTNAME"] == "VARIANCE":
Expand Down

0 comments on commit ca434f2

Please sign in to comment.