28 This module is a wrapper of the _spawaveform module, supplementing the C
29 code in that module with additional features that are more easily
30 implemented in Python. It is recommended that you import this module
31 rather than importing _spawaveform directly.
39 from ._spawaveform
import *
42 __author__ =
"Kipp Cannon <kipp.cannon@ligo.org>"
54 def imrchirptime(m1, m2, fLower, chi, a_hat = 0.98, e_folds = 10):
56 An approximate IMR chirptime in seconds.
58 FIXME this should be replaced by something better
60 1) compute the SPA chirptime up to ringdown frequency at 3.5 PN, verify that it is nonnegative
61 2) then add efolds worth of ringdown time
63 Ringdown decay time forumla in solar masses is:
65 tau = 2 * (m1+m2) * 5e-6 * (0.7 + 1.4187 * (1-a_hat)**-0.4990) / (1.5251 - 1.1568 * (1-a_hat)**0.1292)
67 from (7-9) of LIGO-P1300156.
71 @param fLower the starting frequency
72 @param chi the effective spin parameter from computechi()
73 @param e_folds The number of efolds to use in the ringdown signal duration, default 10
74 @param a_hat The dimensionless spin of the final black hole, default 0.98
77 assert (a_hat < 0.9999999999999999)
78 fFinal = imrffinal(m1, m2, chi,
'ringdown')
79 assert (fFinal > fLower)
80 tau = 2 * (m1+m2) * 5e-6 * (0.7 + 1.4187 * (1-a_hat)**-0.4990) / (1.5251 - 1.1568 * (1-a_hat)**0.1292)
81 inspiral_time =
chirptime(m1, m2, 7, fLower, fFinal, chi)
83 raise ValueError(
"Inspiral time is negative: m1 = %e, m2 = %e, flow = %e, chi = %e" % (m1, m2, fLower, chi))
84 return inspiral_time + e_folds * tau
89 Compute the symmetric mass ratio, eta.
91 return m1*m2/(m1+m2)**2.
94 def chirpmass(m1, m2):
96 Compute the chirp mass in seconds.
98 return lal.MTSUN_SI * (m1+m2) * eta(m1, m2)**.6
101 def ms2taus(m1, m2, f0 = 40.0):
103 Solve for tau_0 and tau_3 from m1 and m2.
105 tau0 = 5./256./(math.pi*f0)**(8./3.) * chirpmass(m1,m2)**(-5./3.)
106 tau3 = math.pi/8./eta(m1,m2)**.6/(math.pi*f0)**(5./3.) * chirpmass(m1,m2)**(-2./3.)
110 def taus2ms(tau0, tau3, f0 = 40.0):
112 Solve for m1 and m2 from tau_0 and tau_3.
114 Mc = (5./256./(math.pi*f0)**(8./3.) / tau0)**(3./5.)
115 eta = (math.pi/8./(math.pi*f0)**(5./3.) / tau3 / Mc**(2./3.))**(5./3.)
117 M = Mc / eta**(3./5.)
119 m1 = (1. + abs(1. - 4.*eta)**.5) * M / 2.
122 return m1 / lal.MTSUN_SI, m2 / lal.MTSUN_SI