source: anuga_work/production/newcastle_2006/export_results.py @ 7613

Last change on this file since 7613 was 4423, checked in by sexton, 17 years ago

updates for export scripts

File size: 3.7 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 = '20061207_035946' #bulli
9#time_dir = '20061212_012802' #shovel
10#time_dir = '20061212_064757' #yacaaba
11# second run
12#time_dir = '20070119_055707' # yacaaba
13#time_dir = '20070121_213838' # shovel
14#time_dir = '20070119_055809' # bulli
15#time_dir = '20070213_035538'   #bulli
16#time_dir = '20070213_035629'   #shovel
17#time_dir = '20070213_035728'   #yacaaba
18
19#rerun as data didn't fit properly
20#time_dir = '20070219_060722' #bulli
21#time_dir = '20070219_060808' #shovel
22#time_dir = '20070219_060854' #yacaaba
23
24#corrected yacaaba and birubi
25#time_dir = '20070323_012157' # yacaaba_c1 - potential
26#time_dir = '20070323_012425' # yacaaba_c2 - historical
27#time_dir = '20070322_032705' # birubi_c1 - historical
28#time_dir = '20070322_032618' # birubi_c2 - potential
29#time_dir = '20070322_060006' # bulli_c2 - potential
30#time_dir = '20070322_060132' # shovel_c2 - potential
31
32# new region
33#time_dir = '20070322_033350' # birubi
34#time_dir = '20070323_012310' # yacaaba
35#time_dir = '20070322_033716' # shovel
36#time_dir = '20070322_033608' # bulli
37
38# rerun
39#time_dir = '20070331_080432' # birubi - historical
40#time_dir = '20070331_070841' # yacaaba - c1
41#time_dir = '20070331_080603' # birubi - c2
42time_dir = '20070402_062735' # yacaaba - historical
43#time_dir = '20070331_080235' # bulli - c2
44#time_dir = '20070331_080213' # shovel - c2
45
46directory = project_slide.outputdir
47name = directory + time_dir + sep + project_slide.basename
48
49is_parallel = False
50if is_parallel == True: nodes = 4
51print 'output dir:', directory + time_dir
52
53which_var = 2
54if which_var == 0:  # Stage
55    outname = name + '_stage'
56    quantityname = 'stage'
57
58if which_var == 1:  # Absolute Momentum
59    outname = name + '_momentum_i1'
60    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
61
62if which_var == 2:  # Depth
63    outname = name + '_depth'
64    quantityname = 'stage-elevation' 
65
66if which_var == 3:  # Speed
67    outname = name + '_speed_i0'
68    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
69
70if which_var == 4:  # Elevation
71    outname = name + '_elevation'
72    quantityname = 'elevation'  #Elevation
73
74if is_parallel == True:
75    for i in range(0,nodes):
76        namei = name + '_P%d_%d' %(i,nodes)
77        outnamei = outname + '_P%d_%d' %(i,nodes)
78        print 'start sww2dem for sww file %d' %(i)
79        sww2dem(namei, basename_out = outnamei,
80                    quantity = quantityname,
81                    timestep = 1,
82                    cellsize = 100,     
83                    #easting_min = project.e_min_area,
84                    #easting_max = project.e_max_area,
85                    #northing_min = project.n_min_area,
86                    #northing_max = project.n_max_area,       
87                    reduction = max, 
88                    verbose = True,
89                    format = 'asc')
90else:
91    print 'start sww2dem'
92    sww2dem(name, basename_out = outname,
93                quantity = quantityname,
94                cellsize = 25,     
95##                easting_min = project_slide.eastingmin1,
96##                easting_max = project_slide.eastingmax1,
97##                northing_min = project_slide.northingmin1,
98##                northing_max = project_slide.northingmax1,
99                easting_min = project_slide.eastingmin2,
100                easting_max = project_slide.eastingmax2,
101                northing_min = project_slide.northingmin2,
102                northing_max = project_slide.northingmax2, 
103                reduction = max, 
104                verbose = True,
105                format = 'asc')
Note: See TracBrowser for help on using the repository browser.