Skip to content

Commit

Permalink
fix: allow for empty cutouts in PlotTransientLightCurves (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvansanten authored Feb 3, 2025
1 parent 47fdb54 commit 4b7389e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ampel/contrib/hu/t3/PlotTransientLightcurves.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ def create_stamp_plot(cutouts: dict, ax, cutout_type: str):
cutout_type assumed to be one of Science, Template, Difference
"""

data = next(iter(cutouts.values()))[f"cutout{cutout_type}"]
cutouts_for_candidate = next(iter(cutouts.values()), None)
if cutouts_for_candidate is None:
return
data = cutouts_for_candidate[f"cutout{cutout_type}"]

with gzip.open(io.BytesIO(data), "rb") as f:
data = fits.open(io.BytesIO(f.read()), ignore_missing_simple=True)[0].data
Expand Down

0 comments on commit 4b7389e

Please sign in to comment.