source: trunk/anuga_work/production/sydney_2006/export_results.py @ 7877

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

update export_results script with updates calculation for speed

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