本文整理汇总了Python中linetools.spectralline.AbsLine.analy['do_analysis']方法的典型用法代码示例。如果您正苦于以下问题:Python AbsLine.analy['do_analysis']方法的具体用法?Python AbsLine.analy['do_analysis']怎么用?Python AbsLine.analy['do_analysis']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类linetools.spectralline.AbsLine
的用法示例。
在下文中一共展示了AbsLine.analy['do_analysis']方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fill_lls_lines
# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import analy['do_analysis'] [as 别名]
def fill_lls_lines(self, bval=20.*u.km/u.s, do_analysis=1):
"""
Generate an HI line list for an LLS.
Goes into self.lls_lines
Now generates a component too.
Should have it check for an existing HI component..
Parameters
----------
bval : float, optional
Doppler parameter in km/s
do_analysis : int, optional
flag for analysis
"""
from linetools.lists import linelist as lll
# May be replaced by component class (as NT desires)
HIlines = lll.LineList('HI')
self.lls_lines = []
Nval = 10**self.NHI / u.cm**2
for lline in HIlines._data:
aline = AbsLine(lline['wrest'], linelist=HIlines)
# Attributes
aline.attrib['N'] = Nval
aline.attrib['b'] = bval
aline.attrib['z'] = self.zabs
aline.analy['vlim'] = self.vlim
aline.analy['do_analysis'] = do_analysis
aline.attrib['coord'] = self.coord
self.lls_lines.append(aline)
# Generate a component (should remove any previous HI)
self.add_component(AbsComponent.from_abslines(self.lls_lines))
示例2: parse_absid_file
# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import analy['do_analysis'] [as 别名]
def parse_absid_file(self, abs_fil):
from xastropy import spec as xxspec
if self.linelist is None:
self.linelist = LineList('ISM')
# FITS binary table
hdu = fits.open(abs_fil)
table = hdu[1].data
newz = table[0]['ZABS']
if (self.zabs > 0.) & (np.abs(self.zabs-newz) > 1e-4):
print('WARNING: Updating zabs from {:s}'.format(abs_fil))
self.zabs = newz
self.absid_file = abs_fil
# Load up lines
for row in table:
aline = AbsLine(row['WREST']*u.AA, linelist=self.linelist,
closest=True)
# Velocity limits and flags
try:
aline.analy['vlim'] = row['VLIM'] * u.km/u.s
except KeyError:
aline.analy['vlim'] = row['DV'] * u.km/u.s
try:
aline.analy['do_analysis'] = row['do_analysis']
except KeyError:
aline.analy['do_analysis'] = row['FLG_ANLY']
aline.analy['flg_eye'] = row['FLG_EYE']
aline.analy['flg_limit'] = row['FLG_LIMIT']
try:
aline.analy['datafile'] = row['datafile']
except KeyError:
aline.analy['datafile'] = row['DATFIL']
aline.analy['spec'] = None # Spectrum
aline.attrib['z'] = self.zabs
# Append
self.lines.append(aline)
''' OLD FORMAT
示例3: generate_line
# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import analy['do_analysis'] [as 别名]
def generate_line(self, inp):
''' Generate a new line, if it doesn't exist
Parameters:
----------
inp: tuple
(z,wrest)
'''
# Generate?
if self.grab_line(inp[1]) is None:
#QtCore.pyqtRemoveInputHook()
#xdb.set_trace()
#QtCore.pyqtRestoreInputHook()
newline = AbsLine(inp[1],linelist=self.llist[self.llist['List']])
print('VelPlot: Generating line {:g}'.format(inp[1]))
newline.analy['vlim'] = self.vmnx/2.
newline.attrib['z'] = self.abs_sys.zabs
newline.analy['do_analysis'] = 1 # Init to ok
# Spec file
if self.spec_fil is not None:
newline.analy['datafile'] = self.spec_fil
# Append
self.abs_lines.append(newline)