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


Python Lightcurve.join方法代码示例

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

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

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

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

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

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


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