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

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

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

File size: 6.9 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2Also includes origin for slump scenario.
3"""
4
5from os import sep, environ, getenv, getcwd
6from os.path import expanduser
7from anuga.utilities.polygon import read_polygon, polygon_area
8import sys
9
10from anuga.coordinate_transforms.redfearn import convert_from_latlon_to_utm
11
12from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
13
14from time import localtime, strftime, gmtime
15               
16#Making assumptions about the location of scenario data
17state = 'western_australia'
18scenario_dir_name = 'onslow_tsunami_scenario_2006'
19scenario_name = 'onslow'
20
21# 250m data to be provided
22coarsename = 'onsl_bathydem250' # get from Neil/Ingo (DEM or topo data)
23
24# 30m data to be provided
25onshore_name_dted = 'onslow_onshore_30m_dted2' # get from Neil/Ingo (DEM or topo data)
26
27# 20m data to be provided
28onshore_name_dli = 'onslow_onshore_20m_dli' # get from Neil/Ingo (DEM or topo data)
29
30coast_name = 'onslow_coast'
31islands_name = 'onslow_islands_dted2'
32offshore_name = 'onslow_offshore_points'
33
34boundary_basename = 'SU-AU_clip'
35
36#swollen/ all data output
37basename = 'source'
38
39codename = 'project.py'
40
41if sys.platform == 'win32':
42    home = getenv('INUNDATIONHOME')
43#    python_home = getenv('PWD')     
44#    home = environ['INUNDATIONHOME']     #Sandpit's parent dir
45    user = getenv('USERPROFILE')
46#    user = basename(user_path)
47   
48else:   
49    home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation')     
50    user = getenv('LOGNAME')
51    print 'USER:', user
52
53# INUNDATIONHOME is the inundation directory, not the data directory.
54home += sep +'data'
55
56#Derive subdirectories and filenames
57#time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
58local_time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
59
60meshdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'meshes'+sep
61datadir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'topographies'+sep
62gaugedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'gauges'+sep
63polygondir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'polygons'+sep
64boundarydir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'boundaries'+sep
65#output dir without time
66outputdir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep
67tidedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'tide_data'+sep
68comparereportdir = '..'+sep+'..'+sep+'documentation'+sep+'experimentation'+sep+'boundary_ANUGA_MOST'+sep+'report'
69
70outputtimedir = outputdir + local_time + sep
71
72print'bound', boundarydir
73
74#gauge_filename = gaugedir + 'onslow_gauges.xya'
75#for MOST
76gauge_filename = gaugedir + 'gauge_location_onslow.csv'
77gauge_filename_bindi = gaugedir + 'gauge_location_bindi.csv'
78gauges50 = gaugedir + '50_gauges.xya'
79gauge_comparison = gaugedir + 'MOST_comparison_gauges.xya'
80gauge_comparison_3d = gaugedir + 'MOST_comparison_gauges_3d.xya'
81community_filename = gaugedir + 'CHINS_v2.csv'
82community_scenario = gaugedir + 'community_onslow.csv'
83buildings_filename = gaugedir + 'Onslow_res_Project.csv'
84buildings_filename_out = gaugedir + 'Onslow_res_Project.csv'
85
86
87gaugetimeseries = gaugedir + 'onslow'
88
89tidal_filename = tidedir + 'onsl.txt'
90tidal_outname = tidedir + 'max_min.txt'
91
92# boundary source data
93#MOST_dir = 'f:'+sep+'3'+sep+'ehn'+sep+'users'+sep+'davidb'+sep+'tsunami'+sep+'WA_project'+sep+'SU-AU_90'+sep+'most_2'+sep+'detailed'+sep
94
95codedir = getcwd()+sep
96                               
97codedirname = codedir + 'project.py'
98
99#meshname = meshdir + basename
100meshname = outputtimedir + 'mesh_' + basename
101print 'meshname',meshname
102coarsedemname = datadir + coarsename
103
104onshore_dem_name = datadir + onshore_name_dli
105
106offshore_dem_name = datadir + offshore_name
107coast_dem_name = datadir + coast_name
108islands_dem_name = datadir + islands_name
109combined_dem_name = datadir + 'onslow_combined_elevation'
110
111outputname = outputtimedir + basename  #Used by post processing
112
113#!gauge_filename = outputdir + 'onslow_gauges.xya'
114#!gauge_outname = outputdir + 'gauges_max_output.xya'
115
116# clipping region to make DEM (pts file) from fine elevation data
117eastingmin = 240000
118eastingmax = 340000
119northingmin = 7580000
120northingmax = 7700000
121
122south = degminsec2decimal_degrees(-22,15,0)
123north = degminsec2decimal_degrees(-20,30,0)
124west = degminsec2decimal_degrees(114,15,0)
125east = degminsec2decimal_degrees(115,50,0)
126'''
127# region for visualisation
128eminviz = 260000
129emaxviz = 320000
130nminviz = 7590000
131nmaxviz = 7630000
132'''
133# region to export
134
135e_min_area = 290500
136e_max_area = 321500
137n_min_area = 7601550
138n_max_area = 7620000
139
140# region to export to make elevation map: JS 22/9/06 - NOTE, this won't
141# work as region needs to be inside bounding box (polyAll)!!
142
143#e_min_area = 240000
144#e_max_area = 340000
145#n_min_area = 7580000
146#n_max_area = 7690000
147export_region = [[e_min_area, n_min_area],
148                 [e_min_area, n_max_area],
149                 [e_max_area, n_max_area],
150                 [e_max_area, n_min_area]]
151#Georeferencing
152from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
153
154refzone = 50
155
156#Updated Main Domain of Onslow: first run NB 6/4/06
157d0 = [310000, 7690000]
158d1 = [280000, 7690000]
159d2 = [270000, 7645000]
160d3 = [240000, 7625000]
161d4 = [270000, 7580000]
162d5 = [300000, 7590000]
163d6 = [340000, 7610000]
164
165polyAll = [d0, d1, d2, d3, d4, d5, d6]
166print 'bounding polygon area', polygon_area(polyAll)/1000000.0
167polygons = [polyAll, export_region]
168figname = 'checking.png'
169#Interior region - Onslow town
170
171#for visualisation
172#i0 = [304000, 7609000]
173#i1 = [301500, 7605000]
174#i2 = [304000, 7603000]
175#i3 = [307000, 7602000]
176#i4 = [309000, 7603000]
177#i5 = [311000, 7607000]
178
179#i0 = [304000, 7608000]
180i0 = [304000, 7607000]
181i1 = [302000, 7605000]
182#i2 = [303000, 7602000]
183i2 = [304000, 7603000]
184#i3 = [305000, 7601000]
185i3 = [307000, 7602000]
186i4 = [309000, 7603000]
187#i5 = [307000, 7606500]
188i5 = [307000, 7606000]
189
190
191poly_onslow = [i0, i1, i2, i3, i4, i5]
192print 'onslow polygon area', polygon_area(poly_onslow)/1000000.0
193#Thevenard Island
194j0 = [294000, 7629000]
195j1 = [285000, 7625000]
196j2 = [294000, 7621000]
197j3 = [299000, 7625000]
198
199poly_thevenard = [j0, j1, j2, j3]
200print 'thevenard polygon area', polygon_area(poly_thevenard)/1000000.0
201'''
202# Direction Is
203k0 = [309000, 7619000]
204k1 = [304000, 7619000]
205k2 = [304000, 7616500]
206k3 = [309000, 7616500]
207
208poly_direction = [k0, k1, k2, k3]
209'''
210
211#med res around onslow
212l0 = [300000, 7610000]
213l1 = [285000, 7600000]
214l2 = [300000, 7597500]
215l3 = [310000, 7600000]
216l4 = [315000, 7610000]
217#l5 = [310000, 7612500]
218
219#poly_coast = [l0, l1, l2, l3, l4, l5]
220poly_coast = [l0, l1, l2, l3, l4]
221print 'coast polygon area', polygon_area(poly_coast)/1000000.0
222#general coast and local area to onslow region
223m0 = [270000, 7581000]
224m1 = [300000, 7591000]
225m2 = [339000, 7610000]
226m3 = [330000, 7630000]
227m4 = [290000, 7640000]
228m5 = [260000, 7600000]
229
230poly_region = [m0, m1, m2, m3, m4, m5]
231print 'region polygon area', polygon_area(poly_region)/1000000.0
Note: See TracBrowser for help on using the repository browser.