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


Python Lightcurve.baseline方法代码示例

本文整理汇总了Python中stingray.Lightcurve.baseline方法的典型用法代码示例。如果您正苦于以下问题:Python Lightcurve.baseline方法的具体用法?Python Lightcurve.baseline怎么用?Python Lightcurve.baseline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stingray.Lightcurve的用法示例。


在下文中一共展示了Lightcurve.baseline方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_lc_baseline_offset_fewbins

# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import baseline [as 别名]
    def test_lc_baseline_offset_fewbins(self):
        times = np.arange(0, 4, 1)
        input_stdev = 0.1
        counts = np.random.normal(100, input_stdev, len(times)) + \
            0.001 * times
        gti = [[-0.005, 4.005]]
        lc = Lightcurve(times, counts, gti=gti)
        with pytest.warns(UserWarning) as record:
            lc.baseline(10000, 0.01, offset_correction=True)

        assert np.any(["Too few bins to perform baseline offset correction"
                       in r.message.args[0] for r in record])
开发者ID:abigailStev,项目名称:stingray,代码行数:14,代码来源:test_lightcurve.py

示例2: test_lc_baseline

# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import baseline [as 别名]
 def test_lc_baseline(self):
     times = np.arange(0, 100, 0.01)
     counts = np.random.normal(100, 0.1, len(times)) + \
         0.001 * times
     gti = [[-0.005, 50.005], [59.005, 100.005]]
     good = create_gti_mask(times, gti)
     counts[np.logical_not(good)] = 0
     lc = Lightcurve(times, counts, gti=gti)
     baseline = lc.baseline(10000, 0.01)
     assert np.all(lc.counts - baseline < 1)
开发者ID:abigailStev,项目名称:stingray,代码行数:12,代码来源:test_lightcurve.py

示例3: test_lc_baseline_offset

# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import baseline [as 别名]
 def test_lc_baseline_offset(self):
     times = np.arange(0, 100, 0.01)
     input_stdev = 0.1
     counts = np.random.normal(100, input_stdev, len(times)) + \
         0.001 * times
     gti = [[-0.005, 50.005], [59.005, 100.005]]
     good = create_gti_mask(times, gti)
     counts[np.logical_not(good)] = 0
     lc = Lightcurve(times, counts, gti=gti)
     baseline = lc.baseline(10000, 0.01, offset_correction=True)
     assert np.isclose(np.std(lc.counts - baseline), input_stdev, rtol=0.1)
开发者ID:abigailStev,项目名称:stingray,代码行数:13,代码来源:test_lightcurve.py


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