Skip to content

Commit

Permalink
When reading stamps, ignore non-image binary tables
Browse files Browse the repository at this point in the history
Raw guider images have additional tables that can not be read
but should be ignored to allow the rest of the data to be read.
  • Loading branch information
timj committed Oct 14, 2024
1 parent c081298 commit 4ea1484
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 4ea1484

Please sign in to comment.