source: trunk/MESOSCALE/PLOT/PYTHON/pywrf.example.r39/viz/slabber.py @ 183

Last change on this file since 183 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
Line 
1import sys
2sys.path.append('/Users/val/data/pylib')
3
4import viz.utils as vu
5from string import zfill
6
7data_file = \
8  '/Volumes/DATA/wrf/first_1way/coarse/wrfout_d01_2003-01-17_03-00-00.nc'
9f, fv = vu.peek(data_file, show_vars=False)
10
11u = fv['U'].get_value()
12lon = fv['XLONG_U'].get_value()
13lat = fv['XLAT_U'].get_value()
14
15lvl_idx = 10
16times = fv['Times'].get_value()
17
18for 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.