當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。