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

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

Addition of Polyline information with sts files

File size: 3.7 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'
10#time_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#time_dir = '20080707_164738_run_trial_0.6_exmouth_5120_kvanputt'
18#time_dir = '20080707_165101_run_trial_0.6_exmouth_5140_kvanputt'
19#time_dir = '20080707_165619_run_trial_0.6_exmouth_5160_kvanputt'
20#time_dir = '20080708_101451_run_trial_0.6_exmouth_4743_jsexton'
21#time_dir = '20080708_101731_run_trial_0.6_exmouth_4777_jsexton'
22#time_dir = '20080710_095410_run_trial_0.6_exmouth_4695_jsexton'
23time_dir = '20080717_092900_run_final_0_exmouth_newExtent_kvanputt'
24
25
26cellsize = 25
27#cellsize = 150
28timestep = 0
29directory = project.output_dir
30name = directory+sep+'test'+sep+time_dir+sep+project.scenario_name
31
32from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
33
34
35is_parallel = False
36#is_parallel = True
37
38if is_parallel == True: nodes = 4
39print 'output dir:', name
40
41var = [0,4] 
42#var = [2,3] # depth and Speed
43#var = [2,3,4] # elevation, depth and Speed
44
45
46for which_var in var:
47    if which_var == 0:  # Stage
48        outname = name + '_stage'
49        quantityname = 'stage'
50
51    if which_var == 1:  # Absolute Momentum
52        outname = name + '_momentum'
53        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
54
55    if which_var == 2:  # Depth
56        outname = name + '_depth'
57        quantityname = 'stage-elevation' 
58
59    if which_var == 3:  # Speed
60        outname = name + '_speed'
61        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
62
63    if which_var == 4:  # Elevation
64        outname = name + '_elevation'
65        quantityname = 'elevation'  #Elevation
66
67    if is_parallel == True:
68    #    print 'is_parallel',is_parallel
69        for i in range(0,nodes):
70            namei = name + '_P%d_%d' %(i,nodes)
71            outnamei = outname + '_P%d_%d' %(i,nodes)
72            print 'start sww2dem for sww file %d' %(i)
73            sww2dem(namei, basename_out = outnamei,
74                        quantity = quantityname,
75                        #timestep = timestep,
76                        cellsize = cellsize,     
77                        easting_min = project_grad.e_min_area,
78                        easting_max = project_grad.e_max_area,
79                        northing_min = project_grad.n_min_area,
80                        northing_max = project_grad.n_max_area,       
81                        reduction = max, 
82                        verbose = True,
83                        format = 'asc')
84    else:
85        print 'start sww2dem'
86        sww2dem(name, basename_out = outname,
87                    quantity = quantityname,
88                    timestep = timestep,
89                    cellsize = cellsize,     
90                    #easting_min = project_grad.e_min_area,
91                    #easting_max = project_grad.e_max_area,
92                    #northing_min = project_grad.n_min_area,
93                    #northing_max = project_grad.n_max_area,       
94                    reduction = max, 
95                    verbose = True,
96                    format = 'asc')
97
Note: See TracBrowser for help on using the repository browser.