source: anuga_work/production/perth/project.py @ 6434

Last change on this file since 6434 was 6434, checked in by myall, 14 years ago

different gauge file

File size: 12.5 KB
Line 
1"""Common filenames and locations for elevation, meshes and outputs.
2This script is the heart of all scripts in the folder
3"""
4#------------------------------------------------------------------------------
5# Import necessary modules
6#------------------------------------------------------------------------------
7
8from os import sep, environ, getenv, getcwd
9from os.path import expanduser
10import sys
11from time import localtime, strftime, gmtime
12from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles
13from anuga.utilities.system_tools import get_user_name, get_host_name
14from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary
15from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
16
17#------------------------------------------------------------------------------
18# Directory setup
19#------------------------------------------------------------------------------
20# Note: INUNDATIONHOME is the inundation directory, not the data directory.
21
22home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name()
23muxhome = getenv('MUXHOME')
24user = get_user_name()
25host = get_host_name()
26
27# determines time for setting up output directories
28time = strftime('%Y%m%d_%H%M%S',localtime()) 
29gtime = strftime('%Y%m%d_%H%M%S',gmtime()) 
30build_time = time+'_build'
31run_time = time+'_run'
32
33#------------------------------------------------------------------------------
34# Initial Conditions
35#------------------------------------------------------------------------------
36
37# this section needs to be updated to reflect the modelled community.
38# Note, the user needs to set up the directory system accordingly
39state = 'western_australia'
40scenario_name = 'perth'
41scenario = 'perth_tsunami_scenario'
42
43# Model specific parameters. One or all can be changed each time the
44# run_scenario script is executed
45tide = 0.6               #0.6
46event_number = 27255 # Java 9.3 worst case for Perth
47#event_number = 68693 # Sumatra 9.2
48#event_number = 27283  # Java 9.3 original
49alpha = 0.1             # smoothing parameter for mesh
50friction=0.01           # manning's friction coefficient
51starttime=0             
52finaltime=80000         # final time for simulation
53
54setup='final'  # Final can be replaced with trial or basic.
55               # Either will result in a coarser mesh that will allow a
56               # faster, but less accurate, simulation.
57
58if setup =='trial':
59    print'trial'
60    res_factor=10
61    time_thinning=48
62    yieldstep=240
63if setup =='basic': 
64    print'basic'
65    res_factor=4
66    time_thinning=12
67    yieldstep=120
68if setup =='final': 
69    print'final'
70    res_factor=1
71    time_thinning=4
72    yieldstep=60
73
74#------------------------------------------------------------------------------
75# Output Filename
76#------------------------------------------------------------------------------
77# Important to distinguish each run - ensure str(user) is included!
78# Note, the user is free to include as many parameters as desired
79dir_comment='_'+setup+'_'+str(tide)+'_'+str(event_number)+'_'+ 'Rottnest_'+str(user)
80
81#------------------------------------------------------------------------------
82# Input Data
83#------------------------------------------------------------------------------
84
85# elevation data used in build_perth.py
86# onshore data: format ascii grid with accompanying projection file
87onshore_name = 'perth_dli_ext' 
88# island: format ascii grid with accompanying projection file
89island_name = 'rott_dli_ext' 
90island_name1 = 'gard_dli_ext'
91island_name2 = 'carnac_island_dli_ext'
92island_name3 = 'penguin_dli_ext'
93# coastline: format x,y,elevation (with title)
94coast_name = 'coastline_perthP.txt'
95# bathymetry: format x,y,elevation (with title)
96offshore_name = 'Perth.txt'
97offshore_name1 = 'Perth_Chart.txt'
98offshore_name2 = 'Fremantle_north.txt'
99offshore_name3 = 'port_swanriver.txt'
100
101# gauges - used in get_timeseries.py
102##gauge_name = 'perth.csv'
103gauge_name = 'MH_gauges2.csv'
104
105#buildings - used in run_building_inundation.py
106building = 'perth_res_combined'
107
108
109# BOUNDING POLYGON - used in build_boundary.py and run_perth.py respectively
110# NOTE: when files are put together the points must be in sequence - for ease go clockwise!
111# Check the run_perth.py for boundary_tags
112# thinned ordering file from Hazard Map: format is index,latitude,longitude (with title)
113order_filename = 'thinned_boundary_ordering.csv'
114#landward bounding points
115landward = 'landward_bounding_polygon.csv'
116
117#------------------------------------------------------------------------------
118# Output Elevation Data
119#------------------------------------------------------------------------------
120# Output filename for elevation
121# this is a combination of all the data (utilisied in build_boundary)
122combined_name ='perth_combined_elevation'
123combined_smaller_name = 'perth_combined_elevation_smaller'
124
125#------------------------------------------------------------------------------
126# Directory Structure
127#------------------------------------------------------------------------------
128anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
129topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
130topographies_dir = anuga_dir+'topographies'+sep
131polygons_dir = anuga_dir+'polygons'+sep
132tide_dir = anuga_dir+'tide_data'+sep
133boundaries_dir = anuga_dir+'boundaries'+ sep
134output_dir = anuga_dir+'outputs'+sep
135gauges_dir = anuga_dir+'gauges'+sep
136meshes_dir = anuga_dir+'meshes'+sep
137
138#------------------------------------------------------------------------------
139# Location of input and output data
140#------------------------------------------------------------------------------
141# where the input data sits
142onshore_in_dir_name = topographies_in_dir + onshore_name
143island_in_dir_name = topographies_in_dir + island_name
144island_in_dir_name1 = topographies_in_dir + island_name1
145island_in_dir_name2 = topographies_in_dir + island_name2
146island_in_dir_name3 = topographies_in_dir + island_name3
147coast_in_dir_name = topographies_in_dir + coast_name
148offshore_in_dir_name = topographies_in_dir + offshore_name
149offshore_in_dir_name1 = topographies_in_dir + offshore_name1
150offshore_in_dir_name2 = topographies_in_dir + offshore_name2
151offshore_in_dir_name3 = topographies_in_dir + offshore_name3
152
153# where the output data sits
154onshore_dir_name = topographies_dir + onshore_name
155island_dir_name = topographies_dir + island_name
156island_dir_name1 = topographies_dir + island_name1
157island_dir_name2 = topographies_dir + island_name2
158island_dir_name3 = topographies_dir + island_name3
159coast_dir_name = topographies_dir + coast_name
160offshore_dir_name = topographies_dir + offshore_name
161offshore_dir_name1 = topographies_dir + offshore_name1
162offshore_dir_name2 = topographies_dir + offshore_name2
163offshore_dir_name3 = topographies_dir + offshore_name3
164
165# where the combined elevation file sits
166combined_dir_name = topographies_dir + combined_name
167combined_smaller_name_dir = topographies_dir + combined_smaller_name
168
169# where the mesh sits (this is created during the run_perth.py)
170meshes_dir_name = meshes_dir + scenario_name+'_rottnest.msh'
171
172# where the boundary ordering files sit (this is used within build_boundary.py)
173order_filename_dir = boundaries_dir + order_filename
174
175# where the landward points of boundary extent sit (this is used within run_perth.py)
176landward_dir = boundaries_dir + landward
177
178# where the event sts files sits (this is created during the build_boundary.py)
179boundaries_dir_event = boundaries_dir + str(event_number) + sep
180boundaries_dir_mux = muxhome
181
182# where the directory of the output filename sits
183output_build_time_dir = output_dir+build_time+dir_comment+sep   #used for build_perth.py
184output_run_time_dir = output_dir+run_time+dir_comment+sep       #used for run_perth.py
185output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
186
187#w here the directory of the gauges sit
188gauges_dir_name = gauges_dir + gauge_name      #used for get_timeseries.py
189building_in_dir_name = gauges_dir + building + '.csv'    #used for run_building_inundation.py
190
191#------------------------------------------------------------------------------
192# Interior region definitions
193#------------------------------------------------------------------------------
194
195#Land, to set the initial stage/water to be offcoast only
196poly_mainland_N = read_polygon(polygons_dir+'initial_conditions_N.csv')
197
198#Land, to set the initial stage/water to be offcoast only
199poly_mainland_S = read_polygon(polygons_dir+'initial_conditions_S.csv')
200
201#Island, to set the initial stage/water to be offcoast only
202poly_island1 = read_polygon(polygons_dir+'initial_conditions_rottnest.csv')
203
204#Island, to set the initial stage/water to be offcoast only
205poly_island2 = read_polygon(polygons_dir+'initial_conditions_garden.csv')
206
207# Initial bounding polygon for data clipping
208poly_all = read_polygon(polygons_dir+'poly_all.csv')
209res_poly_all = 100000*res_factor
210
211### Area of Interest 1 (Fremantle, increase to reach Perth)
212##poly_aoi1 = read_polygon(polygons_dir+'CBD_increase.csv')
213##res_aoi1 = 500*res_factor
214
215### Area of Interest 1 (Fremantle)
216##poly_aoi1 = read_polygon(polygons_dir+'CBD_coastal.csv')
217##res_aoi1 = 500*res_factor
218##
219### Area of Interest 2 (Rockingham)
220##poly_aoi2 = read_polygon(polygons_dir+'rockingham_penguin_increase.csv')
221##res_aoi2 = 500*res_factor
222##
223### Area of Interest 2 (Rockingham)
224##poly_aoi2 = read_polygon(polygons_dir+'rockingham_penguin.csv')
225##res_aoi2 = 500*res_factor
226##
227### Area of Interest 2 (garden Island)
228##poly_aoi2a = read_polygon(polygons_dir+'garden.csv')
229##res_aoi2a= 500*res_factor
230##
231### Area of Interest 3 (geordie bay - record of tsunami impact)
232##poly_aoi3 = read_polygon(polygons_dir+'geordie_bay.csv')
233##res_aoi3 = 500*res_factor
234##
235### Area of Interest 4 (sorrento - record of tsunami impact)
236##poly_aoi4 = read_polygon(polygons_dir+'sorrento_gauge.csv')
237##res_aoi4 = 500*res_factor
238##
239### Area of Significance 1 (Garden Island and sand bank infront of Rockingham)
240##poly_aos1 = read_polygon(polygons_dir+'garden_rockingham_increase.csv')
241##res_aos1 = 1000*res_factor
242
243# Area of Significance 2 (incorporate coastline of rottnest)
244poly_aos2 = read_polygon(polygons_dir+'rottnest_external.csv')
245res_aos2 = 500*res_factor
246
247### Refined areas
248### Polygon designed to incorporate dredged area from Fremantle to
249### Rockingham as the steep incline was making the elevation go to 0
250##poly_aos3 = read_polygon(polygons_dir+'DredgeArea.csv')
251##res_aos3 = 1000*res_factor
252##
253### Shallow water 1
254##poly_sw1 = read_polygon(polygons_dir+'internal_h20mORd3km.csv')
255##res_sw1 = 25000*res_factor
256
257### Shallow water 1
258poly_sw1 = read_polygon(polygons_dir+'rottnest_20m.csv')
259res_sw1 = 1000*res_factor
260
261# Deep water (land of Rottnest, ANUGA does not do donuts!)
262poly_dw1 = read_polygon(polygons_dir+'rottnest_internal.csv')
263res_dw1 = 100000*res_factor
264
265# Combined all regions, must check that all are included!
266##interior_regions = [[poly_aoi2,res_aoi2], [poly_aos1,res_aos1]
267##                     ,[poly_aos2,res_aos2],[poly_aos3,res_aos3]
268##                     ,[poly_sw1,res_sw1], [poly_dw1,res_dw1]]
269
270#For Rottnest zoom in
271interior_regions = [[poly_aos2,res_aos2],[poly_sw1,res_sw1]
272                     ,[poly_dw1,res_dw1]]
273
274##interior_regions = [[poly_aoi1,res_aoi1],[poly_aoi2,res_aoi2]
275##                     ,[poly_aoi2a,res_aoi2a],[poly_aoi3,res_aoi3]
276##                     ,[poly_aoi4,res_aoi4],[poly_aos1,res_aos1]
277##                     ,[poly_aos2,res_aos2],[poly_aos3,res_aos3]
278##                     ,[poly_sw1,res_sw1], [poly_dw1,res_dw1]]
279
280   
281trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
282print 'min estimated number of triangles', trigs_min
283   
284#------------------------------------------------------------------------------
285# Clipping regions for export to asc and regions for clipping data
286# Final inundation maps should only be created in regions of the finest mesh
287#------------------------------------------------------------------------------
288
289#Geordie Bay extract ascii grid
290xminGeordie = 358000
291xmaxGeordie = 362000
292yminGeordie = 6458500
293ymaxGeordie = 6461000
294
295#Sorrento extract ascii grid
296xminSorrento = 379000
297xmaxSorrento = 382500
298yminSorrento = 6477000
299ymaxSorrento = 6480000
300
301#Fremantle extract ascii grid
302xminFremantle = 376000
303xmaxFremantle = 388000
304yminFremantle = 6449000
305ymaxFremantle = 6461000
306
307#Rockingham extract ascii grid
308xminRockingham = 373500
309xmaxRockingham = 385500
310yminRockingham = 6424000
311ymaxRockingham = 6433000
312
313#Fremantle and Perth extract ascii grid
314xminPerth = 376000
315xmaxPerth = 396000
316yminPerth = 6449000
317ymaxPerth = 6467000
318
319#Rottnest
320xminRottnest = 352700
321xmaxRottnest = 364800
322yminRottnest = 6455000
323ymaxRottnest = 6460500
324
325
Note: See TracBrowser for help on using the repository browser.