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
def _get_dur(self): seff = lalsim.SimIMRPhenomBComputeChi(self.m1, self.m2, self.spin1z, self.spin2z) dur = lalsim.SimIMRSEOBNRv2ChirpTimeSingleSpin( self.m1 * MSUN_SI, self.m2 * MSUN_SI, seff, self.flow) # add a 10% to be consistent with PyCBC's duration estimate, # may want to FIXME if that changes return dur * 1.1
def _get_seobnrrom_duration(m1, m2, s1z, s2z, f_low): """Wrapper of lalsimulation template duration approximate formula""" m1, m2, s1z, s2z, f_low = float(m1), float(m2), float(s1z), float(s2z),\ float(f_low) chi = lalsimulation.SimIMRPhenomBComputeChi(m1, m2, s1z, s2z) time_length = lalsimulation.SimIMRSEOBNRv2ChirpTimeSingleSpin( m1 * lal.MSUN_SI, m2 * lal.MSUN_SI, chi, f_low) # FIXME The function seobnrrom_length_in_time() in waveform.py adds an # extra factor of 1.1 for 'safety'. For consistency with that code we do # that here. THIS IS FRAGILE AND HACKY return time_length * 1.1
def seobnrv2_length_in_time(**kwds): """Stub for holding the calculation of ROM waveform duration. """ mass1 = float(kwds['mass1']) mass2 = float(kwds['mass2']) spin1z = float(kwds['spin1z']) spin2z = float(kwds['spin2z']) fmin = float(kwds['f_lower']) chi = lalsimulation.SimIMRPhenomBComputeChi(mass1, mass2, spin1z, spin2z) time_length = lalsimulation.SimIMRSEOBNRv2ChirpTimeSingleSpin( mass1 * lal.MSUN_SI, mass2 * lal.MSUN_SI, chi, fmin) # FIXME: This is still approximate so add a 10% error margin time_length = time_length * 1.1 return time_length
def seobnrrom_length_in_time(**kwds): """ This is a stub for holding the calculation for getting length of the ROM waveforms. """ mass1 = kwds['mass1'] mass2 = kwds['mass2'] spin1z = kwds['spin1z'] spin2z = kwds['spin2z'] fmin = kwds['f_lower'] chi = lalsimulation.SimIMRPhenomBComputeChi(mass1, mass2, spin1z, spin2z) time_length = lalsimulation.SimIMRSEOBNRv2ChirpTimeSingleSpin( mass1 * lal.MSUN_SI, mass2 * lal.MSUN_SI, chi, fmin) # FIXME: This is still approximate so add a 10% error margin time_length = time_length * 1.1 return time_length