source: anuga_work/production/geraldton/export_results.py @ 5752

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

Copied from Busselton

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