def mospat_plot_profile(f_Var, f_Height, c_Var, c_Net, c_Stn, t_ObsStationVerticalData):
f_lat = t_ObsStationVerticalData[c_Net][c_Stn]['f_Lat']
f_lon = t_ObsStationVerticalData[c_Net][c_Stn]['f_Lon']
f_Elev = t_ObsStationVerticalData[c_Net][c_Stn]['f_Elevation']
f_hmax = 5000.
if np.nanmax(f_Height) >= f_hmax:
i_hmax = np.where(np.array(f_Height) <= np.array(f_hmax))[0][-1]
f_Height = f_Height[:i_hmax]
f_Var = f_Var[:i_hmax]
c_var_label = ConfP.mospat_config_labels(c_Var)
c_coord = ' [lat=%0.2f lon=%0.2f elev=%0.2f]' % (f_lat, f_lon, f_Elev)
fig, ax = plt.subplots(figsize=(ConfP.f_PFSize[0], ConfP.f_PFSize[1]))
line = ax.plot(f_Var, f_Height / 1000., color=ConfP.c_ObsColor[0], marker=ConfP.c_ObsMarker,
linestyle=ConfP.c_ObsLine[0], label=c_Net)
ax.set_title(c_Stn + c_coord)
ax.set_ylabel('Height [km]')
ax.set_xlabel(c_var_label)
ax.set_ylim([0, np.nanmax(f_Height / 1000.)])
return fig, ax, line
评论列表
文章目录