当前位置: 首页>>代码示例>>Python>>正文


Python Powerspectrum.compute_rms方法代码示例

本文整理汇总了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)
开发者ID:abigailStev,项目名称:stingray,代码行数:19,代码来源:test_powerspectrum.py

示例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)
开发者ID:abigailStev,项目名称:stingray,代码行数:14,代码来源:test_powerspectrum.py

示例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])
开发者ID:abigailStev,项目名称:stingray,代码行数:7,代码来源:test_powerspectrum.py

示例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)
开发者ID:AbhishekKumarSingh,项目名称:stingray,代码行数:8,代码来源:test_powerspectrum.py


注:本文中的stingray.Powerspectrum.compute_rms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。