#print "Script took", time.time()-scriptstart, "seconds." #pdb.set_trace() # Create publication figures fig14, axes14 = plt.subplots(3,1,figsize=(5,7)) initdate = '2011112500' plotfname = 'DKE_500_' times = [(2011,m,d,12,0,0) for m,d in zip((11,11,12),(29,30,1))] runfolder = os.path.join(rootdir,initdate) path_to_plots = os.path.join(outdir,initdate) V = list(range(200,2200,200)) labels = ['a)','b)','c)'] for ax,t,label in zip(axes14.flat, times,labels): cf = p.plot_diff_energy('sum_z','kinetic',t,runfolder,'DKE_500_'+initdate, path_to_plots,plotfname,V,no_title=1,ax=ax) ax.text(0.05,0.85,label,transform=ax.transAxes, bbox={'facecolor':'white'},fontsize=15,zorder=1000) fig14.tight_layout() fig14.subplots_adjust(bottom=0.15) cbar_ax = fig14.add_axes([0.15,0.075,0.7,0.025]) cb = fig14.colorbar(cf,cax=cbar_ax,orientation='horizontal') cb.set_label('Different Kinetic Energy ($m^{2}s^{-2}$)') output_path = os.path.join(path_to_plots,'fig14.png') fig14.savefig(output_path) plt.close(fig14) ####################### #######################
if compute: p.compute_diff_energy('sum_z', 'total', path_to_wrfouts, times, d_save=picklefolder, d_return=0, d_fname=pfname) if plot_2D: # Contour fixed at these values V = range(250, 5250, 250) VV = [ 100, ] + V ofname = pfname + '_2D' for t in times: p.plot_diff_energy('sum_z', 'total', t, picklefolder, pfname, outpath, ofname, VV) if plot_1D: ylimits = [0, 2e8] ofname = pfname p.plot_error_growth(ofname, picklefolder, pfname, sensitivity=sensitivity, ylimits=ylimits) #print "Script took", time.time()-scriptstart, "seconds."
fig14, axes14 = plt.subplots(3, 1, figsize=(5, 7)) initdate = '2011112500' plotfname = 'DKE_500_' times = [(2011, m, d, 12, 0, 0) for m, d in zip((11, 11, 12), (29, 30, 1))] runfolder = os.path.join(rootdir, initdate) path_to_plots = os.path.join(outdir, initdate) V = list(range(200, 2200, 200)) labels = ['a)', 'b)', 'c)'] for ax, t, label in zip(axes14.flat, times, labels): cf = p.plot_diff_energy('sum_z', 'kinetic', t, runfolder, 'DKE_500_' + initdate, path_to_plots, plotfname, V, no_title=1, ax=ax) ax.text(0.05, 0.85, label, transform=ax.transAxes, bbox={'facecolor': 'white'}, fontsize=15, zorder=1000) fig14.tight_layout() fig14.subplots_adjust(bottom=0.15) cbar_ax = fig14.add_axes([0.15, 0.075, 0.7, 0.025])
outpath = os.path.join(config.output_root,case,IC,ens) sensitivity = MPs path_to_wrfouts = [] for mp in MPs: fpath = os.path.join(config.wrfout_root,case,IC,ens,MP) path_to_wrfouts.append(utils.wrfout_files_in(fpath,dom=1)[0]) else: print "Typo!" raise Exception pfname = 'DTE_' + experiment if compute: p.compute_diff_energy('sum_z','total',path_to_wrfouts,times, d_save=picklefolder, d_return=0,d_fname=pfname) if plot_2D: # Contour fixed at these values V = range(250,5250,250) VV = [100,] + V ofname = pfname + '_2D' for t in times: p.plot_diff_energy('sum_z','total',t,picklefolder,pfname,outpath,ofname,VV) if plot_1D: ylimits = [0,2e8] ofname = pfname p.plot_error_growth(ofname,picklefolder,pfname,sensitivity=sensitivity,ylimits=ylimits) #print "Script took", time.time()-scriptstart, "seconds."