Changeset 273
- Timestamp:
- Aug 30, 2011, 12:17:50 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/LMD_MM_MARS/SRC/PYTHON/myplot.py
r261 r273 554 554 "jupiter": "http://www.mmedia.is/~bjj/data/jupiter_css/jupiter_css.jpg",\ 555 555 "jupiter_voy": "http://www.mmedia.is/~bjj/data/jupiter/jupiter_vgr2.jpg",\ 556 "bw": "http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthElevation_2500x1250.jpg",\ 557 "contrast": "http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthMapAtmos_2500x1250.jpg",\ 558 "nice": "http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/earthmap1k.jpg",\ 559 "blue": "http://eoimages.gsfc.nasa.gov/ve/2430/land_ocean_ice_2048.jpg",\ 556 560 } 557 561 ### see http://www.mmedia.is/~bjj/planetary_maps.html … … 561 565 return whichlink[whichone] 562 566 563 def earthmap (whichone):564 if whichone == "contrast": whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthMapAtmos_2500x1250.jpg"565 elif whichone == "bw": whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthElevation_2500x1250.jpg"566 elif whichone == "nice": whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/earthmap1k.jpg"567 return whichlink567 #def earthmap (whichone): 568 # if whichone == "contrast": whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthMapAtmos_2500x1250.jpg" 569 # elif whichone == "bw": whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/EarthElevation_2500x1250.jpg" 570 # elif whichone == "nice": whichlink="http://users.info.unicaen.fr/~karczma/TEACH/InfoGeo/Images/Planets/earthmap1k.jpg" 571 # return whichlink 568 572 569 573 def latinterv (area="Whole"): … … 572 576 "Central_America": [[-10., 40.],[ 230., 300.]],\ 573 577 "Africa": [[-20., 50.],[- 50., 50.]],\ 574 "Whole": [[-90., 90.],[-180., -180.]],\575 "Southern_Hemisphere": [[-90., 60.],[-180., -180.]],\576 "Northern_Hemisphere": [[-60., 90.],[-180., -180.]],\578 "Whole": [[-90., 90.],[-180., 180.]],\ 579 "Southern_Hemisphere": [[-90., 60.],[-180., 180.]],\ 580 "Northern_Hemisphere": [[-60., 90.],[-180., 180.]],\ 577 581 "Tharsis": [[-30., 60.],[-170.,- 10.]],\ 578 582 "Whole_No_High": [[-60., 60.],[-180., 180.]],\ -
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.