#!/usr/bin/env python ########################################################################## var = ["151","146","167"] #var = ["167"] lev = ["700.","850."] tim = ["00"] date = ['10','08','2010','10','08','2010'] dataset = ["an","pl","0"] dataset = ["fc","sfc","3"] ########################################################################## proj = "cyl" #"moll" "ortho" "lcc" #proj = "ortho" area = "Europe" #area = "Central_America" #area = "Southern_Hemisphere" #area = "Northern_Hemisphere" ########################################################################## ########################################################################## import numpy as np import matplotlib.pyplot as plt import myplot as myp import myecmwf as mye ########################################################################## if dataset[1] == "sfc": lev = [9999.] [wlon,wlat] = myp.latinterv(area) nc = mye.get_ecmwf (var, dataset, wlat, wlon, lev, date, tim) ########################################################################## lat = nc.variables['lat' ][:] lon = nc.variables['lon' ][:] [lon2d,lat2d] = np.meshgrid(lon,lat) step=10. ########################################################################## ntime = 0 for i in range( np.array(var).size ): for j in range( np.array(lev).size ): for k in range( np.array(tim).size ): if dataset[1] == "pl": field = nc.variables['var'+var[i] ][k,j,:,:] if dataset[1] == "sfc": field = nc.variables['var'+var[i] ][k, :,:] m = myp.define_proj(proj,wlon,wlat) x, y = m(lon2d, lat2d) #m.drawmeridians(np.r_[wlon[0]:wlon[1]:step*2], labels=[0,0,0,1], color='grey') #m.drawparallels(np.r_[wlat[0]:wlat[1]:step ], labels=[1,0,0,0], color='grey') m.bluemarble() #m.warpimage(myp.earthmap("nice")) zeplot = m.contour(x, y, field, 20) plt.clabel(zeplot, inline=1, inline_spacing=1, fontsize=7, fmt='%0i') #plt.colorbar(fraction=0.05,pad=0.1) plt.title(mye.ecmwf_title_field(var[i])) name = str(var[i])+str(lev[j])+str(tim[k])+".png" plt.savefig(name) plt.clf() yeah = myp.display(name)