header.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:chandra-acis-analysis 作者: liweitianux 项目源码 文件源码
def read_keyword2(infile, keyword):
    """
    Read the specified header keyword using ``astropy.io.fits``
    and return a tuple of ``(value, comment)``.

    NOTE
    ----
    Header of all extensions (a.k.a. blocks) are combined to locate
    the keyword.
    """
    with fits.open(infile) as f:
        h = fits.header.Header()
        for hdu in f:
            h.extend(hdu.header)
        value = h[keyword]
        comment = h.comments[keyword]
    return (value, comment)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号