source: anuga_work/production/gold_coast_2007/export_results.py @ 4310

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

update damage scripts for FESA areas

File size: 2.4 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7#time_dir = '20070228_071238' # 6.0 m
8#time_dir = '20070305_051718' # 2.5m
9#time_dir = '20070305_051728' # 3.5m
10#time_dir = '20070305_051817' # 4.5m
11time_dir = '20070314_231144' # 4.5 tide
12#time_dir = '20070314_231156' # 5m tide
13
14
15directory = project.outputdir
16name = directory + time_dir + sep + project.basename
17
18is_parallel = False
19if is_parallel == True: nodes = 4
20print 'output dir:', name
21
22which_var = 2
23if which_var == 0:  # Stage
24    outname = name + '_stage-eq-thurs-test'
25    quantityname = 'stage'
26
27if which_var == 1:  # Absolute Momentum
28    outname = name + '_momentum_i1'
29    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
30
31if which_var == 2:  # Depth
32    outname = name + '_depth'
33    quantityname = 'stage-elevation' 
34
35if which_var == 3:  # Speed
36    outname = name + '_speed_i0'
37    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
38    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
39
40if which_var == 4:  # Elevation
41    outname = name + '_elevation'
42    quantityname = 'elevation'  #Elevation
43
44if is_parallel == True:
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 = 1,
52                    cellsize = 100,     
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')
60else:
61    print 'start sww2dem'
62    sww2dem(name, basename_out = outname,
63                quantity = quantityname,
64                #timestep = 0,
65                cellsize = 20,     
66                easting_min = project.eastingmin,
67                easting_max = project.eastingmax,
68                northing_min = project.northingmin,
69                northing_max = project.northingmax,       
70                reduction = max, 
71                verbose = True,
72                format = 'asc')
Note: See TracBrowser for help on using the repository browser.