source: anuga_work/production/newcastle_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.5 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
13time_dir = '20070121_213838' # shovel
14#time_dir = '20070119_055809' # bulli
15
16directory = project_slide.outputdir
17name = directory + time_dir + sep + project_slide.basename
18
19is_parallel = False
20if is_parallel == True: nodes = 4
21print 'output dir:', name
22
23which_var = 2
24if which_var == 0:  # Stage
25    outname = name + '_stage'
26    quantityname = 'stage'
27
28if which_var == 1:  # Absolute Momentum
29    outname = name + '_momentum_i1'
30    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
31
32if which_var == 2:  # Depth
33    outname = name + '_depth-shovel'
34    quantityname = 'stage-elevation' 
35
36if which_var == 3:  # Speed
37    outname = name + '_speed_i0'
38    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
39    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
40
41if which_var == 4:  # Elevation
42    outname = name + '_elevation'
43    quantityname = 'elevation'  #Elevation
44
45if is_parallel == True:
46    for i in range(0,nodes):
47        namei = name + '_P%d_%d' %(i,nodes)
48        outnamei = outname + '_P%d_%d' %(i,nodes)
49        print 'start sww2dem for sww file %d' %(i)
50        sww2dem(namei, basename_out = outnamei,
51                    quantity = quantityname,
52                    timestep = 1,
53                    cellsize = 100,     
54                    #easting_min = project.e_min_area,
55                    #easting_max = project.e_max_area,
56                    #northing_min = project.n_min_area,
57                    #northing_max = project.n_max_area,       
58                    reduction = max, 
59                    verbose = True,
60                    format = 'asc')
61else:
62    print 'start sww2dem'
63    sww2dem(name, basename_out = outname,
64                quantity = quantityname,
65                cellsize = 25,     
66                easting_min = project_slide.eastingmin,
67                easting_max = project_slide.eastingmax,
68                northing_min = project_slide.northingmin,
69                northing_max = project_slide.northingmax,       
70                reduction = max, 
71                verbose = True,
72                format = 'asc')
Note: See TracBrowser for help on using the repository browser.