[3615] | 1 | import project, os |
---|
| 2 | import sys |
---|
| 3 | |
---|
[3650] | 4 | from anuga.shallow_water.data_manager import sww2dem |
---|
[3661] | 5 | from anuga.abstract_2d_finite_volumes.util import Screen_Catcher |
---|
[3615] | 6 | from os import sep |
---|
| 7 | |
---|
[3672] | 8 | time_dir = '20060927_081957' #MSL |
---|
[3615] | 9 | directory = project.outputdir |
---|
[3661] | 10 | name = directory + time_dir +sep + 'source' |
---|
[3615] | 11 | |
---|
[3661] | 12 | print 'output dir:', name |
---|
[3615] | 13 | #print 'Which variable do you want to export?' |
---|
| 14 | #which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3 ' )) |
---|
[3661] | 15 | which_var = 4 |
---|
[3615] | 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**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed |
---|
| 31 | |
---|
| 32 | if which_var == 4: # Elevation |
---|
[3671] | 33 | outname = name + '_elevation' |
---|
[3615] | 34 | quantityname = 'elevation' #Elevation |
---|
| 35 | |
---|
[3661] | 36 | print 'start sww2dem' |
---|
[3615] | 37 | sww2dem(name, basename_out = outname, |
---|
| 38 | quantity = quantityname, |
---|
[3672] | 39 | cellsize = 100, # would prefer this at 25 |
---|
[3615] | 40 | # define region for viz purposes |
---|
[3672] | 41 | easting_min = project.e_min_area, |
---|
| 42 | easting_max = project.e_max_area, |
---|
| 43 | northing_min = project.n_min_area, |
---|
| 44 | northing_max = project.n_max_area, |
---|
[3615] | 45 | reduction = max, #this is because we want max quantityname |
---|
| 46 | verbose = True, |
---|
| 47 | format = 'asc') |
---|
[3661] | 48 | |
---|