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


Python AbsLine.setz方法代码示例

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


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

示例1: test_init_multi_absline

# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import setz [as 别名]
def test_init_multi_absline():
    # AbsLine(s)
    lya = AbsLine(1215.670*u.AA, z=2.92939)
    lya.analy['vlim'] = [-300.,300.]*u.km/u.s
    lyb = AbsLine(1025.7222*u.AA)
    lyb.analy['vlim'] = [-300.,300.]*u.km/u.s
    lyb.setz(lya.z)
    # Instantiate
    abscomp = AbsComponent.from_abslines([lya,lyb])
    # Test
    assert len(abscomp._abslines) == 2
    np.testing.assert_allclose(abscomp.zcomp,2.92939)
开发者ID:jnburchett,项目名称:linetools,代码行数:14,代码来源:test_init_abscomp.py

示例2: test_stack_plot

# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import setz [as 别名]
def test_stack_plot(show=False):
    abslin1 = AbsLine(1548.204*u.AA)
    abslin2 = AbsLine('CIV 1550')
    # no spectrum first
    ltap.stack_plot([abslin1], show=show)
    # Set spectrum
    spec = ltsio.readspec(data_path('UM184_nF.fits'))  # already normalized
    abslin1.analy['spec'] = spec
    abslin1.analy['wvlim'] = [6079.78, 6168.82]*u.AA
    abslin1.setz(2.92929)
    ltap.stack_plot([abslin1], show=show)
    # second line
    abslin2.analy['spec'] = spec
    abslin2.analy['wvlim'] = [6079.78, 6168.82]*u.AA
    abslin2.setz(2.92929)
    ltap.stack_plot([abslin1, abslin2], show=show)
    # now with a zref
    ltap.stack_plot([abslin1, abslin2], show=show, zref=2.928)
开发者ID:linetools,项目名称:linetools,代码行数:20,代码来源:test_plots.py

示例3: test_aodm_absline

# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import setz [as 别名]
def test_aodm_absline():
    # Init CIV 1548
    abslin = AbsLine('CIV 1548', z=2.9304)

    # Set spectrum
    abslin.analy['spec'] = lsio.readspec(data_path('UM184_nF.fits')) # Fumagalli+13 MagE spectrum
    abslin.limits.set([6080.78, 6087.82]*u.AA)
    #abslin.analy['wvlim'] = [6080.78, 6087.82]*u.AA
    #
    abslin.measure_aodm()
    N, sig_N, flgN = [abslin.attrib[key] for key in ['N','sig_N','flag_N']]

    np.testing.assert_allclose(N.value, 76369981945649.38)
    assert N.unit == 1/u.cm**2
    assert flgN == 1

    # Now velocity limits
    abslin.setz(2.92929)
    abslin.limits.set((-150., 150.)*u.km/u.s)
    #
    abslin.measure_aodm()
    N, sig_N, flgN = [abslin.attrib[key] for key in ['N','sig_N','flag_N']]
    np.testing.assert_allclose(N.value, 80410608889125.64)
    return
开发者ID:linetools,项目名称:linetools,代码行数:26,代码来源:test_absline_anly.py

示例4: test_redshift

# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import setz [as 别名]
def test_redshift():
    abslin = AbsLine(1215.6700*u.AA)
    abslin.setz(1.)
    np.testing.assert_allclose(abslin.z, 1.)
    np.testing.assert_allclose(abslin.limits.z, 1.)
    np.testing.assert_allclose(abslin.limits._z, 1.)
开发者ID:jnburchett,项目名称:linetools,代码行数:8,代码来源:test_init_absline.py


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