source: trunk/UTIL/PYTHON/ecmwf/map_ecmwf.py @ 1062

Last change on this file since 1062 was 943, checked in by aslmd, 12 years ago

clean and organized UTIL/PYTHON folder

  • Property svn:executable set to *
File size: 2.2 KB
RevLine 
[177]1#!/usr/bin/env python
2
3##########################################################################
4var = ["151","146","167"]
[273]5var = ["167"]
6var = ["78"]
7var = ["137"]
[297]8#var = ["174"] albedo marche pas.
[177]9lev = ["700.","850."]
10tim = ["00"]
11date = ['10','08','2010','10','08','2010']
[273]12date = ['01','09','2009','01','09','2009']
[297]13#date = ['01','09','2010','01','09','2010']
[177]14dataset = ["an","pl","0"]
15dataset = ["fc","sfc","3"]
16##########################################################################
17proj = "cyl"  #"moll" "ortho" "lcc"
[297]18#proj = "ortho"
[273]19#proj = "moll"
[177]20area = "Europe"
[273]21area = "Africa"
[297]22area = "Central_America"
[180]23#area = "Southern_Hemisphere"
24#area = "Northern_Hemisphere"
[297]25#area = "Whole_No_High"
[273]26area = "Whole"
27back="blue"
28#back="bw"
[297]29#back="moc"
[177]30##########################################################################
31
32
33##########################################################################
34import  numpy                           as np
35import  matplotlib.pyplot               as plt
36import  myplot                          as myp
37import  myecmwf                         as mye
38##########################################################################
39if dataset[1] == "sfc": lev = [9999.]
40[wlon,wlat] = myp.latinterv(area)
41nc = 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]44step=10.
45##########################################################################
46ntime = 0
47for 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)
Note: See TracBrowser for help on using the repository browser.