1 | import project, os |
---|
2 | import sys |
---|
3 | |
---|
4 | from anuga.shallow_water.data_manager import sww2dem |
---|
5 | from anuga.abstract_2d_finite_volumes.util import Screen_Catcher |
---|
6 | from os import sep |
---|
7 | |
---|
8 | #time_dir = '20061006_062319' # Mw 8-5 |
---|
9 | #time_dir = '20061008_234702' # Mw 8-7 |
---|
10 | time_dir = '20061022_224422' # Mw 8-7 |
---|
11 | |
---|
12 | directory = project.outputdir |
---|
13 | name = directory + time_dir +sep + 'source' |
---|
14 | |
---|
15 | print 'output dir:', name |
---|
16 | which_var = 2 |
---|
17 | if which_var == 0: # Stage |
---|
18 | outname = name + '_stage' |
---|
19 | quantityname = 'stage' |
---|
20 | |
---|
21 | if which_var == 1: # Absolute Momentum |
---|
22 | outname = name + '_momentum' |
---|
23 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' #Absolute momentum |
---|
24 | |
---|
25 | if which_var == 2: # Depth |
---|
26 | outname = name + '_depth_bruny' |
---|
27 | quantityname = 'stage-elevation' #Depth |
---|
28 | |
---|
29 | if which_var == 3: # Speed |
---|
30 | outname = name + '_speed' |
---|
31 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed |
---|
32 | |
---|
33 | if which_var == 4: # Elevation |
---|
34 | outname = name + '_elevation' |
---|
35 | quantityname = 'elevation' #Elevation |
---|
36 | |
---|
37 | print 'start sww2dem' |
---|
38 | # for hobart |
---|
39 | ##sww2dem(name, basename_out = outname, |
---|
40 | ## quantity = quantityname, |
---|
41 | ## cellsize = 25, # would prefer this at 25 |
---|
42 | ## # define region for viz purposes |
---|
43 | ## easting_min = project.eastingmin25, |
---|
44 | ## easting_max = project.eastingmax25, |
---|
45 | ## northing_min = project.northingmin25, |
---|
46 | ## northing_max = project.northingmax25, |
---|
47 | ## reduction = max, #this is because we want max quantityname |
---|
48 | ## verbose = True, |
---|
49 | ## format = 'asc') |
---|
50 | |
---|
51 | ### for bruny |
---|
52 | ##sww2dem(name, basename_out = outname, |
---|
53 | ## quantity = quantityname, |
---|
54 | ## cellsize = 25, # would prefer this at 25 |
---|
55 | ## # define region for viz purposes |
---|
56 | ## easting_min = project.eastingmin25_2, |
---|
57 | ## easting_max = project.eastingmax25_2, |
---|
58 | ## northing_min = project.northingmin25_2, |
---|
59 | ## northing_max = project.northingmax25_2, |
---|
60 | ## reduction = max, #this is because we want max quantityname |
---|
61 | ## verbose = True, |
---|
62 | ## format = 'asc') |
---|
63 | |
---|
64 | # for fixed timestep |
---|
65 | sww2dem(name, basename_out = outname, |
---|
66 | quantity = quantityname, |
---|
67 | cellsize = 10, # would prefer this at 25 |
---|
68 | # define region for viz purposes |
---|
69 | easting_min = project.eastingmin25_2, |
---|
70 | easting_max = project.eastingmax25_2, |
---|
71 | northing_min = project.northingmin25_2, |
---|
72 | northing_max = project.northingmax25_2, |
---|
73 | #reduction = max, #this is because we want max quantityname |
---|
74 | verbose = True, |
---|
75 | format = 'asc') |
---|
76 | |
---|