def main(ds):
"""
Creates overview plot for humidity during a single flight
"""
# Setup up axes layout: 4 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(3, 1,
bottom_cell,
height_ratios=[2,5,10],
hspace=0.05)
fig = QaQc_Figure().setup()
fig.add_subplot(gs1[2,:])
fig.add_subplot(gs1[1,:], sharex=fig.get_axes()[0])
fig.add_subplot(gs1[0,:], sharex=fig.get_axes()[0])
gs2=gridspec.GridSpecFromSubplotSpec(1,1, top_cell)
fig.add_subplot(gs2[0,:], aspect='equal')
set_suptitle(fig, ds, 'QA-Humidity')
data = get_data(ds, VARIABLE_NAMES)
data['VMR_CR2'][data['VMR_CR2'] < 0] = np.nan # remove unreasonable data
tdew_ge=data['TDEW_GE'][:,0].ravel()
ps_rvsm=data['PS_RVSM'][:,0].ravel()
vp_ge = dp2vp(tdew_ge)
vmr_ge = vp2vmr(vp_ge, ps_rvsm)
vmr_ge = vmr_ge*1E6
#call the plotting methods below
plot_humidity(fig.get_axes()[0], data)
plot_alt(fig.get_axes()[1], data)
plot_lwc(fig.get_axes()[2], data)
plot_humidity_scatter(fig.get_axes()[3], data)
# adds grey bar showing takeoff/landing and only plots the flight
ax = fig.get_axes()[0]
zoom_to_flight_duration(ax, data)
add_time_buffer(ax)
for ax in fig.get_axes()[:-1]:
add_takeoff(ax, data)
add_landing(ax, data)
fig.canvas.draw()
return fig
评论列表
文章目录