本文整理汇总了Python中stingray.Powerspectrum.ps方法的典型用法代码示例。如果您正苦于以下问题:Python Powerspectrum.ps方法的具体用法?Python Powerspectrum.ps怎么用?Python Powerspectrum.ps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stingray.Powerspectrum
的用法示例。
在下文中一共展示了Powerspectrum.ps方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_classical_significances_trial_correction
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import ps [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_rebin_makes_right_attributes
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import ps [as 别名]
def test_rebin_makes_right_attributes(self):
ps = Powerspectrum(lc=self.lc, norm="Leahy")
# replace powers
ps.ps = np.ones_like(ps.ps) * 2.0
rebin_factor = 2.0
bin_ps = ps.rebin(rebin_factor*ps.df)
assert bin_ps.freq is not None
assert bin_ps.ps is not None
assert bin_ps.df == rebin_factor * 1.0 / self.lc.tseg
assert bin_ps.norm.lower() == "leahy"
assert bin_ps.m == 2
assert bin_ps.n == self.lc.time.shape[0]
assert bin_ps.nphots == np.sum(self.lc.counts)
示例3: test_pvals_is_numpy_array
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import ps [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