Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lscsoft
bilby
Commits
899b63e5
Commit
899b63e5
authored
6 years ago
by
Colm Talbot
Browse files
Options
Downloads
Patches
Plain Diff
make plot marginals work
parent
5c494930
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!294
make plot marginals work
Pipeline
#39998
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bilby/core/result.py
+20
-11
20 additions, 11 deletions
bilby/core/result.py
with
20 additions
and
11 deletions
bilby/core/result.py
+
20
−
11
View file @
899b63e5
...
...
@@ -532,36 +532,45 @@ class Result(object):
"""
if
isinstance
(
parameters
,
dict
):
plot_parameter_keys
=
list
(
parameters
.
keys
())
truths
=
list
(
parameters
.
values
())
truths
=
parameters
elif
parameters
is
None
:
plot_parameter_keys
=
self
.
injection_parameters
.
keys
()
truths
=
[
self
.
injection_parameters
.
get
(
key
,
None
)
for
key
in
plot_parameter_keys
]
plot_parameter_keys
=
self
.
posterior
.
keys
()
if
self
.
injection_parameters
is
None
:
truths
=
dict
()
else
:
truths
=
self
.
injection_parameters
else
:
plot_parameter_keys
=
list
(
parameters
)
truths
=
[
self
.
injection_parameters
.
get
(
key
,
None
)
for
key
in
plot_parameter_keys
]
if
self
.
injection_parameters
is
None
:
truths
=
dict
()
else
:
truths
=
self
.
injection_parameters
if
file_base_name
is
None
:
file_base_name
=
'
{}/{}_1d/
'
.
format
(
self
.
outdir
,
self
.
label
)
check_directory_exists_and_if_not_mkdir
(
file_base_name
)
if
priors
is
True
:
priors
=
getattr
(
self
,
'
priors
'
,
False
)
elif
isinstance
(
priors
,
dict
)
or
priors
in
[
False
,
None
]
:
priors
=
getattr
(
self
,
'
priors
'
,
dict
()
)
elif
isinstance
(
priors
,
dict
):
pass
elif
priors
in
[
False
,
None
]:
priors
=
dict
()
else
:
raise
ValueError
(
'
Input priors={} not understood
'
.
format
(
priors
))
for
i
,
key
in
enumerate
(
plot_parameter_keys
):
if
not
isinstance
(
self
.
posterior
[
key
].
values
[
0
],
float
):
continue
prior
=
priors
.
get
(
key
,
None
)
truth
=
truths
.
get
(
key
,
None
)
for
cumulative
in
[
False
,
True
]:
self
.
plot_single_density
(
key
,
prior
=
prior
s
[
i
]
,
cumulative
=
cumulative
,
title
=
titles
,
truth
=
truth
s
[
i
]
,
save
=
True
,
file_base_name
=
file_base_name
,
fig
=
self
.
plot_single_density
(
key
,
prior
=
prior
,
cumulative
=
cumulative
,
title
=
titles
,
truth
=
truth
,
save
=
True
,
file_base_name
=
file_base_name
,
bins
=
bins
,
label_fontsize
=
label_fontsize
,
dpi
=
dpi
,
title_fontsize
=
title_fontsize
,
quantiles
=
quantiles
)
plt
.
close
(
fig
)
def
plot_corner
(
self
,
parameters
=
None
,
priors
=
None
,
titles
=
True
,
save
=
True
,
filename
=
None
,
dpi
=
300
,
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment