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

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

update export_results script with updates calculation for speed

File size: 2.8 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
18#time_dir = '20070208_045514' # bulli
19#time_dir = '20070208_044802' # for version without new flux limiter
20# correct depths
21#time_dir = '20070213_035110'   #bulli
22#time_dir = '20070213_035146'   #shovel
23#time_dir = '20070213_035302'   #yacaaba
24
25#corrected yacaaba and birubi
26time_dir = '20070322_035513' # yacaaba
27#time_dir = '20070322_035640' # birubi
28
29directory = project_slide.outputdir
30name = directory + time_dir + sep + project_slide.basename
31
32is_parallel = False
33if is_parallel == True: nodes = 4
34print 'output dir:', name
35
36which_var = 2
37if which_var == 0:  # Stage
38    outname = name + '_stage'
39    quantityname = 'stage'
40
41if which_var == 1:  # Absolute Momentum
42    outname = name + '_momentum_i1'
43    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
44
45if which_var == 2:  # Depth
46    outname = name + '_depth-origclip'
47    quantityname = 'stage-elevation' 
48
49if which_var == 3:  # Speed
50    outname = name + '_speed_i0'
51    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
52
53if which_var == 4:  # Elevation
54    outname = name + '_elevation'
55    quantityname = 'elevation'  #Elevation
56
57if is_parallel == True:
58    for i in range(0,nodes):
59        namei = name + '_P%d_%d' %(i,nodes)
60        outnamei = outname + '_P%d_%d' %(i,nodes)
61        print 'start sww2dem for sww file %d' %(i)
62        sww2dem(namei, basename_out = outnamei,
63                    quantity = quantityname,
64                    timestep = 1,
65                    cellsize = 100,     
66                    #easting_min = project.e_min_area,
67                    #easting_max = project.e_max_area,
68                    #northing_min = project.n_min_area,
69                    #northing_max = project.n_max_area,       
70                    reduction = max, 
71                    verbose = True,
72                    format = 'asc')
73else:
74    print 'start sww2dem'
75    sww2dem(name, basename_out = outname,
76                quantity = quantityname,
77                cellsize = 20,     
78                easting_min = project_slide.eastingmin,
79                easting_max = project_slide.eastingmax,
80                northing_min = project_slide.northingmin,
81                northing_max = project_slide.northingmax,       
82                reduction = max, 
83                verbose = True,
84                format = 'asc')
Note: See TracBrowser for help on using the repository browser.