Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sophie Hourihane
bayeswave
Commits
76955fb9
Commit
76955fb9
authored
Nov 17, 2022
by
Sophie Hourihane
Browse files
Adding warning for 0 amplitude wavelet
parent
ea29581b
Pipeline
#476884
passed with stages
in 1 minute and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
BayesWaveUtils/scripts/megaplot.py
View file @
76955fb9
...
...
@@ -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
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment