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
ff4592b4
Commit
ff4592b4
authored
Oct 03, 2018
by
Colm Talbot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove old method, make handling of missing labels safer
parent
d764e619
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
35 deletions
+3
-35
bilby/core/result.py
bilby/core/result.py
+3
-35
No files found.
bilby/core/result.py
View file @
ff4592b4
...
...
@@ -228,8 +228,9 @@ class Result(dict):
elif
k
in
self
.
parameter_labels
:
latex_labels
.
append
(
k
)
else
:
raise
ValueError
(
'key {} not a parameter label or latex label'
.
format
(
k
))
logger
.
info
(
'key {} not a parameter label or latex label'
.
format
(
k
))
latex_labels
.
append
(
' '
.
join
(
k
.
split
(
'_'
)))
return
latex_labels
@
property
...
...
@@ -574,39 +575,6 @@ class Result(dict):
self
.
prior_values
[
key
]
\
=
priors
[
key
].
prob
(
self
.
posterior
[
key
].
values
)
def
construct_cbc_derived_parameters
(
self
):
""" Construct widely used derived parameters of CBCs """
self
.
posterior
[
'mass_chirp'
]
=
(
(
self
.
posterior
.
mass_1
*
self
.
posterior
.
mass_2
)
**
0.6
/
(
self
.
posterior
.
mass_1
+
self
.
posterior
.
mass_2
)
**
0.2
)
self
.
search_parameter_keys
.
append
(
'mass_chirp'
)
self
.
parameter_labels
.
append
(
'$\mathcal{M}$'
)
self
.
posterior
[
'q'
]
=
self
.
posterior
.
mass_2
/
self
.
posterior
.
mass_1
self
.
search_parameter_keys
.
append
(
'q'
)
self
.
parameter_labels
.
append
(
'$q$'
)
self
.
posterior
[
'eta'
]
=
(
(
self
.
posterior
.
mass_1
*
self
.
posterior
.
mass_2
)
/
(
self
.
posterior
.
mass_1
+
self
.
posterior
.
mass_2
)
**
2
)
self
.
search_parameter_keys
.
append
(
'eta'
)
self
.
parameter_labels
.
append
(
'$\eta$'
)
self
.
posterior
[
'chi_eff'
]
=
(
(
self
.
posterior
.
a_1
*
np
.
cos
(
self
.
posterior
.
tilt_1
)
+
self
.
posterior
.
q
*
self
.
posterior
.
a_2
*
np
.
cos
(
self
.
posterior
.
tilt_2
))
/
(
1
+
self
.
posterior
.
q
))
self
.
search_parameter_keys
.
append
(
'chi_eff'
)
self
.
parameter_labels
.
append
(
'$\chi_{\mathrm eff}$'
)
self
.
posterior
[
'chi_p'
]
=
(
np
.
maximum
(
self
.
posterior
.
a_1
*
np
.
sin
(
self
.
posterior
.
tilt_1
),
(
4
*
self
.
posterior
.
q
+
3
)
/
(
3
*
self
.
posterior
.
q
+
4
)
*
self
.
posterior
.
q
*
self
.
posterior
.
a_2
*
np
.
sin
(
self
.
posterior
.
tilt_2
)))
self
.
search_parameter_keys
.
append
(
'chi_p'
)
self
.
parameter_labels
.
append
(
'$\chi_{\mathrm p}$'
)
def
check_attribute_match_to_other_object
(
self
,
name
,
other_object
):
""" Check attribute name exists in other_object and is the same
...
...
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