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


Python AbsLine.analy['do_analysis']方法代码示例

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

示例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
开发者ID:nhmc,项目名称:xastropy,代码行数:40,代码来源:abssys_utils.py

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


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