Skip to content
Snippets Groups Projects
Commit 4ff40d67 authored by Wanting Niu's avatar Wanting Niu Committed by Wanting Niu
Browse files

fix the isnan and isinf checking condition for marg_dist_stat background plot

reorganize the checking condition & message

take out z.sum() condition as it is not used
parent 659037c6
No related branches found
No related tags found
1 merge request!591add workflow to aggregate the marg_dist, trigger, and inj-trigger for a combined rank
Pipeline #607011 passed
......@@ -102,10 +102,15 @@ def plot_snr_chi_pdf(rankingstat, instrument, which, chi_type, snr_max, event_sn
x = binnedarray.bins[0].centres()[:-1]
y = binnedarray.bins[1].centres()[:-1]
z = binnedarray.at_centres()[:-1,:-1]
# checking nan and inf
if numpy.isnan(z).all():
warnings.warn("%s %s is all NaN, skipping" % (instrument, which))
return None
if numpy.isinf(z).all():
warnings.warn("%s %s is all inf, skipping" % (instrument, which))
return None
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