source: anuga_work/production/sydney_2006/export_results.py @ 4186

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

updates to slide modelling based on recent discussions with PMD (basically change in locations for potential slides and more accurate locations for the historical events, plus more accurate depth measurements)

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