source: anuga_work/production/onslow_2006/export_results.py @ 4504

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

minor change to inundation_damage + updates to damage scripts for all scenarios

File size: 3.1 KB
Line 
1import project, os
2import sys
3
4from anuga.shallow_water.data_manager import sww2dem
5from os import sep
6
7#time_dir = '20070507_215717_run_final_1.5_nbartzis' # HAT 1 in Dampier 10000 yr
8#time_dir = '20070517_061654_run_final_0.0_nbartzis' # MSL 1 in Dampier 10000 yr
9#time_dir = '' # HAT 1 in Broome 10000 yr
10#time_dir = '' # MSL 1 in Broome 10000 yr
11#time_dir = '' # HAT 1 in Pt Hedland 10000 yr
12#time_dir = '' # MSL 1 in Pt Hedland 10000 yr
13#time_dir = '' # HAT 1 in Onslow 10000 yr
14#time_dir = '' # MSL 1 in Onslow 10000 yr
15#time_dir = '' # HAT 1 in Exmouth 10000 yr
16#time_dir = '' # MSL 1 in Exmouth 10000 yr
17time_dir = '20060704_063005' # 2006 simulation HAT Mw9
18#cellsize = 30
19cellsize = 250
20timestep = None
21directory = project.outputdir
22#name = directory + time_dir + sep + project.scenario_name
23#name = directory+time_dir+sep+project.scenario_name
24name = directory+time_dir+sep+'source'
25
26is_parallel = False
27#is_parallel = True
28if is_parallel == True: nodes = 4
29print 'output dir:', name
30
31#var = [2,3,4] # depth and speed
32var = [3] # depth and speed
33
34for which_var in var:
35    if which_var == 0:  # Stage
36        outname = name + '_stage'
37        quantityname = 'stage'
38
39    if which_var == 1:  # Absolute Momentum
40        outname = name + '_momentum_i1'
41        quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
42
43    if which_var == 2:  # Depth
44        outname = name + '_depth'
45        quantityname = 'stage-elevation' 
46
47    if which_var == 3:  # Speed
48        outname = name + '_speed'
49        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
50
51    if which_var == 4:  # Elevation
52        outname = name + '_elevation'
53        quantityname = 'elevation'  #Elevation
54
55    if is_parallel == True:
56    #    print 'is_parallel',is_parallel
57        for i in range(0,nodes):
58            namei = name + '_P%d_%d' %(i,nodes)
59            outnamei = outname + '_P%d_%d' %(i,nodes)
60            print 'start sww2dem for sww file %d' %(i)
61            sww2dem(namei, basename_out = outnamei,
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')
72    else:
73        print 'start sww2dem'
74        sww2dem(name, basename_out = outname,
75                    quantity = quantityname,
76                    timestep = timestep,
77                    cellsize = cellsize,     
78                    #easting_min = project.e_min_area,
79                    #easting_max = project.e_max_area,
80                    #northing_min = project.n_min_area,
81                    #northing_max = project.n_max_area,       
82                    reduction = max, 
83                    verbose = True,
84                    format = 'asc')
Note: See TracBrowser for help on using the repository browser.