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

Last change on this file since 5415 was 5415, checked in by kristy, 16 years ago
File size: 2.8 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7time_dir = '20080530_170705_run_final_0.6_exmouth_kvanputt'
8time_dir = '20080619_115523_run_trial_0.6_exmouth_current_kvanputt'
9
10cellsize = 25
11#cellsize = 150
12#timestep = 0
13directory = project.output_dir
14name = directory+sep+'test'+sep+time_dir+sep+project.scenario_name
15
16from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
17
18
19is_parallel = False
20#is_parallel = True
21
22if is_parallel == True: nodes = 4
23print 'output dir:', name
24
25var = [2,3,4] # depth and speed
26#var = [2] # depth
27#var = [4]
28#var = [2] #depth
29
30for which_var in var:
31    if which_var == 0:  # Stage
32        outname = name + '_stage'
33        quantityname = 'stage'
34
35    if which_var == 1:  # Absolute Momentum
36        outname = name + '_momentum'
37        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
38
39    if which_var == 2:  # Depth
40        outname = name + '_depth'
41        quantityname = 'stage-elevation' 
42
43    if which_var == 3:  # Speed
44        outname = name + '_speed'
45        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
46
47    if which_var == 4:  # Elevation
48        outname = name + '_elevation'
49        quantityname = 'elevation'  #Elevation
50
51    if is_parallel == True:
52    #    print 'is_parallel',is_parallel
53        for i in range(0,nodes):
54            namei = name + '_P%d_%d' %(i,nodes)
55            outnamei = outname + '_P%d_%d' %(i,nodes)
56            print 'start sww2dem for sww file %d' %(i)
57            sww2dem(namei, basename_out = outnamei,
58                        quantity = quantityname,
59                        #timestep = timestep,
60                        cellsize = cellsize,     
61                        easting_min = project_grad.e_min_area,
62                        easting_max = project_grad.e_max_area,
63                        northing_min = project_grad.n_min_area,
64                        northing_max = project_grad.n_max_area,       
65                        reduction = max, 
66                        verbose = True,
67                        format = 'asc')
68    else:
69        print 'start sww2dem'
70        sww2dem(name, basename_out = outname,
71                    quantity = quantityname,
72                    #timestep = timestep,
73                    cellsize = cellsize,     
74                    #easting_min = project_grad.e_min_area,
75                    #easting_max = project_grad.e_max_area,
76                    #northing_min = project_grad.n_min_area,
77                    #northing_max = project_grad.n_max_area,       
78                    reduction = max, 
79                    verbose = True,
80                    format = 'asc')
81
Note: See TracBrowser for help on using the repository browser.