jybeam2k.py 文件源码

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

项目:atoolbox 作者: liweitianux 项目源码 文件源码
def calc_beam_size(header):
    """
    Calculate the beam/PSF size using the 'WSCNORMF' keyword recorded by
    the WSClean imager, which applies to the natural-weighted image, and
    is more accurate than the fitted beam (stored as 'BMAJ' and 'BMIN'.)
    """
    try:
        weight = header["WSCWEIGH"]
        normf = header["WSCNORMF"]
        print("WSCWEIGH: %s" % weight)
        print("WSCNORMF: %.1f" % normf)
    except KeyError:
        raise RuntimeError("NO necessary WSC* keyword; switch to " +
                           "--use-fitted-beam instead")
    if weight.upper() != "NATURAL":
        print("WARNING: weighting scheme is '%s' != natural!" % weight)
    width = header["NAXIS1"]
    height = header["NAXIS2"]
    pixelsize = np.abs(header["CDELT1"]) * 3600  # [arcsec]
    print("Image: %dx%d, %.1f [arcsec/pixel]" % (width, height, pixelsize))
    beam_size = (width*height * pixelsize**2) / normf
    return beam_size
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号