Skip to content

Commit

Permalink
add z to plots if present
Browse files Browse the repository at this point in the history
  • Loading branch information
simeonreusch committed May 10, 2023
1 parent 0e76c55 commit ac26c9e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nuztf/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ def absmag_to_mag(absmag):
)

if (redshift := alert[0].get("redshifts", {}).get("ampel_z")) is not None:
info.append(
f"z: {redshift:.3f} +/- {alert[0]['redshifts']['group_z_precision']}"
)
if alert[0]["redshifts"]["group_z_nbr"] in [1, 2]:
info.append(f"spec z: {redshift:.3f}")
else:
info.append(f"photo z: {redshift:.3f}")

fig.text(0.77, 0.55, "\n".join(info), va="top", fontsize="medium", alpha=0.5)

Expand Down

0 comments on commit ac26c9e

Please sign in to comment.