source: anuga_work/production/dampier_2006/export_results.py @ 4029

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

(i) update Hobart gauges for Mark (ii) update priorities doc

File size: 2.2 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7time_dir = '20061116_055135_run' #
8directory = project.output_dir
9name = directory + time_dir + sep + project.scenario_name
10
11is_parallel = True
12if is_parallel == True: nodes = 8
13print 'output dir:', name
14
15which_var = 1
16if which_var == 0:  # Stage
17    outname = name + '_stage'
18    quantityname = 'stage'
19
20if which_var == 1:  # Absolute Momentum
21    outname = name + '_momentum_i0'
22    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
23
24if which_var == 2:  # Depth
25    outname = name + '_depth_test100'
26    quantityname = 'stage-elevation' 
27
28if which_var == 3:  # Speed
29    outname = name + '_speed_all'
30    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
31    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
32
33if which_var == 4:  # Elevation
34    outname = name + '_elevation'
35    quantityname = 'elevation'  #Elevation
36
37if is_parallel == True:
38    for i in range(3,nodes):
39        namei = name + '_P%d_%d' %(i,nodes)
40        outnamei = outname + '_P%d_%d' %(i,nodes)
41        print 'start sww2dem for sww file %d' %(i)
42        sww2dem(namei, basename_out = outnamei,
43                    quantity = quantityname,
44                    timestep = 0,
45                    cellsize = 100,     
46                    #easting_min = project.e_min_area,
47                    #easting_max = project.e_max_area,
48                    #northing_min = project.n_min_area,
49                    #northing_max = project.n_max_area,       
50                    #reduction = max,
51                    verbose = True,
52                    format = 'asc')
53else:
54    print 'start sww2dem'
55    sww2dem(name, basename_out = outname,
56                quantity = quantityname,
57                cellsize = 20,     
58                easting_min = project.e_min_area,
59                easting_max = project.e_max_area,
60                northing_min = project.n_min_area,
61                northing_max = project.n_max_area,       
62                reduction = max, 
63                verbose = True,
64                format = 'asc')
Note: See TracBrowser for help on using the repository browser.