Commit 76955fb9 authored by Sophie Hourihane's avatar Sophie Hourihane
Browse files

Adding warning for 0 amplitude wavelet

parent ea29581b
Pipeline #476884 passed with stages
in 1 minute and 44 seconds
......@@ -291,7 +291,14 @@ def get_wavelet_params(filename, model, chirpflag=False, O1version=False, **keyw
for i in range(0,waveletnumber):
for l in range(0,NW):
if labels[l] == 'logA':
data[labels[l]].append(np.log10(float(spl[start+i*NW+l])))
with np.errstate(divide = 'raise'):
try:
data[labels[l]].append(np.log10(float(spl[start+i*NW+l])))
except FloatingPointError:
print(f"Warning! 0 amplitude wavelet! at line {start + l} {float(spl[start+i*NW+l])} <= 0?")
data[labels[l]].append(0)
else:
data[labels[l]].append(float(spl[start+i*NW+l]))
......@@ -369,7 +376,7 @@ def get_axes(jobName, postDir, ifoList, model, time, runFlags = RUN_FLAGS):
ymax = 0
axwinner = axisList[0]
for i, axcand in enumerate(axisList):
if axcand[3] > ymax:
if (axcand[3] > ymax) and (axcand[3] != np.inf):
ymax = axcand[3]
axwinner = axcand
......@@ -678,7 +685,7 @@ def plot_power_spectrum(jobName, postDir, ifo, plotsDir, worc, mdc, model, axwin
plt.close()
def plot_full_spectro(jobName, postDir, ifo, plotsDir, worc, mdc, models, axwinner, psd_info, powerspec_infos, runFlags = RUN_FLAGS):
plt.figure()
if mdc:
......@@ -2463,6 +2470,7 @@ for mod in RUN_FLAGS.modelList:
f_axwinner = get_axes_fdom(jobName, postDir, ifoList, mod, time)
print(f"faxwinner {f_axwinner}")
# -- Plot median spectra
plot_full_spectro(jobName, postDir, ifo, plotsDir, worc, mdc, [mod], f_axwinner, psd_info, [powerspec_info])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment