def get_fd_waveform_sequence(template=None, **kwds): """Return values of the waveform evaluated at the sequence of frequency points. Parameters ---------- template: object An object that has attached properties. This can be used to substitute for keyword arguments. A common example would be a row in an xml table. {params} Returns ------- hplustilde: Array The plus phase of the waveform in frequency domain evaluated at the frequency points. hcrosstilde: Array The cross phase of the waveform in frequency domain evaluated at the frequency points. """ kwds['delta_f'] = -1 kwds['f_lower'] = -1 p = props(template, required_args=parameters.cbc_fd_required, **kwds) lal_pars = _check_lal_pars(p) hp, hc = lalsimulation.SimInspiralChooseFDWaveformSequence( float(p['coa_phase']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), lal_pars, _lalsim_enum[p['approximant']], p['sample_points'].lal()) return Array(hp.data.data), Array(hc.data.data)
def _lalsim_fd_waveform(**p): flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p["spin_order"]) lalsimulation.SimInspiralSetTidalOrder(flags, p["tidal_order"]) hp1, hc1 = lalsimulation.SimInspiralChooseFDWaveform( float(p["coa_phase"]), p["delta_f"], float(pnutils.solar_mass_to_kg(p["mass1"])), float(pnutils.solar_mass_to_kg(p["mass2"])), float(p["spin1x"]), float(p["spin1y"]), float(p["spin1z"]), float(p["spin2x"]), float(p["spin2y"]), float(p["spin2z"]), float(p["f_lower"]), float(p["f_final"]), float(p["f_ref"]), pnutils.megaparsecs_to_meters(float(p["distance"])), float(p["inclination"]), float(p["lambda1"]), float(p["lambda2"]), flags, None, int(p["amplitude_order"]), int(p["phase_order"]), _lalsim_enum[p["approximant"]], ) hp = FrequencySeries(hp1.data.data[:], delta_f=hp1.deltaF, epoch=hp1.epoch) hc = FrequencySeries(hc1.data.data[:], delta_f=hc1.deltaF, epoch=hc1.epoch) return hp, hc
def _lalsim_fd_waveform(**p): flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p['spin_order']) lalsimulation.SimInspiralSetTidalOrder(flags, p['tidal_order']) hp, hc = lalsimulation.SimInspiralChooseFDWaveform( float(p['coa_phase']), float(p['delta_f']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_lower']), float(p['f_final']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['lambda1']), float(p['lambda2']), flags, None, int(p['amplitude_order']), int(p['phase_order']), _lalsim_enum[p['approximant']]) hp = FrequencySeries(hp.data.data[:] * 1, delta_f=hp.deltaF, epoch=hp.epoch) hc = FrequencySeries(hc.data.data[:] * 1, delta_f=hc.deltaF, epoch=hc.epoch) return hp, hc
def _lalsim_fd_waveform(**p): lal_pars = lal.CreateDict() if p['phase_order'] != -1: lalsimulation.SimInspiralWaveformParamsInsertPNPhaseOrder( lal_pars, int(p['phase_order'])) if p['amplitude_order'] != -1: lalsimulation.SimInspiralWaveformParamsInsertPNAmplitudeOrder( lal_pars, int(p['amplitude_order'])) if p['spin_order'] != -1: lalsimulation.SimInspiralWaveformParamsInsertPNSpinOrder( lal_pars, int(p['spin_order'])) if p['tidal_order'] != -1: lalsimulation.SimInspiralWaveformParamsInsertPNTidalOrder( lal_pars, p['tidal_order']) if p['eccentricity_order'] != -1: lalsimulation.SimInspiralWaveformParamsInsertPNEccentricityOrder( lal_pars, p['eccentricity_order']) if p['lambda1']: lalsimulation.SimInspiralWaveformParamsInsertPNTidalLambda1( lal_pars, p['lambda1']) if p['lambda2']: lalsimulation.SimInspiralWaveformParamsInsertPNTidalLambda2( lal_pars, p['lambda2']) if p['dquad_mon1']: lalsimulation.SimInspiralWaveformParamsInsertPNTidaldQuadMon1( lal_pars, p['dquad_mon1']) if p['dquad_mon2']: lalsimulation.SimInspiralWaveformParamsInsertPNTidaldQuadMon2( lal_pars, p['dquad_mon2']) if p['numrel_data']: lalsimulation.SimInspiralWaveformParamsInsertNumRelData( lal_pars, str(p['numrel_data'])) if p['modes_choice']: lalsimulation.SimInspiralWaveformParamsInsertModesChoice( lal_pars, p['modes_choice']) if p['frame_axis']: lalsimulation.SimInspiralWaveformParamsInsertFrameAxis( lal_pars, p['frame_axis']) if p['side_bands']: lalsimulation.SimInspiralWaveformParamsInsertSideband( lal_pars, p['side_bands']) #nonGRparams can be straightforwardly added if needed, however they have to # be invoked one by one hp1, hc1 = lalsimulation.SimInspiralChooseFDWaveform( float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['coa_phase']), float(p['long_asc_nodes']), float(p['eccentricity']), float(p['mean_per_ano']), p['delta_f'], float(p['f_lower']), float(p['f_final']), float(p['f_ref']), lal_pars, _lalsim_enum[p['approximant']]) hp = FrequencySeries(hp1.data.data[:], delta_f=hp1.deltaF, epoch=hp1.epoch) hc = FrequencySeries(hc1.data.data[:], delta_f=hc1.deltaF, epoch=hc1.epoch) #lal.DestroyDict(lal_pars) return hp, hc
def _lalsim_td_waveform(**p): flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p['spin_order']) lalsimulation.SimInspiralSetTidalOrder(flags, p['tidal_order']) if p['numrel_data']: lalsimulation.SimInspiralSetNumrelData(flags, str(p['numrel_data'])) hp1, hc1 = lalsimulation.SimInspiralChooseTDWaveform(float(p['coa_phase']), float(p['delta_t']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_lower']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['lambda1']), float(p['lambda2']), flags, None, int(p['amplitude_order']), int(p['phase_order']), _lalsim_enum[p['approximant']]) hp = TimeSeries(hp1.data.data[:], delta_t=hp1.deltaT, epoch=hp1.epoch) hc = TimeSeries(hc1.data.data[:], delta_t=hc1.deltaT, epoch=hc1.epoch) return hp, hc
def get_fd_waveform_sequence(template=None, **kwds): """Return values of the waveform evaluated at the sequence of frequency points. Parameters ---------- template: object An object that has attached properties. This can be used to substitute for keyword arguments. A common example would be a row in an xml table. {params} Returns ------- hplustilde: Array The plus phase of the waveform in frequency domain evaluated at the frequency points. hcrosstilde: Array The cross phase of the waveform in frequency domain evaluated at the frequency points. """ kwds["delta_f"] = -1 kwds["f_lower"] = -1 p = props(template, **kwds) flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p["spin_order"]) lalsimulation.SimInspiralSetTidalOrder(flags, p["tidal_order"]) hp, hc = lalsimulation.SimInspiralChooseFDWaveformSequence( float(p["coa_phase"]), float(pnutils.solar_mass_to_kg(p["mass1"])), float(pnutils.solar_mass_to_kg(p["mass2"])), float(p["spin1x"]), float(p["spin1y"]), float(p["spin1z"]), float(p["spin2x"]), float(p["spin2y"]), float(p["spin2z"]), float(p["f_ref"]), pnutils.megaparsecs_to_meters(float(p["distance"])), float(p["inclination"]), float(p["lambda1"]), float(p["lambda2"]), flags, None, int(p["amplitude_order"]), int(p["phase_order"]), _lalsim_enum[p["approximant"]], p["sample_points"].lal(), ) return Array(hp.data.data), Array(hc.data.data)
def _lalsim_fd_sequence(**p): """ Shim to interface to lalsimulation SimInspiralChooseFDWaveformSequence """ lal_pars = _check_lal_pars(p) hp, hc = lalsimulation.SimInspiralChooseFDWaveformSequence( float(p['coa_phase']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), lal_pars, _lalsim_enum[p['approximant']], p['sample_points'].lal()) return Array(hp.data.data), Array(hc.data.data)
def _lalsim_fd_waveform(**p): lal_pars = lal.CreateDict() if p['phase_order']!=-1: lalsimulation.SimInspiralWaveformParamsInsertPNPhaseOrder(lal_pars,int(p['phase_order'])) if p['amplitude_order']!=-1: lalsimulation.SimInspiralWaveformParamsInsertPNAmplitudeOrder(lal_pars,int(p['amplitude_order'])) if p['spin_order']!=-1: lalsimulation.SimInspiralWaveformParamsInsertPNSpinOrder(lal_pars,int(p['spin_order'])) if p['tidal_order']!=-1: lalsimulation.SimInspiralWaveformParamsInsertPNTidalOrder(lal_pars, p['tidal_order']) if p['eccentricity_order']!=-1: lalsimulation.SimInspiralWaveformParamsInsertPNEccentricityOrder(lal_pars, p['eccentricity_order']) if p['lambda1']: lalsimulation.SimInspiralWaveformParamsInsertPNTidalLambda1(lal_pars, p['lambda1']) if p['lambda2']: lalsimulation.SimInspiralWaveformParamsInsertPNTidalLambda2(lal_pars, p['lambda2']) if p['dquad_mon1']: lalsimulation.SimInspiralWaveformParamsInsertPNTidaldQuadMon1(lal_pars, p['dquad_mon1']) if p['dquad_mon2']: lalsimulation.SimInspiralWaveformParamsInsertPNTidaldQuadMon2(lal_pars, p['dquad_mon2']) if p['numrel_data']: lalsimulation.SimInspiralSetNumrelData(lal_pars, str(p['numrel_data'])) if p['modes_choice']: lalsimulation.SimInspiralWaveformParamsInsertModesChoice(lal_pars, p['modes_choice']) if p['frame_axis']: lalsimulation.SimInspiralWaveformParamsInsertFrameAxis(lal_pars, p['frame_axis']) if p['side_bands']: lalsimulation.SimInspiralWaveformParamsInsertSideband(lal_pars, p['side_bands']) #nonGRparams can be straightforwardly added if needed, however they have to # be invoked one by one hp1, hc1 = lalsimulation.SimInspiralChooseFDWaveform( float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['coa_phase']), float(p['long_asc_nodes']), float(p['eccentricity']), float(p['mean_per_ano']), p['delta_f'], float(p['f_lower']), float(p['f_final']), float(p['f_ref']), lal_pars, _lalsim_enum[p['approximant']]) hp = FrequencySeries(hp1.data.data[:], delta_f=hp1.deltaF, epoch=hp1.epoch) hc = FrequencySeries(hc1.data.data[:], delta_f=hc1.deltaF, epoch=hc1.epoch) #lal.DestroyDict(lal_pars) return hp, hc
def _lalsim_fd_waveform(**p): flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p['spin_order']) lalsimulation.SimInspiralSetTidalOrder(flags, p['tidal_order']) #------------------------------------------------ # SM: Added to pull out harmonics #------------------------------------------------ if p['sideband'] != None: nonGRparams = lalsimulation.SimInspiralCreateTestGRParam( 'sideband', p['sideband']) else: nonGRparams = None hp, hc = lalsimulation.SimInspiralChooseFDWaveform( float(p['coa_phase']), float(p['delta_f']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_lower']), float(p['f_final']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['lambda1']), float(p['lambda2']), flags, nonGRparams, #Replaced flags, None > flags, nonGRparams int(p['amplitude_order']), int(p['phase_order']), _lalsim_enum[p['approximant']]) hp = FrequencySeries(hp.data.data[:] * 1, delta_f=hp.deltaF, epoch=hp.epoch) hc = FrequencySeries(hc.data.data[:] * 1, delta_f=hc.deltaF, epoch=hc.epoch) return hp, hc
def _lalsim_fd_waveform(**p): lal_pars = _check_lal_pars(p) hp1, hc1 = lalsimulation.SimInspiralChooseFDWaveform( float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['coa_phase']), float(p['long_asc_nodes']), float(p['eccentricity']), float(p['mean_per_ano']), p['delta_f'], float(p['f_lower']), float(p['f_final']), float(p['f_ref']), lal_pars, _lalsim_enum[p['approximant']]) hp = FrequencySeries(hp1.data.data[:], delta_f=hp1.deltaF, epoch=hp1.epoch) hc = FrequencySeries(hc1.data.data[:], delta_f=hc1.deltaF, epoch=hc1.epoch) #lal.DestroyDict(lal_pars) return hp, hc
def _lalsim_td_waveform(**p): fail_tolerant_waveform_generation lal_pars = _check_lal_pars(p) #nonGRparams can be straightforwardly added if needed, however they have to # be invoked one by one try: hp1, hc1 = lalsimulation.SimInspiralChooseTDWaveform( float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['coa_phase']), float(p['long_asc_nodes']), float(p['eccentricity']), float(p['mean_per_ano']), float(p['delta_t']), float(p['f_lower']), float(p['f_ref']), lal_pars, _lalsim_enum[p['approximant']]) except RuntimeError: if not fail_tolerant_waveform_generation: raise # For some cases failure modes can occur. Here we add waveform-specific # instructions to try to work with waveforms that are known to fail. if 'SEOBNRv3' in p['approximant']: # Try doubling the sample time and redoing. # Don't want to get stuck in a loop though! if 'delta_t_orig' not in p: p['delta_t_orig'] = p['delta_t'] p['delta_t'] = p['delta_t'] / 2. if p['delta_t_orig'] / p['delta_t'] > 9: raise hp, hc = _lalsim_td_waveform(**p) p['delta_t'] = p['delta_t_orig'] hp = resample_to_delta_t(hp, hp.delta_t*2) hc = resample_to_delta_t(hc, hc.delta_t*2) return hp, hc raise #lal.DestroyDict(lal_pars) hp = TimeSeries(hp1.data.data[:], delta_t=hp1.deltaT, epoch=hp1.epoch) hc = TimeSeries(hc1.data.data[:], delta_t=hc1.deltaT, epoch=hc1.epoch) return hp, hc
def _lalsim_td_waveform(**p): flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p['spin_order']) lalsimulation.SimInspiralSetTidalOrder(flags, p['tidal_order']) ########### def rulog2(val): return 2.0**numpy.ceil(numpy.log2(float(val))) f_final = rulog2(seobnrrom_final_frequency(**p)) f_nyq = 0.5 / p['delta_t'] if f_final > f_nyq: print 'Final frequecny {0} is greater than given nyquist frequecny {1}'.format( f_final, f_nyq) p['delta_t'] = 0.5 / f_final ########## if p['numrel_data']: lalsimulation.SimInspiralSetNumrelData(flags, str(p['numrel_data'])) hp1, hc1 = lalsimulation.SimInspiralChooseTDWaveform( float(p['coa_phase']), float(p['delta_t']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_lower']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['lambda1']), float(p['lambda2']), flags, None, int(p['amplitude_order']), int(p['phase_order']), _lalsim_enum[p['approximant']]) hp = TimeSeries(hp1.data.data[:], delta_t=hp1.deltaT, epoch=hp1.epoch) hc = TimeSeries(hc1.data.data[:], delta_t=hc1.deltaT, epoch=hc1.epoch) if f_final > f_nyq: p['delta_t'] = 0.5 / f_nyq print "Need to resample at delta_t {0}".format(p['delta_t']) hp = resample_to_delta_t(hp, p['delta_t']) hc = resample_to_delta_t(hc, p['delta_t']) return hp, hc
def _lalsim_td_waveform(**p): lal_pars = _check_lal_pars(p) #nonGRparams can be straightforwardly added if needed, however they have to # be invoked one by one hp1, hc1 = lalsimulation.SimInspiralChooseTDWaveform( float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['coa_phase']), float(p['long_asc_nodes']), float(p['eccentricity']), float(p['mean_per_ano']), float(p['delta_t']), float(p['f_lower']), float(p['f_ref']), lal_pars, _lalsim_enum[p['approximant']]) #lal.DestroyDict(lal_pars) hp = TimeSeries(hp1.data.data[:], delta_t=hp1.deltaT, epoch=hp1.epoch) hc = TimeSeries(hc1.data.data[:], delta_t=hc1.deltaT, epoch=hc1.epoch) return hp, hc
def get_fd_waveform_sequence(template=None, **kwds): """Return values of the waveform evaluated at the sequence of frequency points. Parameters ---------- template: object An object that has attached properties. This can be used to substitute for keyword arguments. A common example would be a row in an xml table. {params} Returns ------- hplustilde: Array The plus phase of the waveform in frequency domain evaluated at the frequency points. hcrosstilde: Array The cross phase of the waveform in frequency domain evaluated at the frequency points. """ kwds['delta_f'] = -1 kwds['f_lower'] = -1 p = props(template, **kwds) lal_pars = _check_lal_pars(p) flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p['spin_order']) lalsimulation.SimInspiralSetTidalOrder(flags, p['tidal_order']) hp, hc = lalsimulation.SimInspiralChooseFDWaveformSequence(float(p['coa_phase']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), lal_pars, _lalsim_enum[p['approximant']], p['sample_points'].lal()) return Array(hp.data.data), Array(hc.data.data)
def _lalsim_td_waveform(**p): flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p['spin_order']) lalsimulation.SimInspiralSetTidalOrder(flags, p['tidal_order']) if p['numrel_data']: lalsimulation.SimInspiralSetNumrelData(flags, str(p['numrel_data'])) hp1, hc1 = lalsimulation.SimInspiralChooseTDWaveform( float(p['coa_phase']), float(p['delta_t']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_lower']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['lambda1']), float(p['lambda2']), flags, None, int(p['amplitude_order']), int(p['phase_order']), _lalsim_enum[p['approximant']]) hp = TimeSeries(hp1.data.data[:], delta_t=hp1.deltaT, epoch=hp1.epoch) hc = TimeSeries(hc1.data.data[:], delta_t=hc1.deltaT, epoch=hc1.epoch) return hp, hc
def _lalsim_fd_waveform(**p): flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p['spin_order']) lalsimulation.SimInspiralSetTidalOrder(flags, p['tidal_order']) hp, hc = lalsimulation.SimInspiralChooseFDWaveform(float(p['coa_phase']), float(p['delta_f']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_lower']), float(p['f_final']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['lambda1']), float(p['lambda2']), flags, None, int(p['amplitude_order']), int(p['phase_order']), _lalsim_enum[p['approximant']]) hp = FrequencySeries(hp.data.data[:]*1, delta_f=hp.deltaF, epoch=hp.epoch) hc = FrequencySeries(hc.data.data[:]*1, delta_f=hc.deltaF, epoch=hc.epoch) return hp, hc
# add what we need p = default_args p['mass1']=10. p['mass2']=10. p['delta_t'] = 1./4096 p['f_lower'] = 40. p['approximant']='IMRPhenomD' lal_pars = _check_lal_pars(p) # make the waveform hp1, hc1 = lalsimulation.SimInspiralChooseTDWaveform( float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['coa_phase']), float(p['long_asc_nodes']), float(p['eccentricity']), float(p['mean_per_ano']), float(p['delta_t']), float(p['f_lower']), float(p['f_ref']), lal_pars, _lalsim_enum[p['approximant']]) hp = TimeSeries(hp1.data.data[:], delta_t=hp1.deltaT, epoch=hp1.epoch) ''' p['dchi0'] = 1 lal_pars = _check_lal_pars(p) sp1, sc1 = lalsimulation.SimInspiralChooseTDWaveform( float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']),
def get_fd_waveform_sequence(template=None, **kwds): """ Return values of the waveform evaluated at the sequence of frequency points. Parameters ---------- template: object An object that has attached properties. This can be used to substitute for keyword arguments. A common example would be a row in an xml table. approximant : string A string that indicates the chosen approximant. See `fd_approximants` for available options. mass1 : float The mass of the first component object in the binary in solar masses. mass2 : float The mass of the second component object in the binary in solar masses. f_ref : {float}, optional The reference frequency. distance : {1, float}, optional The distance from the observer to the source in megaparsecs. inclination : {0, float}, optional The inclination angle of the source. coa_phase : {0, float}, optional The final phase or phase at the peak of the waveform. See documentation on specific approximants for exact usage. spin1x : {0, float}, optional The x component of the first binary component's spin vector. spin1y : {0, float}, optional y component of the first binary component's spin. spin1z : {0, float}, optional z component of the first binary component's spin. spin2x : {0, float}, optional The x component of the second binary component's spin vector. spin2y : {0, float}, optional y component of the second binary component's spin. spin2z : {0, float}, optional z component of the second binary component's spin. lambda1: {0, float}, optional The tidal deformability parameter of object 1. lambda2: {0, float}, optional The tidal deformability parameter of object 2. phase_order: {-1, int}, optional The pN order of the orbital phase. The default of -1 indicates that all implemented orders are used. spin_order: {-1, int}, optional The pN order of the spin corrections. The default of -1 indicates that all implemented orders are used. tidal_order: {-1, int}, optional The pN order of the tidal corrections. The default of -1 indicates that all implemented orders are used. amplitude_order: {-1, int}, optional The pN order of the amplitude. The default of -1 indicates that all implemented orders are used. Returns ------- hplustilde: Array The plus phase of the waveform in frequency domain evaluated at the frequency points. hcrosstilde: Array The cross phase of the waveform in frequency domain evaluated at the frequency points. """ kwds['delta_f'] = -1 kwds['f_lower'] = -1 p = props(template, **kwds) flags = lalsimulation.SimInspiralCreateWaveformFlags() lalsimulation.SimInspiralSetSpinOrder(flags, p['spin_order']) lalsimulation.SimInspiralSetTidalOrder(flags, p['tidal_order']) hp, hc = lalsimulation.SimInspiralChooseFDWaveformSequence(float(p['coa_phase']), float(pnutils.solar_mass_to_kg(p['mass1'])), float(pnutils.solar_mass_to_kg(p['mass2'])), float(p['spin1x']), float(p['spin1y']), float(p['spin1z']), float(p['spin2x']), float(p['spin2y']), float(p['spin2z']), float(p['f_ref']), pnutils.megaparsecs_to_meters(float(p['distance'])), float(p['inclination']), float(p['lambda1']), float(p['lambda2']), flags, None, int(p['amplitude_order']), int(p['phase_order']), _lalsim_enum[p['approximant']], p['sample_points'].lal()) return Array(hp.data.data), Array(hc.data.data)