astrom_common.py 文件源码

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

项目:astromalign 作者: dstndstn 项目源码 文件源码
def plotaffinegrid(affines, exag=1e3, affineOnly=True, R=0.025, tpre='', bboxes=None):
    import pylab as plt
    NR = 3
    NC = int(ceil(len(affines)/3.))
    #R = 0.025 # 1.5 arcmin
    #for (exag,affonly) in [(1e2, False), (1e3, True), (1e4, True)]:
    plt.clf()
    for i,aff in enumerate(affines):
        plt.subplot(NR, NC, i+1)
        dl = aff.refdec - R
        dh = aff.refdec + R
        rl = aff.refra  - R / aff.rascale
        rh = aff.refra  + R / aff.rascale
        RR,DD = np.meshgrid(np.linspace(rl, rh, 11),
                            np.linspace(dl, dh, 11))
        plotaffine(aff, RR.ravel(), DD.ravel(), exag=exag, affineOnly=affineOnly,
                   doclf=False,
                   units='dots', width=2, headwidth=2.5, headlength=3, headaxislength=3)
        if bboxes is not None:
            for bb in bboxes:
                plt.plot(*bb, linestyle='-', color='0.5')
            plt.plot(*bboxes[i], linestyle='-', color='k')
        setRadecAxes(rl,rh,dl,dh)
        plt.xlabel('')
        plt.ylabel('')
        plt.xticks([])
        plt.yticks([])
        plt.title('field %i' % (i+1))
    plt.subplots_adjust(left=0.05, right=0.95, wspace=0.1)
    if affineOnly:
        tt = tpre + 'Affine part of transformations'
    else:
        tt = tpre + 'Transformations'
    plt.suptitle(tt + ' (x %g)' % exag)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号