source: anuga_work/production/dampier_2006/export_results.py @ 4430

Last change on this file since 4430 was 4423, checked in by sexton, 17 years ago

updates for export scripts

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