def _genqnmfreq(mass, spin, l, m, nmodes, qnmfreq=None): """Convenience function to generate QNM frequencies from lalsimulation. Parameters ---------- mass : float The mass of the black hole (in solar masses). spin : float The dimensionless spin of the black hole. l : int l-index of the harmonic. m : int m-index of the harmonic. nmodes : int The number of overtones to generate. qnmfreq : lal.COMPLEX16Vector, optional LAL vector to write the results into. Must be the same length as ``nmodes``. If None, will create one. Returns ------- lal.COMPLEX16Vector LAL vector containing the complex QNM frequencies. """ if qnmfreq is None: qnmfreq = lal.CreateCOMPLEX16Vector(int(nmodes)) lalsim.SimIMREOBGenerateQNMFreqV2fromFinal( qnmfreq, float(mass), float(spin), int(l), int(m), int(nmodes)) return qnmfreq
def get_lm_f0tau(mass, spin, l, m, nmodes): """Return the f_0 and the tau of each overtone for a given lm mode """ qnmfreq = lal.CreateCOMPLEX16Vector(nmodes) lalsim.SimIMREOBGenerateQNMFreqV2fromFinal(qnmfreq, float(mass), float(spin), l, m, nmodes) f_0 = [qnmfreq.data[n].real / (2 * numpy.pi) for n in range(nmodes)] tau = [1. / qnmfreq.data[n].imag for n in range(nmodes)] return f_0, tau