本文整理汇总了Python中linetools.spectralline.AbsLine.measure_restew方法的典型用法代码示例。如果您正苦于以下问题:Python AbsLine.measure_restew方法的具体用法?Python AbsLine.measure_restew怎么用?Python AbsLine.measure_restew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类linetools.spectralline.AbsLine
的用法示例。
在下文中一共展示了AbsLine.measure_restew方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_boxew_absline
# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import measure_restew [as 别名]
def test_boxew_absline():
# Text boxcar EW evaluation
# 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)
# Measure EW (not rest-frame)
abslin.measure_ew()
ew = abslin.attrib['EW']
np.testing.assert_allclose(ew.value, 0.9935021012055584)
assert ew.unit == u.AA
abslin.measure_restew()
restew = abslin.attrib['EW']
np.testing.assert_allclose(restew.value, 0.9935021012055584/(1+abslin.z))
示例2: test_boxew_absline
# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import measure_restew [as 别名]
def test_boxew_absline():
# Text boxcar EW evaluation
# Init CIV 1548
abslin = AbsLine(1548.195*u.AA)
# Set spectrum
abslin.analy['spec'] = lsio.readspec(data_path('UM184_nF.fits')) # Fumagalli+13 MagE spectrum
abslin.analy['wvlim'] = [6080.78, 6087.82]*u.AA
# Measure EW (not rest-frame)
abslin.measure_ew()
ew = abslin.attrib['EW']
np.testing.assert_allclose(ew.value, 0.9935021012055584)
assert ew.unit == u.AA
abslin.measure_restew()
#import pdb
#pdb.set_trace()
np.testing.assert_allclose(ew.value, 0.9935021012055584/(1+abslin.attrib['z']))
示例3: test_gaussew_absline
# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import measure_restew [as 别名]
def test_gaussew_absline():
# Text Gaussian EW evaluation
# Init CIV 1548
abslin = AbsLine(1548.195*u.AA)
# Set spectrum
abslin.analy['spec'] = lsio.readspec(data_path('UM184_nF.fits')) # Fumagalli+13 MagE spectrum
abslin.analy['wvlim'] = [6080.78, 6087.82]*u.AA
# Measure EW (not rest-frame)
abslin.measure_ew(flg=2)
ew = abslin.attrib['EW']
np.testing.assert_allclose(ew.value, 1.02,atol=0.01)
assert ew.unit == u.AA
abslin.measure_ew(flg=2,initial_guesses=(0.5,6081,1))
np.testing.assert_allclose(ew.value, 1.02,atol=0.01)
abslin.measure_restew()
np.testing.assert_allclose(ew.value, 1.02/(1+abslin.attrib['z']),atol=0.01)