Skip to content
Snippets Groups Projects
Commit 4e56722c authored by Colm Talbot's avatar Colm Talbot
Browse files

move default latex labels out of core

parent 05bd9620
No related branches found
No related tags found
1 merge request!59Updating priors
......@@ -311,36 +311,14 @@ class Prior(object):
@property
def __default_latex_label(self):
default_labels = {
'mass_1': '$m_1$',
'mass_2': '$m_2$',
'total_mass': '$M$',
'chirp_mass': '$\mathcal{M}$',
'mass_ratio': '$q$',
'symmetric_mass_ratio': '$\eta$',
'a_1': '$a_1$',
'a_2': '$a_2$',
'tilt_1': '$\\theta_1$',
'tilt_2': '$\\theta_2$',
'cos_tilt_1': '$\cos\\theta_1$',
'cos_tilt_2': '$\cos\\theta_2$',
'phi_12': '$\Delta\phi$',
'phi_jl': '$\phi_{JL}$',
'luminosity_distance': '$d_L$',
'dec': '$\mathrm{DEC}$',
'ra': '$\mathrm{RA}$',
'iota': '$\iota$',
'cos_iota': '$\cos\iota$',
'psi': '$\psi$',
'phase': '$\phi$',
'geocent_time': '$t_c$'
}
if self.name in default_labels.keys():
label = default_labels[self.name]
if self.name in self._default_latex_labels.keys():
label = self._default_latex_labels[self.name]
else:
label = self.name
return label
_default_latex_labels = dict()
class DeltaFunction(Prior):
"""Dirac delta function prior, this always returns peak."""
......
......@@ -17,6 +17,8 @@ class BBHPriorSet(PriorSet):
if dictionary is None and filename is None:
filename = os.path.join(os.path.dirname(__file__), 'prior_files', 'binary_black_holes.prior')
logging.info('No prior given, using default BBH priors in {}.'.format(filename))
elif not os.path.isfile(filename):
filename = os.path.join(os.path.dirname(__file__), 'prior_files', filename)
PriorSet.__init__(self, dictionary=dictionary, filename=filename)
def test_redundancy(self, key):
......@@ -64,3 +66,28 @@ class BBHPriorSet(PriorSet):
break
return redundant
Prior._default_latex_labels = {
'mass_1': '$m_1$',
'mass_2': '$m_2$',
'total_mass': '$M$',
'chirp_mass': '$\mathcal{M}$',
'mass_ratio': '$q$',
'symmetric_mass_ratio': '$\eta$',
'a_1': '$a_1$',
'a_2': '$a_2$',
'tilt_1': '$\\theta_1$',
'tilt_2': '$\\theta_2$',
'cos_tilt_1': '$\cos\\theta_1$',
'cos_tilt_2': '$\cos\\theta_2$',
'phi_12': '$\Delta\phi$',
'phi_jl': '$\phi_{JL}$',
'luminosity_distance': '$d_L$',
'dec': '$\mathrm{DEC}$',
'ra': '$\mathrm{RA}$',
'iota': '$\iota$',
'cos_iota': '$\cos\iota$',
'psi': '$\psi$',
'phase': '$\phi$',
'geocent_time': '$t_c$'}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment