From 4ea148480ffa8690235271f994d3a1ee9dcfd1b2 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Mon, 14 Oct 2024 13:14:31 -0700 Subject: [PATCH] When reading stamps, ignore non-image binary tables 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. --- python/lsst/meas/algorithms/stamps.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/lsst/meas/algorithms/stamps.py b/python/lsst/meas/algorithms/stamps.py index 9352326bd..e779d5336 100644 --- a/python/lsst/meas/algorithms/stamps.py +++ b/python/lsst/meas/algorithms/stamps.py @@ -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":