1 | |
---|
2 | import sys |
---|
3 | |
---|
4 | from anuga.shallow_water.data_manager import sww2dem |
---|
5 | from os import sep, getenv |
---|
6 | |
---|
7 | home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir |
---|
8 | |
---|
9 | #name='good_simulation/good_simulation_polylinefriction20080529_115703' |
---|
10 | #name='good_simulation/good_simulation_ursfriction20080529_160110' |
---|
11 | |
---|
12 | name= home + 'anuga_validation/boxing_day_sceanario/anuga/outputs/20080723/good_polyline20080723_45_141453' |
---|
13 | |
---|
14 | print 'output dir:', name |
---|
15 | |
---|
16 | bay_west = 417348.0 |
---|
17 | bay_east = 425656.0 |
---|
18 | bay_south = 870565.0 |
---|
19 | bay_north = 877008.0 |
---|
20 | |
---|
21 | which_var = 2 |
---|
22 | |
---|
23 | if which_var == 0: # Stage |
---|
24 | outname = name + '_stage-eq-thurs-test' |
---|
25 | quantityname = 'stage' |
---|
26 | |
---|
27 | if which_var == 1: # Absolute Momentum |
---|
28 | outname = name + '_momentum_i1' |
---|
29 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' |
---|
30 | |
---|
31 | if which_var == 2: # Depth |
---|
32 | outname = name + '_depth' |
---|
33 | quantityname = 'stage-elevation' |
---|
34 | |
---|
35 | if which_var == 3: # Speed |
---|
36 | outname = name + '_speed_i0' |
---|
37 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed |
---|
38 | |
---|
39 | if which_var == 4: # Elevation |
---|
40 | outname = name + '_elevation' |
---|
41 | quantityname = 'elevation' #Elevation |
---|
42 | |
---|
43 | print 'start sww2dem' |
---|
44 | sww2dem(name, basename_out = outname, |
---|
45 | quantity = quantityname, |
---|
46 | cellsize = 20, |
---|
47 | easting_min = bay_west, |
---|
48 | easting_max = bay_east, |
---|
49 | northing_min = bay_south, |
---|
50 | northing_max = bay_north, |
---|
51 | reduction = max, |
---|
52 | verbose = True, |
---|
53 | format = 'asc') |
---|