本文整理汇总了Python中stingray.Powerspectrum.compute_rms方法的典型用法代码示例。如果您正苦于以下问题:Python Powerspectrum.compute_rms方法的具体用法?Python Powerspectrum.compute_rms怎么用?Python Powerspectrum.compute_rms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stingray.Powerspectrum
的用法示例。
在下文中一共展示了Powerspectrum.compute_rms方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_fractional_rms_in_frac_norm_is_consistent
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import compute_rms [as 别名]
def test_fractional_rms_in_frac_norm_is_consistent(self):
time = np.arange(0, 100, 1) + 0.5
poisson_counts = np.random.poisson(100.0,
size=time.shape[0])
lc = Lightcurve(time, counts=poisson_counts, dt=1,
gti=[[0, 100]])
ps = Powerspectrum(lc=lc, norm="leahy")
rms_ps_l, rms_err_l = ps.compute_rms(min_freq=ps.freq[1],
max_freq=ps.freq[-1], white_noise_offset=0)
ps = Powerspectrum(lc=lc, norm="frac")
rms_ps, rms_err = ps.compute_rms(min_freq=ps.freq[1],
max_freq=ps.freq[-1], white_noise_offset=0)
assert np.allclose(rms_ps, rms_ps_l, atol=0.01)
assert np.allclose(rms_err, rms_err_l, atol=0.01)
示例2: test_fractional_rms_in_leahy_norm
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import compute_rms [as 别名]
def test_fractional_rms_in_leahy_norm(self):
"""
fractional rms should only be *approximately* equal the standard
deviation divided by the mean of the light curve. Therefore, we allow
for a larger tolerance in np.isclose()
"""
ps = Powerspectrum(lc=self.lc, norm="Leahy")
rms_ps, rms_err = ps.compute_rms(min_freq=ps.freq[0],
max_freq=ps.freq[-1])
rms_lc = np.std(self.lc.counts) / np.mean(self.lc.counts)
assert np.isclose(rms_ps, rms_lc, atol=0.01)
示例3: test_fractional_rms_fails_when_rms_not_leahy
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import compute_rms [as 别名]
def test_fractional_rms_fails_when_rms_not_leahy(self):
with pytest.raises(Exception):
ps = Powerspectrum(lc=self.lc, norm="rms")
rms_ps, rms_err = ps.compute_rms(min_freq=ps.freq[0],
max_freq=ps.freq[-1])
示例4: test_fractional_rms_in_rms_norm
# 需要导入模块: from stingray import Powerspectrum [as 别名]
# 或者: from stingray.Powerspectrum import compute_rms [as 别名]
def test_fractional_rms_in_rms_norm(self):
ps = Powerspectrum(lc=self.lc, norm="rms")
rms_ps, rms_err = ps.compute_rms(min_freq=ps.freq[1],
max_freq=ps.freq[-1])
rms_lc = np.std(self.lc.counts) / np.mean(self.lc.counts)
assert np.isclose(rms_ps, rms_lc, atol=0.01)