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


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

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


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

示例1: parse_absid_file

# 需要导入模块: from linetools.spectralline import AbsLine [as 别名]
# 或者: from linetools.spectralline.AbsLine import analy['flg_limit'] [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


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