[4860] | 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 start_screen_catcher |
---|
| 6 | from os import sep |
---|
| 7 | |
---|
| 8 | scenario = 'slide' |
---|
| 9 | #scenario = 'fixed_wave' |
---|
| 10 | |
---|
| 11 | name = scenario + sep + scenario + 'source' |
---|
| 12 | |
---|
| 13 | print 'output dir:', name |
---|
| 14 | which_var = 2 |
---|
| 15 | if which_var == 0: # Stage |
---|
| 16 | outname = name + '_stage' |
---|
| 17 | quantityname = 'stage' |
---|
| 18 | |
---|
| 19 | if which_var == 1: # Absolute Momentum |
---|
| 20 | outname = name + '_momentum' |
---|
| 21 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' #Absolute momentum |
---|
| 22 | |
---|
| 23 | if which_var == 2: # Depth |
---|
| 24 | outname = name + '_depth' |
---|
| 25 | quantityname = 'stage-elevation' #Depth |
---|
| 26 | |
---|
| 27 | if which_var == 3: # Speed |
---|
| 28 | outname = name + '_speed' |
---|
| 29 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed |
---|
| 30 | |
---|
| 31 | if which_var == 4: # Elevation |
---|
| 32 | outname = name + '_elevation' |
---|
| 33 | quantityname = 'elevation' #Elevation |
---|
| 34 | |
---|
| 35 | print 'start sww2dem' |
---|
| 36 | |
---|
| 37 | sww2dem(name, basename_out = outname, |
---|
| 38 | quantity = quantityname, |
---|
| 39 | cellsize = 100, |
---|
| 40 | easting_min = project.eastingmin, |
---|
| 41 | easting_max = project.eastingmax, |
---|
| 42 | northing_min = project.northingmin, |
---|
| 43 | northing_max = project.northingmax, |
---|
| 44 | reduction = max, |
---|
| 45 | verbose = True, |
---|
| 46 | format = 'asc') |
---|
| 47 | |
---|