本文整理汇总了Python中stingray.Powerspectrum.classical_significances方法的典型用法代码示例。如果您正苦于以下问题:Python Powerspectrum.classical_significances方法的具体用法?Python Powerspectrum.classical_significances怎么用?Python Powerspectrum.classical_significances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stingray.Powerspectrum
的用法示例。
在下文中一共展示了Powerspectrum.classical_significances方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_classical_significances_trial_correction
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import classical_significances [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.power = np.zeros_like(ps.power) + 2.0
index = 1
ps.power[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 classical_significances [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.power = np.zeros_like(ps.power) + 2.0
index = 1
ps.power[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
示例3: test_classical_significances_threshold
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import classical_significances [as 别名]
def test_classical_significances_threshold(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=False)
assert pval[0, 0] < threshold
assert pval[1, 0] == index
示例4: test_classical_significances_fails_in_rms
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import classical_significances [as 别名]
def test_classical_significances_fails_in_rms(self):
ps = Powerspectrum(lc=self.lc, norm="frac")
with pytest.raises(ValueError):
ps.classical_significances()
示例5: test_classical_significances_runs
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import classical_significances [as 别名]
def test_classical_significances_runs(self):
ps = Powerspectrum(lc=self.lc, norm="Leahy")
ps.classical_significances()
示例6: test_classical_significances_fails_in_rms
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import classical_significances [as 别名]
def test_classical_significances_fails_in_rms(self):
ps = Powerspectrum(lc=self.lc, norm="rms")
ps.classical_significances()