source: anuga_work/production/shark_bay_2007/export_results.py @ 4689

Last change on this file since 4689 was 4624, checked in by sexton, 17 years ago

export scripts for Shark Bay

File size: 2.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 = '20070711_034317_run_final_0.0_shark_bay_onielsen_10000_tide0.0_coastpolys' # July 2006 event; small domain
8time_dir = '20070710_023824_run_final_-0.85_shark_bay_onielsen_july2006_tide-0.85_coastpolys' # July 2006; larger domain
9cellsize = 20
10timestep = None
11directory = project.output_dir
12
13name = directory+time_dir+sep+project.scenario_name
14
15is_parallel = False
16if is_parallel == True: nodes = 4
17print 'output dir:', name
18
19var = [0,2,3] # stage, depth and speed
20#var = [4]
21
22for which_var in var:
23    if which_var == 0:  # Stage
24        outname = name + '_stage'
25        quantityname = 'stage'
26
27    if which_var == 1:  # Absolute Momentum
28        outname = name + '_momentum_i1'
29        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
30
31    if which_var == 2:  # Depth
32        outname = name + '_depth'
33        quantityname = 'stage-elevation' 
34
35    if which_var == 3:  # Speed
36        outname = name + '_speed'
37        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
38
39    if which_var == 4:  # Elevation
40        outname = name + '_elevation'
41        quantityname = 'elevation'  #Elevation
42
43    if is_parallel == True:
44    #    print 'is_parallel',is_parallel
45        for i in range(0,nodes):
46            namei = name + '_P%d_%d' %(i,nodes)
47            outnamei = outname + '_P%d_%d' %(i,nodes)
48            print 'start sww2dem for sww file %d' %(i)
49            sww2dem(namei, basename_out = outnamei,
50                        quantity = quantityname,
51                        timestep = timestep,
52                        cellsize = cellsize,     
53                        easting_min = project.e_min_area,
54                        easting_max = project.e_max_area,
55                        northing_min = project.n_min_area,
56                        northing_max = project.n_max_area,       
57                        reduction = max, 
58                        verbose = True,
59                        format = 'asc')
60    else:
61        print 'start sww2dem'
62        sww2dem(name, basename_out = outname,
63                    quantity = quantityname,
64                    timestep = timestep,
65                    cellsize = cellsize,     
66                    easting_min = project.e_min_area,
67                    easting_max = project.e_max_area,
68                    northing_min = project.n_min_area,
69                    northing_max = project.n_max_area,       
70                    reduction = max, 
71                    verbose = True,
72                    format = 'asc')
Note: See TracBrowser for help on using the repository browser.