1 | import project, os |
---|
2 | import sys |
---|
3 | |
---|
4 | from anuga.shallow_water.data_manager import sww2dem |
---|
5 | from os import sep |
---|
6 | |
---|
7 | time_dir = '20061113_040953' |
---|
8 | |
---|
9 | directory = project.outputdir |
---|
10 | name = directory + time_dir +sep + 'source' |
---|
11 | |
---|
12 | print 'output dir:', name |
---|
13 | which_var = 4 |
---|
14 | if which_var == 0: # Stage |
---|
15 | outname = name + '_stage' |
---|
16 | quantityname = 'stage' |
---|
17 | |
---|
18 | if which_var == 1: # Absolute Momentum |
---|
19 | outname = name + '_momentum' |
---|
20 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' #Absolute momentum |
---|
21 | |
---|
22 | if which_var == 2: # Depth |
---|
23 | outname = name + '_depth' |
---|
24 | quantityname = 'stage-elevation' #Depth |
---|
25 | |
---|
26 | if which_var == 3: # Speed |
---|
27 | outname = name + '_speed' |
---|
28 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed |
---|
29 | |
---|
30 | if which_var == 4: # Elevation |
---|
31 | outname = name + '_elevation' |
---|
32 | quantityname = 'elevation' #Elevation |
---|
33 | |
---|
34 | print 'start sww2dem' |
---|
35 | |
---|
36 | sww2dem(name, basename_out = outname, |
---|
37 | quantity = quantityname, |
---|
38 | cellsize = 25, # would prefer this at 25 |
---|
39 | # define region for viz purposes |
---|
40 | easting_min = project.eastingmin, |
---|
41 | easting_max = project.eastingmax, |
---|
42 | northing_min = project.northingmin, |
---|
43 | northing_max = project.northingmax, |
---|
44 | reduction = max, #this is because we want max quantityname |
---|
45 | verbose = True, |
---|
46 | format = 'asc') |
---|
47 | |
---|