1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | ########################################################################## |
---|
4 | var = ["151","146","167"] |
---|
5 | var = ["167"] |
---|
6 | var = ["78"] |
---|
7 | var = ["137"] |
---|
8 | #var = ["174"] albedo marche pas. |
---|
9 | lev = ["700.","850."] |
---|
10 | tim = ["00"] |
---|
11 | date = ['10','08','2010','10','08','2010'] |
---|
12 | date = ['01','09','2009','01','09','2009'] |
---|
13 | #date = ['01','09','2010','01','09','2010'] |
---|
14 | dataset = ["an","pl","0"] |
---|
15 | dataset = ["fc","sfc","3"] |
---|
16 | ########################################################################## |
---|
17 | proj = "cyl" #"moll" "ortho" "lcc" |
---|
18 | #proj = "ortho" |
---|
19 | #proj = "moll" |
---|
20 | area = "Europe" |
---|
21 | area = "Africa" |
---|
22 | area = "Central_America" |
---|
23 | #area = "Southern_Hemisphere" |
---|
24 | #area = "Northern_Hemisphere" |
---|
25 | #area = "Whole_No_High" |
---|
26 | area = "Whole" |
---|
27 | back="blue" |
---|
28 | #back="bw" |
---|
29 | #back="moc" |
---|
30 | ########################################################################## |
---|
31 | |
---|
32 | |
---|
33 | ########################################################################## |
---|
34 | import numpy as np |
---|
35 | import matplotlib.pyplot as plt |
---|
36 | import myplot as myp |
---|
37 | import myecmwf as mye |
---|
38 | ########################################################################## |
---|
39 | if dataset[1] == "sfc": lev = [9999.] |
---|
40 | [wlon,wlat] = myp.latinterv(area) |
---|
41 | nc = mye.get_ecmwf (var, dataset, wlat, wlon, lev, date, tim) |
---|
42 | ########################################################################## |
---|
43 | [lon2d,lat2d] = myp.getcoord2d (nc,nlat='lat',nlon='lon',is1d=True) |
---|
44 | step=10. |
---|
45 | ########################################################################## |
---|
46 | ntime = 0 |
---|
47 | for i in range( np.array(var).size ): |
---|
48 | for z in range( np.array(lev).size ): |
---|
49 | for t in range( np.array(tim).size ): |
---|
50 | |
---|
51 | field, error = myp.reducefield( myp.getfield(nc,'var'+var[i]), d4=t, d3=z ) |
---|
52 | if not error: |
---|
53 | ### Map projection |
---|
54 | m = myp.define_proj(proj,wlon,wlat,back=back) |
---|
55 | x, y = m(lon2d, lat2d) |
---|
56 | zeplot = m.contour(x, y, field, 10) #15 |
---|
57 | plt.clabel(zeplot, inline=1, inline_spacing=1, fontsize=7, fmt='%0i') |
---|
58 | #plt.colorbar(fraction=0.05,pad=0.1) |
---|
59 | plt.title(mye.ecmwf_title_field(var[i])) |
---|
60 | myp.makeplotres(str(var[i])+str(lev[z])+str(tim[t]),res=100.,pad_inches_value=0.35) |
---|