24 import lalsimulation
as lalsim
27 def tmplttime(f0, m1, m2, j1, j2, approx):
29 approximant = lalsim.GetApproximantFromString(approx)
30 hp, hc = lalsim.SimInspiralChooseTDWaveform(
51 approximant=approximant)
52 h = numpy.array(hp.data.data, dtype=complex)
53 h += 1j * numpy.array(hc.data.data, dtype=complex)
55 n = list(abs(h)).index(0)
61 GMsun = 1.32712442099e20
68 Finds the orbital "velocity" corresponding to a gravitational
71 return (pi * G * M * f)**(1.0/3.0) / c
75 Over-estimates the chirp time in seconds from a certain frequency.
76 Uses 2 pN chirp time from some starting frequency f in Hz
77 where all negative contributions are dropped.
81 tchirp += ((743.0/252.0) + (11.0/3.0)*nu) * v**2
82 tchirp += (226.0/15.0) * chi * v**3
83 tchirp += ((3058673.0/508032.0) + (5429.0/504.0)*nu + (617.0/72.0)*nu**2) * v**4
84 tchirp *= (5.0/(256.0*nu)) * (G*M/c**3) / v**8
89 Computes the approximate ringdown frequency in Hz.
90 Here j is the reduced Kerr spin parameter, j = c^2 a / G M.
92 return (1.5251 - 1.1568 * (1 - j)**0.1292) * (c**3 / (2.0 * pi * G * M))
96 Computes the black hole ringdown time in seconds.
97 Here j is the reduced Kerr spin parameter, j = c^2 a / G M.
102 Q = 0.700 + 1.4187 * (1 - j)**-0.4990
108 Over-estimates the time from ISCO to merger in seconds.
109 Assumes one last orbit at the maximum ISCO radius.
117 r = 9.0 * G * M / c**2
118 return norbits * (2.0 * pi * r / v)
120 def overestimate_j_from_chi(chi):
122 Overestimate final black hole spin
124 return min(max(lalsim.SimIMREOBFinalMassSpin(1, 1, [0, 0, chi], [0, 0, chi], lalsim.GetApproximantFromString(
'SEOBNRv2'))[2], abs(chi)), 0.998)
126 def imr_time(f, m1, m2, j1, j2, f_max = None):
128 Returns an overestimate of the inspiral time and the
129 merger-ringdown time, both in seconds. Here, m1 and m2
130 are the component masses in kg, j1 and j2 are the dimensionless
131 spin parameters of the components.
134 if f_max
is not None and f_max < f:
135 raise ValueError(
"f_max must either be None or greater than f")
148 j = overestimate_j_from_chi(chi)
151 warnings.warn(
"f is greater than the ringdown frequency. This might not be what you intend to compute")
153 if f_max
is None or f_max > ringf(M, j):
154 return chirptime(f, M, nu, chi) + mergetime(M) + ringtime(M, j)
159 return imr_time(f, m1, m2, j1, j2) - imr_time(f_max, m1, m2, j1, j2)