Skip to content
Snippets Groups Projects
Commit 44f8a5b8 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

plotfar: work-around for all-NaN SNR,chi^2 PDF

- if an SNR, \chi^2 PDF is all NaN, skip it instead of crashing
parent 9745ee1e
No related branches found
No related tags found
No related merge requests found
......@@ -101,6 +101,9 @@ def plot_snr_chi_pdf(rankingstat, instrument, which, snr_max, event_snr = None,
y = binnedarray.bins[1].centres()[:-1]
z = binnedarray.at_centres()[:-1,:-1]
if numpy.isnan(z).any():
if numpy.isnan(z).all():
warnings.warn("%s %s is all NaN, skipping" % (instrument, which))
return None
warnings.warn("%s %s contains NaNs" % (instrument, which))
z = numpy.ma.masked_where(numpy.isnan(z), z)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment