From 3126d570a5727f004d0d8761075a1f92706cb171 Mon Sep 17 00:00:00 2001 From: Josh Meyers Date: Tue, 7 Nov 2023 16:08:05 -0800 Subject: [PATCH] Don't fail due to missing WCS --- python/lsst/summit/utils/peekExposure.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/python/lsst/summit/utils/peekExposure.py b/python/lsst/summit/utils/peekExposure.py index 4036108b..b6c58455 100644 --- a/python/lsst/summit/utils/peekExposure.py +++ b/python/lsst/summit/utils/peekExposure.py @@ -879,6 +879,10 @@ def transformShapes(self, shapes, exposure, binSize): nw_shapes = [] aa_shapes = [] for shape in shapes: + if wcs is None: + nw_shapes.append(Quadrupole(np.nan, np.nan, np.nan)) + aa_shapes.append(Quadrupole(np.nan, np.nan, np.nan)) + continue # The WCS transforms to N (dec) and E (ra), but we want N and W to # conform with weak-lensing conventions. So we flip the [0] # component of the transformation. @@ -919,13 +923,15 @@ def updateDisplay( visitInfo = exposure.info.getVisitInfo() self._display.mtv(exposure) - rose( - self._display, - exposure.getWcs(), - Point2D(200 / binSize, 200 / binSize), - q=visitInfo.boresightParAngle, - len=100 / binSize, - ) + wcs = exposure.wcs + if wcs is not None: + rose( + self._display, + wcs, + Point2D(200 / binSize, 200 / binSize), + q=visitInfo.boresightParAngle, + len=100 / binSize, + ) for idx, source in enumerate(binnedSourceCat): x, y = source.getCentroid()