def setUp(self): self.search_keys = [] self.parameters = dict() self.component_mass_pars = dict(mass_1=1.4, mass_2=1.4) self.mass_parameters = self.component_mass_pars.copy() self.mass_parameters[ "mass_ratio"] = conversion.component_masses_to_mass_ratio( **self.component_mass_pars) self.mass_parameters[ "symmetric_mass_ratio"] = conversion.component_masses_to_symmetric_mass_ratio( **self.component_mass_pars) self.mass_parameters[ "chirp_mass"] = conversion.component_masses_to_chirp_mass( **self.component_mass_pars) self.mass_parameters[ "total_mass"] = conversion.component_masses_to_total_mass( **self.component_mass_pars) self.component_tidal_parameters = dict(lambda_1=300, lambda_2=300) self.all_component_pars = self.component_tidal_parameters.copy() self.all_component_pars.update(self.component_mass_pars) self.tidal_parameters = self.component_tidal_parameters.copy() self.tidal_parameters[ "lambda_tilde"] = conversion.lambda_1_lambda_2_to_lambda_tilde( **self.all_component_pars) self.tidal_parameters[ "delta_lambda_tilde"] = conversion.lambda_1_lambda_2_to_delta_lambda_tilde( **self.all_component_pars)
def SPA_time_shift(frequency_array, mass_1, mass_2, mode=(2, 2), to_order=8): ''' Calculate t(f) of stationary phase approximation(SPA) for a special spherical harmonic mode of GW. See (A12) in Niu, arXiv:1910.10592 Args frequency_array: (1d array): frequency array, unit:Hz mass_1, mass_2 (float): masses of the compact binary, unit: solar mass mode (Tuple[int]): harmonic mode of GW, default to be (2, 2) to_order (int): specifying to which order the SPA takes, 1-8, default to be 8 Returns 1d array: time array t(f) ''' gamma = 0.5772 total_mass = (mass_1 + mass_2) * M_sun chirp_mass = component_masses_to_chirp_mass(mass_1, mass_2) * M_sun eta = component_masses_to_symmetric_mass_ratio(mass_1, mass_2) l, m = mode f = 2 * frequency_array / m v = (G * total_mass * np.pi * frequency_array / c**3)**(1 / 3) v = v.astype('float64') tau = [1, 0, 743 / 252 + 11 / 3 * eta, -32 / 5 * np.pi, 3058673 / 508032 + 5429 / 504 * eta + 617 / 72 * eta**2, (-7729 / 252 + 13 / 3 * eta) * np.pi, -10052469856691 / 23471078400 + 128 / 3 * np.pi**2 + 6848 / 105 * gamma + (3147553127 / 3048192 - 451 / 12 * np.pi**2) * eta - 15211 / 1728 * eta**2 + 25565 / 1296 * eta**3 + 3424 / 105 * np.log(16 * v**2), (-15419335 / 127008 - 75703 / 756 * eta + 14809 / 378 * eta**2) * np.pi] t_shift = -5/256 * (G * chirp_mass)**(-5 / 3) * c**5 * (np.pi * f)**(-8 / 3) * \ sum([tau_i * v**i for i, tau_i in enumerate(tau[:to_order])]) t_shift = t_shift.astype('float64') return t_shift
def test_component_masses_to_symmetric_mass_ratio(self): symmetric_mass_ratio = conversion.component_masses_to_symmetric_mass_ratio(self.mass_1, self.mass_2) self.assertAlmostEqual(self.symmetric_mass_ratio, symmetric_mass_ratio)