本文整理汇总了Python中pycbc.types.TimeSeries.lal方法的典型用法代码示例。如果您正苦于以下问题:Python TimeSeries.lal方法的具体用法?Python TimeSeries.lal怎么用?Python TimeSeries.lal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycbc.types.TimeSeries
的用法示例。
在下文中一共展示了TimeSeries.lal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_waveform_from_inspiral
# 需要导入模块: from pycbc.types import TimeSeries [as 别名]
# 或者: from pycbc.types.TimeSeries import lal [as 别名]
def _get_waveform_from_inspiral(**p):
import lalmetaio
# prefix with 'Inspiral-'
name = p['approximant'][9:]
if name.startswith('EOB'):
p['phase_order'] = -8
params = lalmetaio.SimInspiralTable()
params.waveform = name + string_from_order[p['phase_order']]
params.mass1= p['mass1']
params.mass2= p['mass2']
params.f_lower = p['f_lower']
params.spin1x = p['spin1x']
params.spin1y = p['spin1y']
params.spin1z = p['spin1z']
params.spin2x = p['spin2x']
params.spin2y = p['spin2y']
params.spin2z = p['spin2z']
params.inclination = p['inclination']
params.distance = p['distance']
params.coa_phase = p['coa_phase']
import lalinspiral
guess_length = lalinspiral.FindChirpChirpTime(params.mass1, params.mass2,
params.f_lower, 7)
guess_length = max(guess_length, 3)
params.geocent_end_time = guess_length * 1.5
params.taper = 'TAPER_NONE' #FIXME - either explain or don't hardcode this
bufferl = guess_length * 2
dt = p['delta_t']
df = 1.0 / bufferl
sample_rate = int(1.0 / dt)
epoch = lal.LIGOTimeGPS(0, 0)
N = bufferl * sample_rate
n = N / 2 + 1
resp = FrequencySeries(zeros(n), delta_f=df, epoch=epoch,
dtype=complex64) + 1
out = TimeSeries(zeros(N), delta_t=dt, epoch=epoch, dtype=float32)
outl = out.lal()
outl.sampleUnits = lal.ADCCountUnit
out2 = TimeSeries(zeros(N), delta_t=dt, epoch=epoch, dtype=float32)
outl2 = out.lal()
outl2.sampleUnits = lal.ADCCountUnit
respl = resp.lal()
respl.sampleUnits = lal.DimensionlessUnit
lalinspiral.FindChirpInjectSignals(outl, params, respl)
params.coa_phase -= lal.PI / 4
lalinspiral.FindChirpInjectSignals(outl2, params, respl)
seriesp = TimeSeries(outl.data.data, delta_t=dt,
epoch=epoch - params.geocent_end_time)
seriesc = TimeSeries(outl2.data.data, delta_t=dt,
epoch=epoch - params.geocent_end_time)
return seriesp, seriesc