drf_plot.py 文件源码

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

项目:digital_rf 作者: MITHaystack 项目源码 文件源码
def rti_plot(data, extent, tick_locs, tick_labels, log_scale, zscale, title):

    # set to log scaling
    if log_scale:
        RTId = 10.0 * numpy.log10(data)
    else:
        RTId = data

    zscale_low, zscale_high = zscale
    if zscale_low == 0 and zscale_high == 0:
        if log_scale:
            zscale_low = numpy.median(
                numpy.min(RTId[numpy.where(RTId.real != -numpy.Inf)])) - 3.0
            zscale_high = numpy.median(numpy.max(RTId)) + 10.0
        else:
            zscale_low = numpy.median(numpy.min(RTId))
            zscale_high = numpy.median(numpy.max(RTId))

    vmin = zscale_low
    vmax = zscale_high

    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1)
    img = ax.imshow(RTId, origin='lower',
                    extent=extent, interpolation='none', vmin=vmin, vmax=vmax, aspect='auto')

    # plot dates

    ax.set_xticks(tick_locs)
    ax.set_xticklabels(tick_labels, rotation=-45, fontsize=10)
    cb = fig.colorbar(img, ax=ax)
    ax.set_xlabel('time (seconds)', fontsize=12)
    ax.set_ylabel('range (km)', fontsize=12)
    ax.set_title(title)

    return fig
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号