source: anuga_work/production/busselton/export_results.py @ 5457

Last change on this file since 5457 was 5457, checked in by kristy, 14 years ago

Update files

File size: 3.3 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7#time_dir = '20080630_104134_run_trial_0.6_exmouth_5449_kvanputt'
8#time_dir = '20080630_111936_run_trial_0.6_exmouth_4695_kvanputt'
9#time_dir = '20080630_112512_run_trial_0.6_exmouth_4743_kvanputt'
10time_dir = '20080630_112830_run_trial_0.6_exmouth_4777_kvanputt'
11#time_dir = '20080630_114135_run_trial_0.6_exmouth_4901_kvanputt'
12#time_dir = '20080630_114503_run_trial_0.6_exmouth_4874_kvanputt'
13#time_dir = '20080630_114811_run_trial_0.6_exmouth_4990_kvanputt'
14#time_dir = '20080630_115238_run_trial_0.6_exmouth_5103_kvanputt'
15#time_dir = '20080630_115458_run_trial_0.6_exmouth_5185_kvanputt'
16#time_dir = '20080630_115757_run_trial_0.6_exmouth_5273_kvanputt'
17
18
19
20cellsize = 25
21#cellsize = 150
22timestep = 0
23directory = project.output_dir
24name = directory+sep+'test'+sep+time_dir+sep+project.scenario_name
25
26from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
27
28
29is_parallel = False
30#is_parallel = True
31
32if is_parallel == True: nodes = 4
33print 'output dir:', name
34
35#var = [0,4]
36#var = [2,3] # depth and Speed
37var = [4] # elevation
38
39
40for which_var in var:
41    if which_var == 0:  # Stage
42        outname = name + '_stage'
43        quantityname = 'stage'
44
45    if which_var == 1:  # Absolute Momentum
46        outname = name + '_momentum'
47        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
48
49    if which_var == 2:  # Depth
50        outname = name + '_depth'
51        quantityname = 'stage-elevation' 
52
53    if which_var == 3:  # Speed
54        outname = name + '_speed'
55        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
56
57    if which_var == 4:  # Elevation
58        outname = name + '_elevation'
59        quantityname = 'elevation'  #Elevation
60
61    if is_parallel == True:
62    #    print 'is_parallel',is_parallel
63        for i in range(0,nodes):
64            namei = name + '_P%d_%d' %(i,nodes)
65            outnamei = outname + '_P%d_%d' %(i,nodes)
66            print 'start sww2dem for sww file %d' %(i)
67            sww2dem(namei, basename_out = outnamei,
68                        quantity = quantityname,
69                        #timestep = timestep,
70                        cellsize = cellsize,     
71                        easting_min = project_grad.e_min_area,
72                        easting_max = project_grad.e_max_area,
73                        northing_min = project_grad.n_min_area,
74                        northing_max = project_grad.n_max_area,       
75                        reduction = max, 
76                        verbose = True,
77                        format = 'asc')
78    else:
79        print 'start sww2dem'
80        sww2dem(name, basename_out = outname,
81                    quantity = quantityname,
82                    #timestep = timestep,
83                    cellsize = cellsize,     
84                    #easting_min = project_grad.e_min_area,
85                    #easting_max = project_grad.e_max_area,
86                    #northing_min = project_grad.n_min_area,
87                    #northing_max = project_grad.n_max_area,       
88                    reduction = max, 
89                    verbose = True,
90                    format = 'asc')
91
Note: See TracBrowser for help on using the repository browser.