Skip to content

Commit ca434f2

Browse files
authored
Merge pull request #393 from lsst/tickets/DM-43620
DM-43620: When reading stamps, ignore non-image binary tables
2 parents f8bc214 + 15d20b2 commit ca434f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/lsst/meas/algorithms/stamps.py

+4
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ def readFitsWithOptions(filename, stamp_factory, options):
168168
for idx in range(nExtensions - 1):
169169
dtype = None
170170
md = readMetadata(filename, hdu=idx + 1)
171+
# Skip binary tables that aren't images or archives.
172+
if md["XTENSION"] == "BINTABLE" and not ("ZIMAGE" in md and md["ZIMAGE"]):
173+
if md["EXTNAME"] != "ARCHIVE_INDEX":
174+
continue
171175
if md["EXTNAME"] in ("IMAGE", "VARIANCE"):
172176
reader = ImageFitsReader(filename, hdu=idx + 1)
173177
if md["EXTNAME"] == "VARIANCE":

0 commit comments

Comments
 (0)