Commit af41ba9e authored by Marc Arene's avatar Marc Arene
Browse files

using paru.component_masses_to_reduced_mass()

parent b2fcac6d
......@@ -8,6 +8,7 @@ import bilby.gw.conversion as conv
from Headers.PN_Coefficients import * # Headers.Constants already imported in PN_Coeff
import Library.python_utils as pu
import Library.param_utils as paru
......@@ -61,7 +62,9 @@ def ini_file_to_dict(file_path='../examples/GW170817.ini'):
injection_parameters = conv.generate_mass_parameters(injection_parameters)
injection_parameters['reduced_mass'] = (injection_parameters['mass_1'] * injection_parameters['mass_2']) / (injection_parameters['mass_1'] + injection_parameters['mass_2'])
# injection_parameters['reduced_mass'] = (injection_parameters['mass_1'] * injection_parameters['mass_2']) / (injection_parameters['mass_1'] + injection_parameters['mass_2'])
injection_parameters['reduced_mass'] = paru.component_masses_to_reduced_mass(injection_parameters['mass_1'], injection_parameters['mass_2'])
# Set the duration and sampling frequency of the data segment that we're going
......
......@@ -91,7 +91,24 @@ def q_pos_to_dictionary_old(q_pos, start_time, dictionary=None):
return dictionary
def component_masses_to_reduced_mass(mass_1, mass_2):
"""
Convert the component masses of a binary to its reduced mass.
Parameters
----------
mass_1: float
Mass of the heavier object
mass_2: float
Mass of the lighter object
Return
------
reduced_mass: float
Reduced mass of the binary
"""
return (mass_1 * mass_2) / (mass_1 + mass_2)
def Mc_and_mu_to_M_eta_m1_and_m2(chirp_mass, reduced_mass):
total_mass = chirp_mass**2.5 * reduced_mass**(-1.5)
......@@ -285,3 +302,15 @@ def RemappingAngles(sigpar):
sigpar[7] = np.arctan2(y,x)
if sigpar[7] < 0.0:
sigpar[7] += TPI
class Parameter:
def __init(self, key, name, value, function, fname, fvalue, offset=1e-7):
self.key = key
self.name = name
self.value = value
self.function = function
self.fname = fname
self.fvalue = fvalue
self.offset = offset
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