[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 | |
---|
[3680] | 8 | # OLE - this is the smallest sww file with the complex bounding polygon |
---|
| 9 | time_dir = '20060928_073318' #alpha = 0.5 |
---|
| 10 | |
---|
| 11 | #time_dir = '20060928_064732' #alpha = 0.01 |
---|
[3674] | 12 | #time_dir = '20060928_220905' #alpha = 1.0 |
---|
[3675] | 13 | #time_dir = '20060926_064750' #this worked for cellsize 30 and 100 |
---|
[3680] | 14 | #time_dir = '20060929_033100' #alpha = 0.01 poly anticlockwise - DIDN'T WORK |
---|
| 15 | #time_dir = '20060929_075954' #alpha = 0.1 grid with MOST |
---|
| 16 | #time_dir = '20060929_075009' #alpha = 0.1 points with MOST |
---|
[3615] | 17 | directory = project.outputdir |
---|
[3661] | 18 | name = directory + time_dir +sep + 'source' |
---|
[3615] | 19 | |
---|
[3661] | 20 | print 'output dir:', name |
---|
[3615] | 21 | #print 'Which variable do you want to export?' |
---|
| 22 | #which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3 ' )) |
---|
[3661] | 23 | which_var = 4 |
---|
[3615] | 24 | if which_var == 0: # Stage |
---|
| 25 | outname = name + '_stage' |
---|
| 26 | quantityname = 'stage' |
---|
| 27 | |
---|
| 28 | if which_var == 1: # Absolute Momentum |
---|
| 29 | outname = name + '_momentum' |
---|
| 30 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' #Absolute momentum |
---|
| 31 | |
---|
| 32 | if which_var == 2: # Depth |
---|
| 33 | outname = name + '_depth' |
---|
| 34 | quantityname = 'stage-elevation' #Depth |
---|
| 35 | |
---|
| 36 | if which_var == 3: # Speed |
---|
| 37 | outname = name + '_speed' |
---|
| 38 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed |
---|
| 39 | |
---|
| 40 | if which_var == 4: # Elevation |
---|
[3675] | 41 | outname = name + '_elevation_2' |
---|
[3615] | 42 | quantityname = 'elevation' #Elevation |
---|
| 43 | |
---|
[3661] | 44 | print 'start sww2dem' |
---|
[3615] | 45 | sww2dem(name, basename_out = outname, |
---|
| 46 | quantity = quantityname, |
---|
[3680] | 47 | cellsize = 500, # would prefer this at 25 |
---|
[3615] | 48 | # define region for viz purposes |
---|
[3680] | 49 | #easting_min = project.e_min_area, |
---|
| 50 | #easting_max = project.e_max_area, |
---|
| 51 | #northing_min = project.n_min_area, |
---|
| 52 | #northing_max = project.n_max_area, |
---|
[3615] | 53 | reduction = max, #this is because we want max quantityname |
---|
| 54 | verbose = True, |
---|
| 55 | format = 'asc') |
---|
[3661] | 56 | |
---|