temperature.py 文件源码

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

项目:faampy 作者: ncasuk 项目源码 文件源码
def main(ds):
    """
    Creates an overview plot for the Rosemount temperature sensors; deiced and non-deiced sensors.
    It calls all plotting functions and sets up axes layout.

    """
    #Setup up axes layout: 3 axes in one column
    gs=gridspec.GridSpec(2, 1, height_ratios=[1,4])
    top_cell=gs[0,0]
    bottom_cell=gs[1,0]

    gs1=gridspec.GridSpecFromSubplotSpec(4,1, bottom_cell, height_ratios=[1,1,10,10], hspace=0.05)

    fig=QaQc_Figure().setup()
    ax_tat_ts=fig.add_subplot(gs1[3])                                # axes for true air temperature time series
    ax_iat_ts=fig.add_subplot(gs1[2], sharex=fig.get_axes()[0])      # axes for indicated air temperature time series
    ax_lwc_ts=fig.add_subplot(gs1[1], sharex=fig.get_axes()[0])      # axes for cloud indicator
    ax_heater_ts=fig.add_subplot(gs1[0], sharex=fig.get_axes()[0])   # axes for heater indicator

    gs2=gridspec.GridSpecFromSubplotSpec(1,3, top_cell, hspace=0.15)
    ax_scatter=fig.add_subplot(gs2[0], aspect='equal')               # axes for scatter plot
    ax_hist=fig.add_subplot(gs2[1])                                  # axes for histogram
    ax_ps=fig.add_subplot(gs2[2])                                    # axes for power spectrum

    set_suptitle(fig, ds, 'QA-Temperature')

    data =get_data(ds, VARIABLE_NAMES)
    for var in ['ITDI', 'NDTI', 'TAT_DI_R', 'TAT_ND_R']:
        data[var][data[var] <= 0] = np.nan

    # call all plotting methods
    plot_tat(ax_tat_ts, data)
    plot_iat(ax_iat_ts, data)
    plot_lwc(ax_lwc_ts, data)
    plot_heater(ax_heater_ts, data)
    plot_iat_scatter(ax_scatter, data)
    plot_iat_histogram(ax_hist, data)
    plot_power_spectrum(ax_ps, data)

    for ax in fig.get_axes()[0:4]:
        add_takeoff(ax, data)
        add_landing(ax, data)

    ax=fig.get_axes()[0]
    zoom_to_flight_duration(ax, data)
    add_time_buffer(ax)
    return fig

#ds = netCDF4.Dataset('D:\\netcdf-test-files\\temperature_qa_extract_20160215_b943.nc', 'r')
#plt.close('all')
#ds = netCDF4.Dataset('./data/temperature_qa_extract_20160215_b943.nc', 'r')
#ds=d
#fig = main(ds)
#data=get_data(ds, VARIABLE_NAMES)
#close('all')
#fig=figure()
#ax=gca()
#plot_power_spectrum(ax, data)
#fig.savefig('/home/axel/test.png')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号