[177] | 1 | #!/usr/bin/env python |
---|
| 2 | |
---|
| 3 | ########################################################################## |
---|
| 4 | var = ["151","146","167"] |
---|
[273] | 5 | var = ["167"] |
---|
| 6 | var = ["78"] |
---|
| 7 | var = ["137"] |
---|
[297] | 8 | #var = ["174"] albedo marche pas. |
---|
[177] | 9 | lev = ["700.","850."] |
---|
| 10 | tim = ["00"] |
---|
| 11 | date = ['10','08','2010','10','08','2010'] |
---|
[273] | 12 | date = ['01','09','2009','01','09','2009'] |
---|
[297] | 13 | #date = ['01','09','2010','01','09','2010'] |
---|
[177] | 14 | dataset = ["an","pl","0"] |
---|
| 15 | dataset = ["fc","sfc","3"] |
---|
| 16 | ########################################################################## |
---|
| 17 | proj = "cyl" #"moll" "ortho" "lcc" |
---|
[297] | 18 | #proj = "ortho" |
---|
[273] | 19 | #proj = "moll" |
---|
[177] | 20 | area = "Europe" |
---|
[273] | 21 | area = "Africa" |
---|
[297] | 22 | area = "Central_America" |
---|
[180] | 23 | #area = "Southern_Hemisphere" |
---|
| 24 | #area = "Northern_Hemisphere" |
---|
[297] | 25 | #area = "Whole_No_High" |
---|
[273] | 26 | area = "Whole" |
---|
| 27 | back="blue" |
---|
| 28 | #back="bw" |
---|
[297] | 29 | #back="moc" |
---|
[177] | 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 | ########################################################################## |
---|
[273] | 43 | [lon2d,lat2d] = myp.getcoord2d (nc,nlat='lat',nlon='lon',is1d=True) |
---|
[177] | 44 | step=10. |
---|
| 45 | ########################################################################## |
---|
| 46 | ntime = 0 |
---|
| 47 | for i in range( np.array(var).size ): |
---|
[273] | 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) |
---|
[297] | 56 | zeplot = m.contour(x, y, field, 10) #15 |
---|
[273] | 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) |
---|