Maintenance will be performed on,,, and on Tuesday 26 May 2020 starting at approximately 10am CDT. It is expected to take around 30 minutes and will involve a short period of downtime, around 5 minutes, towards the end of the maintenance period. Please address any questions, comments, or concerns to

Commit 18efebb9 authored by Leo Pound Singer's avatar Leo Pound Singer

Fix inf handling bug in ligo-skymap-plot-airmass

parent 35379273
Pipeline #51669 passed with stages
in 11 minutes and 52 seconds
......@@ -5,7 +5,10 @@ Changelog
0.1.3 (unreleased)
- No changes yet.
- Fix a bug in ``ligo-skymap-plot-airmass`` that caused the airmass chart to be
blank if the lower and upper credible levels were always in opposite
hemispheres. The root cause was that ``plt.fill_between`` does not clip
infinities to the plot's data range.
0.1.2 (2019-02-28)
......@@ -44,6 +44,10 @@ def condition_secz(x):
return np.where(x <= 0, np.inf, x)
def clip_verylarge(x, max=1e300):
return np.clip(x, -max, max)
def main(args=None):
opts = parser().parse_args(args)
......@@ -111,7 +115,11 @@ def main(args=None):
cmap = plt.get_cmap()
for level, lo, hi in zip(levels, airmass[:nlevels], airmass[nlevels:]):
ax.fill_between(times.plot_date, lo, hi, color=cmap(level), zorder=2)
clip_verylarge(lo), # Clip infinities to large but finite values
clip_verylarge(hi), # because fill_between cannot handle inf
color=cmap(level), zorder=2)
[Patch(facecolor=cmap(level)) for level in levels],
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment