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

Last change on this file since 4069 was 4069, checked in by sexton, 18 years ago

nsw slide modelling updates

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