Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
lscsoft
bilby
Commits
b8cd79e1
Commit
b8cd79e1
authored
Jul 12, 2018
by
MoritzThomasHuebner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reformatted file
parent
2a14761f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
tupak/core/result.py
tupak/core/result.py
+7
-8
No files found.
tupak/core/result.py
View file @
b8cd79e1
...
...
@@ -174,7 +174,7 @@ class Result(dict):
deepdish
.
io
.
save
(
file_name
,
dict
(
self
))
except
Exception
as
e
:
logger
.
error
(
"
\n\n
Saving the data has failed with the "
"following message:
\n
{}
\n\n
"
.
format
(
e
))
"following message:
\n
{}
\n\n
"
.
format
(
e
))
def
save_posterior_samples
(
self
):
"""Saves posterior samples to a file"""
...
...
@@ -218,8 +218,8 @@ class Result(dict):
if
self
.
covariance_matrix
.
ndim
==
0
:
return
np
.
sqrt
(
self
.
covariance_matrix
)
else
:
return
1
/
np
.
sqrt
(
np
.
abs
(
np
.
linalg
.
det
(
1
/
self
.
covariance_matrix
)))
return
1
/
np
.
sqrt
(
np
.
abs
(
np
.
linalg
.
det
(
1
/
self
.
covariance_matrix
)))
def
prior_volume
(
self
,
priors
):
""" The prior volume, given a set of priors """
...
...
@@ -267,7 +267,7 @@ class Result(dict):
title_kwargs
=
dict
(
fontsize
=
16
),
color
=
'#0072C1'
,
truth_color
=
'tab:orange'
,
show_titles
=
True
,
quantiles
=
[
0.16
,
0.84
],
levels
=
(
1
-
np
.
exp
(
-
0.5
),
1
-
np
.
exp
(
-
2
),
1
-
np
.
exp
(
-
9
/
2.
)),
levels
=
(
1
-
np
.
exp
(
-
0.5
),
1
-
np
.
exp
(
-
2
),
1
-
np
.
exp
(
-
9
/
2.
)),
plot_density
=
False
,
plot_datapoints
=
True
,
fill_contours
=
True
,
max_n_ticks
=
3
)
...
...
@@ -323,10 +323,10 @@ class Result(dict):
nwalkers
,
nsteps
,
ndim
=
self
.
walkers
.
shape
idxs
=
np
.
arange
(
nsteps
)
fig
,
axes
=
plt
.
subplots
(
nrows
=
ndim
,
figsize
=
(
6
,
3
*
ndim
))
fig
,
axes
=
plt
.
subplots
(
nrows
=
ndim
,
figsize
=
(
6
,
3
*
ndim
))
walkers
=
self
.
walkers
[:,
:,
:]
for
i
,
ax
in
enumerate
(
axes
):
ax
.
plot
(
idxs
[:
self
.
nburn
+
1
],
walkers
[:,
:
self
.
nburn
+
1
,
i
].
T
,
ax
.
plot
(
idxs
[:
self
.
nburn
+
1
],
walkers
[:,
:
self
.
nburn
+
1
,
i
].
T
,
lw
=
0.1
,
color
=
'r'
)
ax
.
set_ylabel
(
self
.
parameter_labels
[
i
])
...
...
@@ -484,7 +484,7 @@ def plot_multiple(results, filename=None, labels=None, colours=None,
axes
=
fig
.
get_axes
()
ndim
=
int
(
np
.
sqrt
(
len
(
axes
)))
axes
[
ndim
-
1
].
legend
(
lines
,
labels
)
axes
[
ndim
-
1
].
legend
(
lines
,
labels
)
if
filename
is
None
:
filename
=
default_filename
...
...
@@ -492,4 +492,3 @@ def plot_multiple(results, filename=None, labels=None, colours=None,
if
save
:
fig
.
savefig
(
filename
)
return
fig
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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