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

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

update project files for slide modelling

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