Пример #1
0
def _get_imr_duration(m1, m2, s1z, s2z, f_low, approximant="SEOBNRv4"):
    """Wrapper of lalsimulation template duration approximate formula"""
    m1, m2, s1z, s2z, f_low = float(m1), float(m2), float(s1z), float(s2z),\
                              float(f_low)
    if approximant == "SEOBNRv2":
        chi = lalsimulation.SimIMRPhenomBComputeChi(m1, m2, s1z, s2z)
        time_length = lalsimulation.SimIMRSEOBNRv2ChirpTimeSingleSpin(
                                m1 * lal.MSUN_SI, m2 * lal.MSUN_SI, chi, f_low)
    elif approximant == "IMRPhenomD":
        time_length = lalsimulation.SimIMRPhenomDChirpTime(
                           m1 * lal.MSUN_SI, m2 * lal.MSUN_SI, s1z, s2z, f_low)
    elif approximant == "SEOBNRv4":
        # NB for no clear reason this function has f_low as first argument
        time_length = lalsimulation.SimIMRSEOBNRv4ROMTimeOfFrequency(
                           f_low, m1 * lal.MSUN_SI, m2 * lal.MSUN_SI, s1z, s2z)
    elif approximant == 'SPAtmplt' or approximant == 'TaylorF2':
        chi = lalsimulation.SimInspiralTaylorF2ReducedSpinComputeChi(
            m1, m2, s1z, s2z
        )
        time_length = lalsimulation.SimInspiralTaylorF2ReducedSpinChirpTime(
            f_low, m1 * lal.MSUN_SI, m2 * lal.MSUN_SI, chi, -1
        )
    else:
        raise RuntimeError("I can't calculate a duration for %s" % approximant)
    # FIXME Add an extra factor of 1.1 for 'safety' since the duration
    # functions are approximate
    return time_length * 1.1
Пример #2
0
 def _get_dur(self):
     dur = lalsim.SimIMRPhenomDChirpTime(self.m1 * MSUN_SI,
                                         self.m2 * MSUN_SI, self.spin1z,
                                         self.spin2z, self.flow)
     # add a 10% to be consistent with PyCBC's duration estimate,
     # may want to FIXME if that changes
     return dur * 1.1
Пример #3
0
def imrphenomd_length_in_time(**kwds):
    mass1 = float(kwds['mass1'])
    mass2 = float(kwds['mass2'])
    spin1z = float(kwds['spin1z'])
    spin2z = float(kwds['spin2z'])
    fmin = float(kwds['f_lower'])
    time_length = lalsimulation.SimIMRPhenomDChirpTime(mass1 * lal.MSUN_SI,
                                                       mass2 * lal.MSUN_SI,
                                                       spin1z, spin2z, fmin)
    # FIXME add a 10% error margin for consistency
    # with seobnrrom_length_in_time()
    return time_length * 1.1