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

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

(1) updates to make_report script to handle multiple events for multiple return periods (2) take Onslow changes through to Port Hedland and Dampier

File size: 7.4 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'
83#buildings_filename = gaugedir + 'onslow_res.csv'
84buildings_filename = gaugedir + 'extra_points_nbed.csv'
85#buildings_filename_out = gaugedir + 'onslow_res_modified.csv'
86buildings_filename_damage_out = 'extra_points_nbed_modified.csv'
87
88gaugetimeseries = gaugedir + 'onslow'
89
90tidal_filename = tidedir + 'onsl.txt'
91tidal_outname = tidedir + 'max_min.txt'
92
93# boundary source data
94#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
95
96codedir = getcwd()+sep
97                               
98codedirname = codedir + 'project.py'
99
100#meshname = meshdir + basename
101meshname = outputtimedir + 'mesh_' + basename
102print 'meshname',meshname
103coarsedemname = datadir + coarsename
104
105onshore_dem_name = datadir + onshore_name_dli
106
107offshore_dem_name = datadir + offshore_name
108coast_dem_name = datadir + coast_name
109islands_dem_name = datadir + islands_name
110combined_dem_name = datadir + 'onslow_combined_elevation'
111
112outputname = outputtimedir + basename  #Used by post processing
113
114#!gauge_filename = outputdir + 'onslow_gauges.xya'
115#!gauge_outname = outputdir + 'gauges_max_output.xya'
116
117# clipping region to make DEM (pts file) from fine elevation data
118eastingmin = 240000
119eastingmax = 340000
120northingmin = 7580000
121northingmax = 7700000
122
123south = degminsec2decimal_degrees(-22,15,0)
124north = degminsec2decimal_degrees(-20,30,0)
125west = degminsec2decimal_degrees(114,15,0)
126east = degminsec2decimal_degrees(115,50,0)
127'''
128# region for visualisation
129eminviz = 260000
130emaxviz = 320000
131nminviz = 7590000
132nmaxviz = 7630000
133'''
134# region to export
135
136e_min_area = 300000
137e_max_area = 310000
138n_min_area = 7600000
139n_max_area = 7610000
140
141# region to export to make elevation map: JS 22/9/06 - NOTE, this won't
142# work as region needs to be inside bounding box (polyAll)!!
143
144e_min_area = 240000
145e_max_area = 340000
146n_min_area = 7580000
147n_max_area = 7690000
148export_region = [[e_min_area, n_min_area],
149                 [e_min_area, n_max_area],
150                 [e_max_area, n_max_area],
151                 [e_max_area, n_min_area]]
152#Georeferencing
153from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
154
155refzone = 50
156
157#Updated Main Domain of Onslow: first run NB 6/4/06
158d0 = [310000, 7690000]
159d1 = [280000, 7690000]
160d2 = [270000, 7645000]
161d3 = [240000, 7625000]
162d4 = [270000, 7580000]
163d5 = [300000, 7590000]
164d6 = [340000, 7610000]
165
166polyAll = [d0, d1, d2, d3, d4, d5, d6]
167print 'bounding polygon area', polygon_area(polyAll)/1000000.0
168polygons = [polyAll, export_region]
169figname = 'checking.png'
170#from anuga.utilities.polygon import plot_polygons
171#plot_polygons(polygons, figname, verbose = False)
172#print figname
173#Interior region - Onslow town
174
175#first run!
176#i0 = [304000, 7608000]
177#i1 = [302000, 7605000]
178#i2 = [303000, 7602000]
179#i3 = [305000, 7601000]
180#i4 = [309000, 7603000]
181#i5 = [307000, 7606500]
182
183#refined run
184#i0 = [304000, 7607000]
185#i1 = [302000, 7605000]
186#i2 = [304000, 7603000]
187#i3 = [307000, 7602000]
188#i4 = [309000, 7603000]
189#i5 = [307000, 7606000]
190
191#for visualisation
192#i0 = [304000, 7609000]
193#i1 = [301500, 7605000]
194#i2 = [304000, 7603000]
195#i3 = [307000, 7602000]
196#i4 = [309000, 7603000]
197#i5 = [311000, 7607000]
198
199#i0 = [304000, 7608000]
200i0 = [304000, 7607000]
201i1 = [302000, 7605000]
202#i2 = [303000, 7602000]
203i2 = [304000, 7603000]
204#i3 = [305000, 7601000]
205i3 = [307000, 7602000]
206i4 = [309000, 7603000]
207#i5 = [307000, 7606500]
208i5 = [307000, 7606000]
209
210
211poly_onslow = [i0, i1, i2, i3, i4, i5]
212print 'onslow polygon area', polygon_area(poly_onslow)/1000000.0
213#Thevenard Island
214j0 = [294000, 7629000]
215j1 = [285000, 7625000]
216j2 = [294000, 7621000]
217j3 = [299000, 7625000]
218
219poly_thevenard = [j0, j1, j2, j3]
220print 'thevenard polygon area', polygon_area(poly_thevenard)/1000000.0
221'''
222# Direction Is
223k0 = [309000, 7619000]
224k1 = [304000, 7619000]
225k2 = [304000, 7616500]
226k3 = [309000, 7616500]
227
228poly_direction = [k0, k1, k2, k3]
229'''
230
231#med res around onslow
232l0 = [300000, 7610000]
233l1 = [285000, 7600000]
234l2 = [300000, 7597500]
235l3 = [310000, 7600000]
236l4 = [315000, 7610000]
237#l5 = [310000, 7612500]
238
239#poly_coast = [l0, l1, l2, l3, l4, l5]
240poly_coast = [l0, l1, l2, l3, l4]
241print 'coast polygon area', polygon_area(poly_coast)/1000000.0
242#general coast and local area to onslow region
243m0 = [270000, 7581000]
244m1 = [300000, 7591000]
245m2 = [339000, 7610000]
246m3 = [330000, 7630000]
247m4 = [290000, 7640000]
248m5 = [260000, 7600000]
249
250poly_region = [m0, m1, m2, m3, m4, m5]
251print 'region polygon area', polygon_area(poly_region)/1000000.0
Note: See TracBrowser for help on using the repository browser.