source: anuga_work/production/wollongong_2006/export_results.py @ 4248

Last change on this file since 4248 was 4248, checked in by sexton, 18 years ago

updates

File size: 2.6 KB
Line 
1import project_slide, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7# first run
8#time_dir = '20061211_060105' #bulli
9#time_dir = '20061212_012715' #shovel
10#time_dir = '20061212_064735' #yacaaba
11
12# second run
13#time_dir = '20070121_213616' #yacaaba
14#time_dir = '20070121_213550' #bulli
15#time_dir = '20070119_055620' #shovel
16
17# timing run - flux limiter in place
18time_dir = '20070208_045514' # bulli
19#time_dir = '20070208_044802' # for version without new flux limiter
20
21directory = project_slide.outputdir
22name = directory + time_dir + sep + project_slide.basename
23
24is_parallel = False
25if is_parallel == True: nodes = 4
26print 'output dir:', name
27
28which_var = 2
29if which_var == 0:  # Stage
30    outname = name + '_stage'
31    quantityname = 'stage'
32
33if which_var == 1:  # Absolute Momentum
34    outname = name + '_momentum_i1'
35    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
36
37if which_var == 2:  # Depth
38    outname = name + '_depth-bulli-fluxlimiter'
39    quantityname = 'stage-elevation' 
40
41if which_var == 3:  # Speed
42    outname = name + '_speed_i0'
43    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
44    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
45
46if which_var == 4:  # Elevation
47    outname = name + '_elevation'
48    quantityname = 'elevation'  #Elevation
49
50if is_parallel == True:
51    for i in range(0,nodes):
52        namei = name + '_P%d_%d' %(i,nodes)
53        outnamei = outname + '_P%d_%d' %(i,nodes)
54        print 'start sww2dem for sww file %d' %(i)
55        sww2dem(namei, basename_out = outnamei,
56                    quantity = quantityname,
57                    timestep = 1,
58                    cellsize = 100,     
59                    #easting_min = project.e_min_area,
60                    #easting_max = project.e_max_area,
61                    #northing_min = project.n_min_area,
62                    #northing_max = project.n_max_area,       
63                    reduction = max, 
64                    verbose = True,
65                    format = 'asc')
66else:
67    print 'start sww2dem'
68    sww2dem(name, basename_out = outname,
69                quantity = quantityname,
70                cellsize = 20,     
71                easting_min = project_slide.eastingmin,
72                easting_max = project_slide.eastingmax,
73                northing_min = project_slide.northingmin,
74                northing_max = project_slide.northingmax,       
75                reduction = max, 
76                verbose = True,
77                format = 'asc')
Note: See TracBrowser for help on using the repository browser.