本文整理汇总了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])
示例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)
示例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)