Last change
on this file since 189 was
183,
checked in by aslmd, 14 years ago
|
MESOSCALE: PYTHON: added pywrf r39 to act as a reference for futher developments
|
File size:
796 bytes
|
Rev | Line | |
---|
[183] | 1 | import sys |
---|
| 2 | sys.path.append('/Users/val/data/pylib') |
---|
| 3 | |
---|
| 4 | import viz.utils as vu |
---|
| 5 | from string import zfill |
---|
| 6 | |
---|
| 7 | data_file = \ |
---|
| 8 | '/Volumes/DATA/wrf/first_1way/coarse/wrfout_d01_2003-01-17_03-00-00.nc' |
---|
| 9 | f, fv = vu.peek(data_file, show_vars=False) |
---|
| 10 | |
---|
| 11 | u = fv['U'].get_value() |
---|
| 12 | lon = fv['XLONG_U'].get_value() |
---|
| 13 | lat = fv['XLAT_U'].get_value() |
---|
| 14 | |
---|
| 15 | lvl_idx = 10 |
---|
| 16 | times = fv['Times'].get_value() |
---|
| 17 | |
---|
| 18 | for time_idx in range(46): |
---|
| 19 | time_string = vu.set_time_string('WRF', times[time_idx]) |
---|
| 20 | lvl_string = str(lvl_idx) + 'th lvl' |
---|
| 21 | title_string = \ |
---|
| 22 | vu.set_title_string('u wind', 'm/s', time_string, lvl_string, 'WRF:') |
---|
| 23 | file_name = 'frames/frame_' + zfill(str(time_idx),3) |
---|
| 24 | print file_name |
---|
| 25 | vu.plot_slab(lon[time_idx], lat[time_idx], u[time_idx][lvl_idx], |
---|
| 26 | file_name=file_name, title_string=title_string) |
---|
Note: See
TracBrowser
for help on using the repository browser.