本文整理汇总了Python中pycbc.types.FrequencySeries.data[kmin:]方法的典型用法代码示例。如果您正苦于以下问题:Python FrequencySeries.data[kmin:]方法的具体用法?Python FrequencySeries.data[kmin:]怎么用?Python FrequencySeries.data[kmin:]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycbc.types.FrequencySeries
的用法示例。
在下文中一共展示了FrequencySeries.data[kmin:]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_lalsimulation
# 需要导入模块: from pycbc.types import FrequencySeries [as 别名]
# 或者: from pycbc.types.FrequencySeries import data[kmin:] [as 别名]
def from_lalsimulation(func, length, delta_f, low_freq_cutoff):
"""Generate a frequency series containing the specified LALSimulation PSD.
Parameters
----------
func : function
LALSimulation PSD function.
length : int
Length of the frequency series in samples.
delta_f : float
Frequency resolution of the frequency series.
low_freq_cutoff : float
Frequencies below this value are set to zero.
Returns
-------
psd : FrequencySeries
The generated frequency series.
"""
psd = FrequencySeries(zeros(length), delta_f=delta_f)
kmin = int(low_freq_cutoff / delta_f)
psd.data[kmin:] = map(func, numpy.arange(length)[kmin:] * delta_f)
return psd