本文整理汇总了Python中stingray.Powerspectrum.ps[index]方法的典型用法代码示例。如果您正苦于以下问题:Python Powerspectrum.ps[index]方法的具体用法?Python Powerspectrum.ps[index]怎么用?Python Powerspectrum.ps[index]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stingray.Powerspectrum
的用法示例。
在下文中一共展示了Powerspectrum.ps[index]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_classical_significances_trial_correction
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import ps[index] [as 别名]
def test_classical_significances_trial_correction(self):
ps = Powerspectrum(lc=self.lc, norm="leahy")
# change the powers so that just one exceeds the threshold
ps.ps = np.zeros(ps.ps.shape[0]) + 2.0
index = 1
ps.ps[index] = 10.0
threshold = 0.01
pval = ps.classical_significances(threshold=threshold,
trial_correction=True)
assert np.size(pval) == 0
示例2: test_pvals_is_numpy_array
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import ps[index] [as 别名]
def test_pvals_is_numpy_array(self):
ps = Powerspectrum(lc=self.lc, norm="leahy")
# change the powers so that just one exceeds the threshold
ps.ps = np.zeros(ps.ps.shape[0])+2.0
index = 1
ps.ps[index] = 10.0
threshold = 1.0
pval = ps.classical_significances(threshold=threshold,
trial_correction=True)
assert isinstance(pval, np.ndarray)
assert pval.shape[0] == 2