Commit ff4592b4 authored by Colm Talbot's avatar Colm Talbot
Browse files

remove old method, make handling of missing labels safer

parent d764e619
...@@ -228,8 +228,9 @@ class Result(dict): ...@@ -228,8 +228,9 @@ class Result(dict):
elif k in self.parameter_labels: elif k in self.parameter_labels:
latex_labels.append(k) latex_labels.append(k)
else: else:
raise ValueError('key {} not a parameter label or latex label' logger.info(
.format(k)) 'key {} not a parameter label or latex label'.format(k))
latex_labels.append(' '.join(k.split('_')))
return latex_labels return latex_labels
@property @property
...@@ -574,39 +575,6 @@ class Result(dict): ...@@ -574,39 +575,6 @@ class Result(dict):
self.prior_values[key]\ self.prior_values[key]\
= priors[key].prob(self.posterior[key].values) = 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): def check_attribute_match_to_other_object(self, name, other_object):
""" Check attribute name exists in other_object and is the same """ Check attribute name exists in other_object and is the same
......
Markdown is supported
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