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 = '20060921_083846' #MSL |
---|
8 | directory = project.outputdir |
---|
9 | name = directory + time_dir + sep + 'source' |
---|
10 | |
---|
11 | #print 'Which variable do you want to export?' |
---|
12 | #which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3 ' )) |
---|
13 | which_var = 4 # for Hamish/Alex to compare |
---|
14 | #which_var = 2 # for Ingo/Neil to make maps |
---|
15 | |
---|
16 | if which_var == 0: # Stage |
---|
17 | outname = name + '_stage' |
---|
18 | quantityname = 'stage' |
---|
19 | |
---|
20 | if which_var == 1: # Absolute Momentum |
---|
21 | outname = name + '_momentum' |
---|
22 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' #Absolute momentum |
---|
23 | |
---|
24 | if which_var == 2: # Depth |
---|
25 | outname = name + '_depth' |
---|
26 | quantityname = 'stage-elevation' #Depth |
---|
27 | |
---|
28 | if which_var == 3: # Speed |
---|
29 | outname = name + '_speed' |
---|
30 | #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5' #Speed |
---|
31 | #quantityname = 'xmomentum/(stage-elevation)' #Speed |
---|
32 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed |
---|
33 | |
---|
34 | if which_var == 4: # Elevation |
---|
35 | outname = name + '_elevation' |
---|
36 | quantityname = 'elevation' #Elevation |
---|
37 | |
---|
38 | sww2dem(name, basename_out = outname, |
---|
39 | quantity = quantityname, |
---|
40 | cellsize = 25, |
---|
41 | # define region for viz purposes |
---|
42 | easting_min = project.e_min_area, |
---|
43 | easting_max = project.e_max_area, |
---|
44 | northing_min = project.n_min_area, |
---|
45 | northing_max = project.n_max_area, |
---|
46 | reduction = max, #this is because we want max quantityname |
---|
47 | verbose = True, |
---|
48 | format = 'asc') |
---|