20 import lalsimulation
as lalsim
23 def tmplttime(f0, m1, m2, j1, j2, approx):
25 approximant = lalsim.GetApproximantFromString(approx)
26 hp, hc = lalsim.SimInspiralChooseTDWaveform(
47 approximant=approximant)
48 h = numpy.array(hp.data.data, dtype=complex)
49 h += 1j * numpy.array(hc.data.data, dtype=complex)
51 n = list(abs(h)).index(0)
57 GMsun = 1.32712442099e20
64 Finds the orbital "velocity" corresponding to a gravitational
67 return (pi * G * M * f)**(1.0/3.0) / c
71 Over-estimates the chirp time in seconds from a certain frequency.
72 Uses 2 pN chirp time from some starting frequency f in Hz
73 where all negative contributions are dropped.
77 tchirp += ((743.0/252.0) + (11.0/3.0)*nu) * v**2
78 tchirp += (226.0/15.0) * chi * v**3
79 tchirp += ((3058673.0/508032.0) + (5429.0/504.0)*nu + (617.0/72.0)*nu**2) * v**4
80 tchirp *= (5.0/(256.0*nu)) * (G*M/c**3) / v**8
85 Computes the approximate ringdown frequency in Hz.
86 Here j is the reduced Kerr spin parameter, j = c^2 a / G M.
88 return (1.5251 - 1.1568 * (1 - j)**0.1292) * (c**3 / (2.0 * pi * G * M))
92 Computes the black hole ringdown time in seconds.
93 Here j is the reduced Kerr spin parameter, j = c^2 a / G M.
98 Q = 0.700 + 1.4187 * (1 - j)**-0.4990
104 Over-estimates the time from ISCO to merger in seconds.
105 Assumes one last orbit at the maximum ISCO radius.
113 r = 9.0 * G * M / c**2
114 return norbits * (2.0 * pi * r / v)
116 def overestimate_j_from_chi(chi):
118 Overestimate final black hole spin
120 return min(max(lalsim.SimIMREOBFinalMassSpin(1, 1, [0, 0, chi], [0, 0, chi], lalsim.GetApproximantFromString(
'SEOBNRv2'))[2], abs(chi)), 0.998)
122 def imr_time(f, m1, m2, j1, j2, f_max = None):
124 Returns an overestimate of the inspiral time and the
125 merger-ringdown time, both in seconds. Here, m1 and m2
126 are the component masses in kg, j1 and j2 are the dimensionless
127 spin parameters of the components.
130 if f_max
is not None and f_max < f:
131 raise ValueError(
"f_max must either be None or greater than f")
144 j = overestimate_j_from_chi(chi)
147 warnings.warn(
"f is greater than the ringdown frequency. This might not be what you intend to compute")
149 if f_max
is None or f_max > ringf(M, j):
150 return chirptime(f, M, nu, chi) + mergetime(M) + ringtime(M, j)
155 return imr_time(f, m1, m2, j1, j2) - imr_time(f_max, m1, m2, j1, j2)