# Change paths to new location p.C.output_root = os.path.join(config.output_root,case,IC,en,MP,ex) p.C.wrfout_root = os.path.join(config.wrfout_root,case,IC,en,MP,ex) p.C.pickledir = os.path.join(config.wrfout_root,case,IC,en,MP,ex) p.plot_skewT(skewT_time,skewT_latlon,save_output=1) #p.plot_skewT(skewT_time,skewT_latlon,composite=1) if plot2D: for en in ensnames: for ex in experiments: out_sd, wrf_sd = get_folders(en,ex) # p.plot_strongest_wind(itime,ftime,2000,wrf_sd=wrf_sd,out_sd=out_sd) p.plot2D('cref',times,levels,wrf_sd=wrf_sd,out_sd=out_sd) if streamlines: for en in ensnames: # Reload settings p.C = Settings() # Change paths to new location p.C.output_root = os.path.join(config.output_root,case,IC,en,experiment) p.C.wrfout_root = os.path.join(config.wrfout_root,case,IC,en,experiment) #p.plot_2D(variables) print p.C.wrfout_root p.plot_streamlines(2000,sl_times) if rucplot: # RUC file is one-per-time so .nc file is specified beforehand en = ensnames[0]
for ex in experiments: # Reload settings p.C = Settings() # Change paths to new location p.C.output_root = os.path.join(config.output_root,case,IC,en,MP,ex) p.C.wrfout_root = os.path.join(config.wrfout_root,case,IC,en,MP,ex) p.C.pickledir = os.path.join(config.wrfout_root,case,IC,en,MP,ex) p.plot_skewT(skewT_time,skewT_latlon,save_output=1) #p.plot_skewT(skewT_time,skewT_latlon,composite=1) if plot2D: # p.plot_strongest_wind(itime,ftime,2000,wrf_sd=wrf_sd,out_sd=out_sd) p.plot2D('olr',times,levels) if streamlines: for t in times: p.plot_streamlines(2000,t) if rucplot: # RUC file is one-per-time so .nc file is specified beforehand en = ensnames[0] RC = Settings() RC.output_root = os.path.join(config.output_root,case,IC,en,experiment) RC.path_to_RUC = os.path.join(config.RUC_root,case,IC,en,experiment) WRF_dir = os.path.join(config.wrfout_root,case,'NAM',en,'ICBC') variables = ['streamlines',] level = 2000
p.plot_skewT(skewT_time, skewT_latlon, out_sd=out_sd, wrf_sd=wrf_sd, save_output=0) #p.plot_skewT(skewT_time,skewT_latlon,composite=1) if plot2D: for en in ensnames: for ex in experiments: for t in times: out_sd, wrf_sd = get_folders(en, ex) # p.plot_strongest_wind(itime,ftime,2000,wrf_sd=wrf_sd,out_sd=out_sd) # p.plot2D('Z',t,500,wrf_sd=wrf_sd,out_sd=out_sd,plottype='contour',smooth=10) p.plot2D('cref', t, 2000, wrf_sd=wrf_sd, out_sd=out_sd) if streamlines: for en in ensnames: for ex in experiments: for t in times: out_sd, wrf_sd = get_folders(en, ex) p.plot_streamlines(t, 2000, out_sd=out_sd, wrf_sd=wrf_sd) if rucplot: # RUC file is one-per-time so .nc file is specified beforehand en = ensnames[0] RC = Settings() RC.output_root = os.path.join(config.output_root, case, IC, en, experiment) RC.path_to_RUC = os.path.join(config.RUC_root, case, IC, en, experiment) WRF_dir = os.path.join(config.wrfout_root, case, 'NAM', en, 'ICBC')
for ex in experiments: # Reload settings p.C = Settings() # Change paths to new location p.C.output_root = os.path.join(config.output_root, case, IC, en, MP, ex) p.C.wrfout_root = os.path.join(config.wrfout_root, case, IC, en, MP, ex) p.C.pickledir = os.path.join(config.wrfout_root, case, IC, en, MP, ex) p.plot_skewT(skewT_time, skewT_latlon, save_output=1) # p.plot_skewT(skewT_time,skewT_latlon,composite=1) if plot2D: # p.plot_strongest_wind(itime,ftime,2000,wrf_sd=wrf_sd,out_sd=out_sd) p.plot2D("olr", times, levels) if streamlines: for t in times: p.plot_streamlines(2000, t) if rucplot: # RUC file is one-per-time so .nc file is specified beforehand en = ensnames[0] RC = Settings() RC.output_root = os.path.join(config.output_root, case, IC, en, experiment) RC.path_to_RUC = os.path.join(config.RUC_root, case, IC, en, experiment) WRF_dir = os.path.join(config.wrfout_root, case, "NAM", en, "ICBC") variables = ["streamlines"] level = 2000
# Create list of times times = [ (2014, 7, 7, 18, 0, 0), ] levels = (2000, ) vrbls = ('RAINNC', ) # Plot standard 2D plots if plot2D: for t in times: for lv in levels: for v in vrbls: p.plot2D(v, t, lv, ncdir, outdir, nct=nct, clvs=N.arange(5, 150, 5)) # Streamline 2D plots if streamlines: for t in times: for lv in levels: p.plot_streamlines(t, lv, ncdir, outdir, smooth=5) # Skew Ts # skewT_time = (2013,8,16,3,0,0) # skewT_latlon = (35.2435,-97.4708) # p.plot_skewT(skewT_time,skewT_latlon)
import numpy as N sys.path.append('/path/to/WEM/') from WEM.postWRF import WRFEnviron p = WRFEnviron() # Time of initialisation nct = (2006,5,10,0,0,0) # Or name of wrfout file ncf = = 'wrfout_d01...' # Directories for output and netCDF files outdir = '/absolute/path/to/figures/' ncdir = '/absolute/path/to/wrfoutdata/' itime = (2006,5,10,12,0,0) ftime = (2006,5,11,12,0,0) hourly = 3 times = p.generate_times(itime,ftime,hourly*60*60) level = 2000 for t in times: p.plot2D('cref',t,level,outdir=outdir,ncdir=ncdir,ncf=ncf, nct=nct,legend=True) p.plot2D('Z',t,(300,850),outdir=outdir,ncdir=ncdir,ncf=ncf, nct=nct,legend=True) p.plot_streamlines()
nct = (2014, 7, 7, 12, 0, 0) plot2D = 1 streamlines = 0 # Create list of times times = [(2014, 7, 7, 18, 0, 0)] levels = (2000,) vrbls = ("RAINNC",) # Plot standard 2D plots if plot2D: for t in times: for lv in levels: for v in vrbls: p.plot2D(v, t, lv, ncdir, outdir, nct=nct, clvs=N.arange(5, 150, 5)) # Streamline 2D plots if streamlines: for t in times: for lv in levels: p.plot_streamlines(t, lv, ncdir, outdir, smooth=5) # Skew Ts # skewT_time = (2013,8,16,3,0,0) # skewT_latlon = (35.2435,-97.4708) # p.plot_skewT(skewT_time,skewT_latlon) # DKE # p.compute_diff_energy('sum_z','total',path_to_wrfouts,times, # d_save=picklefolder, d_return=0,d_fname=pfname)
p.C.wrfout_root = os.path.join(config.wrfout_root, case, IC, en, MP, ex) p.C.pickledir = os.path.join(config.wrfout_root, case, IC, en, MP, ex) p.plot_skewT(skewT_time, skewT_latlon, save_output=1) #p.plot_skewT(skewT_time,skewT_latlon,composite=1) if plot2D: for en in ensnames: for ex in experiments: out_sd, wrf_sd = get_folders(en, ex) # p.plot_strongest_wind(itime,ftime,2000,wrf_sd=wrf_sd,out_sd=out_sd) p.plot2D('cref', times, levels, wrf_sd=wrf_sd, out_sd=out_sd) if streamlines: for en in ensnames: # Reload settings p.C = Settings() # Change paths to new location p.C.output_root = os.path.join(config.output_root, case, IC, en, experiment) p.C.wrfout_root = os.path.join(config.wrfout_root, case, IC, en, experiment) #p.plot_2D(variables) print p.C.wrfout_root p.plot_streamlines(2000, sl_times) if rucplot:
# Change paths to new location out_sd, wrf_sd = get_folders(en,ex) p.plot_skewT(skewT_time,skewT_latlon,out_sd=out_sd,wrf_sd=wrf_sd,save_output=0) #p.plot_skewT(skewT_time,skewT_latlon,composite=1) if plot2D: for en in ensnames: for ex in experiments: for t in times: out_sd, wrf_sd = get_folders(en,ex) # p.plot_strongest_wind(itime,ftime,2000,wrf_sd=wrf_sd,out_sd=out_sd) # p.plot2D('Z',t,500,wrf_sd=wrf_sd,out_sd=out_sd,plottype='contour',smooth=10) p.plot2D('cref',t,2000,wrf_sd=wrf_sd,out_sd=out_sd) if streamlines: for en in ensnames: for ex in experiments: for t in times: out_sd, wrf_sd = get_folders(en,ex) p.plot_streamlines(t,2000,out_sd=out_sd,wrf_sd=wrf_sd) if rucplot: # RUC file is one-per-time so .nc file is specified beforehand en = ensnames[0] RC = Settings() RC.output_root = os.path.join(config.output_root,case,IC,en,experiment) RC.path_to_RUC = os.path.join(config.RUC_root,case,IC,en,experiment) WRF_dir = os.path.join(config.wrfout_root,case,'NAM',en,'ICBC')