当前位置: 首页>>代码示例>>Python>>正文


Python FrequencySeries.lal方法代码示例

本文整理汇总了Python中pycbc.types.FrequencySeries.lal方法的典型用法代码示例。如果您正苦于以下问题:Python FrequencySeries.lal方法的具体用法?Python FrequencySeries.lal怎么用?Python FrequencySeries.lal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pycbc.types.FrequencySeries的用法示例。


在下文中一共展示了FrequencySeries.lal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_waveform_from_inspiral

# 需要导入模块: from pycbc.types import FrequencySeries [as 别名]
# 或者: from pycbc.types.FrequencySeries 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
开发者ID:shasvath,项目名称:pycbc,代码行数:63,代码来源:waveform.py


注:本文中的pycbc.types.FrequencySeries.lal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。