本文整理汇总了Python中stingray.Lightcurve.join方法的典型用法代码示例。如果您正苦于以下问题:Python Lightcurve.join方法的具体用法?Python Lightcurve.join怎么用?Python Lightcurve.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stingray.Lightcurve
的用法示例。
在下文中一共展示了Lightcurve.join方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_join_with_different_dt
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import join [as 别名]
def test_join_with_different_dt(self):
_times = [5, 5.5, 6]
_counts = [2, 2, 2]
lc1 = Lightcurve(self.times, self.counts)
lc2 = Lightcurve(_times, _counts)
with warnings.catch_warnings(record=True) as w:
lc1.join(lc2)
assert "different bin widths" in str(w[0].message)
示例2: test_join_different_err_dist_overlapping_times
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import join [as 别名]
def test_join_different_err_dist_overlapping_times(self):
_times = [3, 4, 5, 6]
_counts = [4, 4, 4, 4]
lc1 = Lightcurve(self.times, self.counts, err_dist = "poisson")
lc2 = Lightcurve(_times, _counts, err_dist = "gauss")
with warnings.catch_warnings(record=True) as w:
lc3 = lc1.join(lc2)
assert "We are setting the errors to zero." in str(w[1].message)
assert np.all(lc3.counts_err == np.zeros_like(lc3.time))
示例3: test_join_different_err_dist_disjoint_times
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import join [as 别名]
def test_join_different_err_dist_disjoint_times(self):
_times = [5 , 6, 7, 8]
_counts =[2, 2, 2, 2]
lc1 = Lightcurve(self.times, self.counts, err_dist = "poisson")
lc2 = Lightcurve(_times, _counts, err_dist = "gauss")
lc3 = lc1.join(lc2)
assert np.all(lc3.counts_err[:len(self.times)] == lc1.counts_err)
assert np.all(lc3.counts_err[len(self.times):] == np.zeros_like(lc2.counts))
示例4: test_join_disjoint_time_arrays
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import join [as 别名]
def test_join_disjoint_time_arrays(self):
_times = [5, 6, 7, 8]
_counts = [2, 2, 2, 2]
lc1 = Lightcurve(self.times, self.counts)
lc2 = Lightcurve(_times, _counts)
lc = lc1.join(lc2)
assert len(lc.counts) == len(lc.time) == 8
assert np.all(lc.counts == 2)
示例5: test_join_overlapping_time_arrays
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import join [as 别名]
def test_join_overlapping_time_arrays(self):
_times = [3, 4, 5, 6]
_counts = [4, 4, 4, 4]
lc1 = Lightcurve(self.times, self.counts)
lc2 = Lightcurve(_times, _counts)
with warnings.catch_warnings(record=True) as w:
lc = lc1.join(lc2)
assert "overlapping time ranges" in str(w[0].message)
assert len(lc.counts) == len(lc.time) == 6
assert np.all(lc.counts == np.array([2, 2, 3, 3, 4, 4]))
示例6: test_join_with_different_mjdref
# 需要导入模块: from stingray import Lightcurve [as 别名]
# 或者: from stingray.Lightcurve import join [as 别名]
def test_join_with_different_mjdref(self):
lc1 = Lightcurve(self.times, self.counts, gti=self.gti, mjdref=57000)
lc2 = Lightcurve(self.times, self.counts, gti=self.gti, mjdref=57001)
with pytest.raises(ValueError):
lc1.join(lc2)