Skip to content

Commit

Permalink
Fix crash when nothing is plotted
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Aug 16, 2024
1 parent 74a817f commit 6b67be1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/lsst/summit/utils/nightReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,13 @@ def makeAltAzCoveragePlot(
objects = self.stars
objects = ensure_iterable(objects)

if not objects: # there's genuinely nothing now
self.log.info("No objects to plot")
return None

fig = plt.figure(figsize=(16, 12))

ax = None
for obj in objects:
if obj in CALIB_VALUES:
continue
Expand All @@ -757,6 +762,11 @@ def makeAltAzCoveragePlot(
ax = self._makePolarPlot(
azes, zens, marker=marker, title=None, makeFig=False, color=color, objName=obj
)

if ax is None:
self.log.info("Only calibs taken so far, nothing to plot")
return None

lgnd = ax.legend(bbox_to_anchor=(1.05, 1), prop={"size": 15}, loc="upper left")
ax.set_title("Axial coverage - azimuth (theta, deg) vs zenith angle (r, deg)", size=20)

Expand Down

0 comments on commit 6b67be1

Please sign in to comment.