Changeset 273 for trunk/MESOSCALE_DEV/PLOT
- Timestamp:
- Aug 30, 2011, 12:17:50 PM (13 years ago)
- Location:
- trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/map_ecmwf.py
r266 r273 3 3 ########################################################################## 4 4 var = ["151","146","167"] 5 #var = ["167"] 5 var = ["167"] 6 var = ["78"] 7 var = ["137"] 6 8 lev = ["700.","850."] 7 9 tim = ["00"] 8 10 date = ['10','08','2010','10','08','2010'] 11 date = ['01','09','2009','01','09','2009'] 9 12 dataset = ["an","pl","0"] 10 13 dataset = ["fc","sfc","3"] 11 14 ########################################################################## 12 15 proj = "cyl" #"moll" "ortho" "lcc" 13 #proj = "ortho" 16 proj = "ortho" 17 #proj = "moll" 14 18 area = "Europe" 19 area = "Africa" 15 20 #area = "Central_America" 16 21 #area = "Southern_Hemisphere" 17 22 #area = "Northern_Hemisphere" 23 area = "Whole_No_High" 24 area = "Whole" 25 back="blue" 26 #back="bw" 18 27 ########################################################################## 19 28 … … 29 38 nc = mye.get_ecmwf (var, dataset, wlat, wlon, lev, date, tim) 30 39 ########################################################################## 31 lat = nc.variables['lat' ][:] 32 lon = nc.variables['lon' ][:] 33 [lon2d,lat2d] = np.meshgrid(lon,lat) 40 [lon2d,lat2d] = myp.getcoord2d (nc,nlat='lat',nlon='lon',is1d=True) 34 41 step=10. 35 42 ########################################################################## 36 43 ntime = 0 37 44 for i in range( np.array(var).size ): 38 for j in range( np.array(lev).size ): 39 for k in range( np.array(tim).size ): 40 if dataset[1] == "pl": field = nc.variables['var'+var[i] ][k,j,:,:] 41 if dataset[1] == "sfc": field = nc.variables['var'+var[i] ][k, :,:] 42 m = myp.define_proj(proj,wlon,wlat) 43 x, y = m(lon2d, lat2d) 44 #m.drawmeridians(np.r_[wlon[0]:wlon[1]:step*2], labels=[0,0,0,1], color='grey') 45 #m.drawparallels(np.r_[wlat[0]:wlat[1]:step ], labels=[1,0,0,0], color='grey') 46 m.bluemarble() 47 #m.warpimage(myp.earthmap("nice")) 48 zeplot = m.contour(x, y, field, 20) 49 plt.clabel(zeplot, inline=1, inline_spacing=1, fontsize=7, fmt='%0i') 50 #plt.colorbar(fraction=0.05,pad=0.1) 51 plt.title(mye.ecmwf_title_field(var[i])) 52 name = str(var[i])+str(lev[j])+str(tim[k])+".png" 53 plt.savefig(name) 54 plt.clf() 55 yeah = myp.display(name) 45 for z in range( np.array(lev).size ): 46 for t in range( np.array(tim).size ): 47 48 field, error = myp.reducefield( myp.getfield(nc,'var'+var[i]), d4=t, d3=z ) 49 if not error: 50 ### Map projection 51 m = myp.define_proj(proj,wlon,wlat,back=back) 52 x, y = m(lon2d, lat2d) 53 zeplot = m.contour(x, y, field, 15) 54 plt.clabel(zeplot, inline=1, inline_spacing=1, fontsize=7, fmt='%0i') 55 #plt.colorbar(fraction=0.05,pad=0.1) 56 plt.title(mye.ecmwf_title_field(var[i])) 57 myp.makeplotres(str(var[i])+str(lev[z])+str(tim[t]),res=100.,pad_inches_value=0.35) -
trunk/MESOSCALE_DEV/PLOT/PYTHON/mylib/myecmwf.py
r180 r273 7 7 elif var == "130": name="Atmospheric Temperature (K)" # ["130", "an", "0", "pl" ] 8 8 elif var == "167": name="2m Atmospheric Temperature (K)" # ["167", "fc", "3", "sfc"] 9 elif var == "78": name="Total column liquid water (kg/kg)" 10 elif var == "137": name="Total column water vapour (kg/m2)" 9 11 return name 10 12
Note: See TracChangeset
for help on using the changeset viewer.