source: anuga_work/production/exmouth_2006/export_results.py @ 4856

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

rename plot_polygons_points to original name of plot_polygons

File size: 2.9 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7#time_dir = '20070618_035101_run_final_1.4_dampier_nbartzis' # HAT 1 in Dampier 10000 yr
8#time_dir = '20070618_035114_run_final_0_dampier_nbartzis' # MSL 1 in Dampier 10000 yr
9#time_dir = '20070619_042043_run_final_1.4_onslow_nbartzis' # HAT 1 in Onslow 10000 yr
10#time_dir = '20070619_042140_run_final_0_onslow_nbartzis' # MSL 1 in Onslow 10000 yr
11#time_dir = '20070619_042542_run_final_1.4_exmouth_nbartzis' # HAT 1 in Exmouth 10000 yr
12time_dir = '20070619_042417_run_final_0_exmouth_nbartzis' # MSL 1 in Exmouth 10000 yr
13cellsize = 25
14timestep = None
15directory = project.output_dir
16
17name = directory+time_dir+sep+project.scenario_name
18
19is_parallel = True
20if is_parallel == True: nodes = 4
21print 'output dir:', name
22
23var = [2,3] # depth and speed
24
25for which_var in var:
26    if which_var == 0:  # Stage
27        outname = name + '_stage'
28        quantityname = 'stage'
29
30    if which_var == 1:  # Absolute Momentum
31        outname = name + '_momentum_i1'
32        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
33
34    if which_var == 2:  # Depth
35        outname = name + '_depth_north'
36        quantityname = 'stage-elevation' 
37
38    if which_var == 3:  # Speed
39        outname = name + '_speed_north'
40        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
41
42    if which_var == 4:  # Elevation
43        outname = name + '_elevation'
44        quantityname = 'elevation'  #Elevation
45
46    if is_parallel == True:
47    #    print 'is_parallel',is_parallel
48        for i in range(0,nodes):
49            namei = name + '_P%d_%d' %(i,nodes)
50            outnamei = outname + '_P%d_%d' %(i,nodes)
51            print 'start sww2dem for sww file %d' %(i)
52            sww2dem(namei, basename_out = outnamei,
53                        quantity = quantityname,
54                        timestep = timestep,
55                        cellsize = cellsize,     
56                        easting_min = project.e_min_area,
57                        easting_max = project.e_max_area,
58                        northing_min = project.n_min_area,
59                        northing_max = project.n_max_area,       
60                        reduction = max, 
61                        verbose = True,
62                        format = 'asc')
63    else:
64        print 'start sww2dem'
65        sww2dem(name, basename_out = outname,
66                    quantity = quantityname,
67                    timestep = timestep,
68                    cellsize = cellsize,     
69                    easting_min = project.e_min_area,
70                    easting_max = project.e_max_area,
71                    northing_min = project.n_min_area,
72                    northing_max = project.n_max_area,       
73                    reduction = max, 
74                    verbose = True,
75                    format = 'asc')
Note: See TracBrowser for help on using the repository browser.