source: anuga_work/production/wollongong_2006/export_results.py @ 4073

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

(1) DEM SPOT questionnaire (2) update slide modelling

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