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 | name = home + 'anuga_validation/boxing_day_sceanario/anuga/outputs/20080825/good_polyline20080825_130706_0.8' |
---|
9 | |
---|
10 | |
---|
11 | ##output_dir = home + 'anuga_validation/boxing_day_sceanario/anuga/outputs/20080813/good_polyline20080813_' |
---|
12 | ## |
---|
13 | ##name1= output_dir +'101348_0.45' |
---|
14 | ##name2= output_dir +'101521_0.55' |
---|
15 | ##name3= output_dir +'101610_0.35' |
---|
16 | ##name4= output_dir +'101741_0.25' |
---|
17 | ##name5= output_dir +'101819_0.15' |
---|
18 | ## |
---|
19 | ##names= [name1, name2, name3, name4, name5] |
---|
20 | ## |
---|
21 | ##for the_name in names: |
---|
22 | ## |
---|
23 | ## name = the_name[-11:] |
---|
24 | ## print 'sww filename', name |
---|
25 | |
---|
26 | |
---|
27 | bay_west = 417348.0 |
---|
28 | bay_east = 425656.0 |
---|
29 | bay_south = 870565.0 |
---|
30 | bay_north = 877008.0 |
---|
31 | |
---|
32 | which_var = 2 |
---|
33 | |
---|
34 | if which_var == 0: # Stage |
---|
35 | outname = name + '_stage-eq-thurs-test' |
---|
36 | quantityname = 'stage' |
---|
37 | |
---|
38 | if which_var == 1: # Absolute Momentum |
---|
39 | outname = name + '_momentum_i1' |
---|
40 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' |
---|
41 | |
---|
42 | if which_var == 2: # Depth |
---|
43 | outname = name + '_depth' |
---|
44 | quantityname = 'stage-elevation' |
---|
45 | |
---|
46 | if which_var == 3: # Speed |
---|
47 | outname = name + '_speed_i0' |
---|
48 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed |
---|
49 | |
---|
50 | if which_var == 4: # Elevation |
---|
51 | outname = name + '_elevation' |
---|
52 | quantityname = 'elevation' #Elevation |
---|
53 | |
---|
54 | print 'start sww2dem' |
---|
55 | sww2dem(name, basename_out = outname, |
---|
56 | quantity = quantityname, |
---|
57 | cellsize = 20, |
---|
58 | easting_min = bay_west, |
---|
59 | easting_max = bay_east, |
---|
60 | northing_min = bay_south, |
---|
61 | northing_max = bay_north, |
---|
62 | reduction = max, |
---|
63 | verbose = True, |
---|
64 | format = 'asc') |
---|