Last change
on this file since 180 was
180,
checked in by aslmd, 13 years ago
|
MESOSCALE: PYTHON: ajouts librairies maison: myplot mymath myecmwf. ajouts scripts maison: domain winds
|
-
Property svn:executable set to
*
|
File size:
803 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | ### A. Spiga LMD 29/05/2011 |
---|
4 | |
---|
5 | def usage(): |
---|
6 | print 'USAGE: plot.py file ' |
---|
7 | print 'file : name of input netcdf file.' |
---|
8 | print 'Example: domain.py /tmp7/aslmd/HELLAS/wrfout_d02_2024-10-03_06:00:00' |
---|
9 | |
---|
10 | def domain (namefile,proj="ortho",back="molabw"): #vishires |
---|
11 | from netCDF4 import Dataset |
---|
12 | from myplot import getcoord2d,define_proj,makeplotpng,simplinterv |
---|
13 | from matplotlib.pyplot import contourf |
---|
14 | nc = Dataset(namefile) |
---|
15 | [lon2d,lat2d] = getcoord2d(nc) |
---|
16 | [wlon,wlat] = simplinterv(lon2d,lat2d) |
---|
17 | m = define_proj(proj,wlon,wlat,back=back) |
---|
18 | x, y = m(lon2d, lat2d) |
---|
19 | contourf(x, y, nc.variables['HGT'][0,:,:] / 1000., 50) |
---|
20 | makeplotpng(namefile+".domain",pad_inches_value=0.05) |
---|
21 | |
---|
22 | if __name__ == "__main__": |
---|
23 | import sys |
---|
24 | domain(str(sys.argv[1])) |
---|
25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.