source: anuga_work/production/perth/export_results_all.py @ 5714

Last change on this file since 5714 was 5669, checked in by kristy, 17 years ago

Updated

File size: 4.6 KB
Line 
1import project, os
2import sys
3from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
4
5from anuga.shallow_water.data_manager import sww2dem
6from os import sep
7
8#time_dir = '20080526_104946_run_final_0.6_test_kvanputt'
9#time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt'
10#time_dir = '20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt'
11time_dir = '20080815_103336_run_final_0.6_polyline_alpha0.1_kvanputt'
12
13is_parallel = False
14#is_parallel = True
15if is_parallel == True: nodes = 4
16
17
18cellsize = 15
19#cellsize = 150
20#timestep = 0
21directory = project.output_dir
22name1 = directory+time_dir+sep+project.scenario_name
23name2 = directory+time_dir+sep+'perth_time_39900'+sep+project.scenario_name+'_time_39900_0'
24#name2 = directory+time_dir+sep+project.scenario_name+'_time_39900_0'
25names = [name1, name2]
26for name in names:
27
28    area = ['Geordie', 'Sorrento', 'Fremantle', 'Rockingham']
29
30    for which_area in area:
31        if which_area == 'Geordie':
32            easting_min = project.xminGeordie
33            easting_max = project.xmaxGeordie
34            northing_min = project.yminGeordie
35            northing_max = project.ymaxGeordie
36
37        if which_area == 'Sorrento':
38            easting_min = project.xminSorrento
39            easting_max = project.xmaxSorrento
40            northing_min = project.yminSorrento
41            northing_max = project.ymaxSorrento
42
43        if which_area == 'Fremantle':
44            easting_min = project.xminFremantle
45            easting_max = project.xmaxFremantle
46            northing_min = project.yminFremantle
47            northing_max = project.ymaxFremantle
48
49        if which_area == 'Rockingham':
50            easting_min = project.xminRockingham
51            easting_max = project.xmaxRockingham
52            northing_min = project.yminRockingham
53            northing_max = project.ymaxRockingham
54
55        var = [2] # momentum and depth
56        #var = [2] # depth
57        #var = [0,4]
58
59        for which_var in var:
60            if which_var == 0:  # Stage
61                outname = name + which_area + '_stage' 
62                quantityname = 'stage'
63
64            if which_var == 1:  # Absolute Momentum
65                outname = name + which_area + '_momentum' 
66                quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
67
68            if which_var == 2:  # Depth
69                outname = name + which_area + '_depth'
70                quantityname = 'stage-elevation' 
71
72            if which_var == 3:  # Speed
73                outname = name + which_area + '_speed'
74                #quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
75                quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)'  #Speed
76               
77            if which_var == 4:  # Elevation
78                outname = name + which_area + '_elevation'
79                quantityname = 'elevation'  #Elevation
80
81            if is_parallel == True:
82            #    print 'is_parallel',is_parallel
83                for i in range(0,nodes):
84                    namei = name + '_P%d_%d' %(i,nodes)
85                    outnamei = outname + '_P%d_%d' %(i,nodes)
86                    print 'start sww2dem for sww file %d' %(i)
87                    sww2dem(namei, basename_out = outnamei,
88                                quantity = quantityname,
89                                timestep = timestep,
90                                cellsize = cellsize,     
91                                easting_min = project_grad.e_min_area,
92                                easting_max = project_grad.e_max_area,
93                                northing_min = project_grad.n_min_area,
94                                northing_max = project_grad.n_max_area,       
95                                reduction = max, 
96                                verbose = True,
97                                format = 'asc')
98            else:
99                print 'start sww2dem',which_area, easting_min
100                sww2dem(name, basename_out = outname,
101                            quantity = quantityname,
102                            #timestep = timestep,
103                            cellsize = cellsize,     
104                            easting_min = easting_min,
105                            easting_max = easting_max,
106                            northing_min = northing_min,
107                            northing_max = northing_max,       
108                            reduction = max, 
109                            verbose = True,
110                            format = 'asc')
111
Note: See TracBrowser for help on using the repository browser.