source: anuga_work/production/exmouth_2008/project.py @ 6498

Last change on this file since 6498 was 5809, checked in by rmleczko, 16 years ago

new Exmouth files added 2nd Oct 2008

File size: 9.3 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 = 'exmouth'
41scenario = 'exmouth_tsunami_scenario_2008'
42
43# Model specific parameters. One or all can be changed each time the
44# run_scenario script is executed
45tide = 0                #0.6
46#event_number = 27255   # linked to hazard map
47event_number = 27283
48alpha = 0.1             # smoothing parameter for mesh
49friction=0.01           # manning's friction coefficient
50starttime=0             
51finaltime=80000         # final time for simulation
52
53setup='final'  # Final can be replaced with trial or basic.
54               # Either will result in a coarser mesh that will allow a
55               # faster, but less accurate, simulation.
56
57if setup =='trial':
58    print'trial'
59    res_factor=10
60    time_thinning=48
61    yieldstep=240
62if setup =='basic': 
63    print'basic'
64    res_factor=4
65    time_thinning=12
66    yieldstep=120
67if setup =='final': 
68    print'final'
69    res_factor=1
70    time_thinning=4
71    yieldstep=60
72
73#------------------------------------------------------------------------------
74# Output Filename
75#------------------------------------------------------------------------------
76# Important to distinguish each run - ensure str(user) is included!
77# Note, the user is free to include as many parameters as desired
78dir_comment='_'+setup+'_'+str(tide)+'_'+str(event_number)+'_'+ 'alpha' +str(alpha)+'_'+str(user)
79
80#------------------------------------------------------------------------------
81# Input Data
82#------------------------------------------------------------------------------
83
84# elevation data used in build_perth.py
85# onshore data: format ascii grid with accompanying projection file
86onshore_name = 'extract_dli'
87onshore_name1 = 'extract_dted'
88# island: format ascii grid with accompanying projection file
89
90# coastline: format x,y,elevation (with title)
91coast_name = 'coastline.txt'
92# bathymetry: format x,y,elevation (with title)
93offshore_name = 'Exmouth.txt'
94
95# gauges - used in get_timeseries.py
96#gauge_name = 'exmouth.csv'
97#gauge_name2 = 'thinned_MGA50.csv'
98
99# BOUNDING POLYGON - used in build_boundary.py and run_perth.py respectively
100# NOTE: when files are put together the points must be in sequence - for ease go clockwise!
101# Check the run_perth.py for boundary_tags
102# thinned ordering file from Hazard Map: format is index,latitude,longitude (with title)
103order_filename = 'thinned_boundary_ordering.csv'
104#landward bounding points
105landward = 'landward_bounding_polygon.csv'
106
107#------------------------------------------------------------------------------
108# Output Elevation Data
109#------------------------------------------------------------------------------
110# Output filename for elevation
111# this is a combination of all the data (utilisied in build_boundary)
112combined_name ='exmouth_combined_elevation'
113combined_smaller_name = 'exmouth_combined_elevation_smaller'
114
115#------------------------------------------------------------------------------
116# Directory Structure
117#------------------------------------------------------------------------------
118anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
119topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
120topographies_dir = anuga_dir+'topographies'+sep
121polygons_dir = anuga_dir+'polygons'+sep
122tide_dir = anuga_dir+'tide_data'+sep
123boundaries_dir = anuga_dir+'boundaries'+ sep
124output_dir = anuga_dir+'outputs'+sep
125gauges_dir = anuga_dir+'gauges'+sep
126meshes_dir = anuga_dir+'meshes'+sep
127
128#------------------------------------------------------------------------------
129# Location of input and output data
130#------------------------------------------------------------------------------
131# where the input data sits
132onshore_in_dir_name = topographies_in_dir + onshore_name
133onshore_in_dir_name1 = topographies_in_dir + onshore_name1
134coast_in_dir_name = topographies_in_dir + coast_name
135offshore_in_dir_name = topographies_in_dir + offshore_name
136
137# where the output data sits
138onshore_dir_name = topographies_dir + onshore_name
139onshore_dir_name1 = topographies_dir + onshore_name1
140coast_dir_name = topographies_dir + coast_name
141offshore_dir_name = topographies_dir + offshore_name
142
143# where the combined elevation file sits
144combined_dir_name = topographies_dir + combined_name
145combined_smaller_name_dir = topographies_dir + combined_smaller_name
146
147# where the mesh sits (this is created during the run_perth.py)
148meshes_dir_name = meshes_dir + scenario_name+'.msh'
149
150# where the boundary ordering files sit (this is used within build_boundary.py)
151order_filename_dir = boundaries_dir + order_filename
152
153# where the landward points of boundary extent sit (this is used within run_perth.py)
154landward_dir = boundaries_dir + landward
155
156# where the event sts files sits (this is created during the build_boundary.py)
157boundaries_dir_event = boundaries_dir + str(event_number) + sep
158boundaries_dir_mux = muxhome
159
160# where the directory of the output filename sits
161output_build_time_dir = output_dir+build_time+dir_comment+sep   #used for build_perth.py
162output_run_time_dir = output_dir+run_time+dir_comment+sep       #used for run_perth.py
163output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
164
165#w here the directory of the gauges sit
166#gauges_dir_name = gauges_dir + gauge_name       #used for get_timeseries.py
167#gauges_dir_name2 = gauges_dir + gauge_name2     #used for get_timeseries.py
168
169#------------------------------------------------------------------------------
170# Interior region definitions
171#------------------------------------------------------------------------------
172
173#Land, to set the initial stage/water to be offcoast only
174poly_mainland = read_polygon(polygons_dir+'initial_conditions_mainland.csv')
175
176# Initial bounding polygon for data clipping
177poly_all = read_polygon(polygons_dir+'poly_all.csv')
178res_poly_all = 100000*res_factor
179
180# Area of Interest 1 (Fremantle)
181poly_aoi1 = read_polygon(polygons_dir+'area_of_interest_points.csv')
182res_aoi1 = 500*res_factor
183
184# Area of Interest 2 (Rockingham)
185#poly_aoi2 = read_polygon(polygons_dir+'rockingham_penguin.csv')
186#res_aoi2 = 500*res_factor
187
188
189# Area of Significance 1 (Garden Island and sand bank infront of Rockingham)
190poly_aos1 = read_polygon(polygons_dir+'area_of_sig_points.csv')
191res_aos1 = 1000*res_factor
192
193
194# Refined areas
195# Polygon designed to incorporate dredged area from Fremantle to
196# Rockingham as the steep incline was making the elevation go to 0
197#poly_aos3 = read_polygon(polygons_dir+'DredgeArea.csv')
198#res_aos3 = 1000*res_factor
199
200# Shallow water 1
201poly_sw1 = read_polygon(polygons_dir+'shallow_water_points.csv')
202res_sw1 = 25000*res_factor
203
204# Deep water (land of Rottnest, ANUGA does not do donuts!)
205#poly_dw1 = read_polygon(polygons_dir+'rottnest_internal.csv')
206#res_dw1 = 100000*res_factor
207
208# Combined all regions, must check that all are included!
209interior_regions = [[poly_aoi1,res_aoi1],[poly_aos1,res_aos1],[poly_sw1,res_sw1]]
210
211trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
212print 'min estimated number of triangles', trigs_min
213   
214#------------------------------------------------------------------------------
215# Clipping regions for export to asc and regions for clipping data
216# Final inundation maps should only be created in regions of the finest mesh
217#------------------------------------------------------------------------------
218
219#Geordie Bay extract ascii grid
220#xminGeordie = 358000
221#xmaxGeordie = 362000
222#yminGeordie = 6458500
223#ymaxGeordie = 6461000
224
225#Sorrento extract ascii grid
226#xminSorrento = 379000
227#xmaxSorrento = 382500
228#yminSorrento = 6477000
229#ymaxSorrento = 6480000
230
231#Fremantle extract ascii grid
232#xminFremantle = 376000
233#xmaxFremantle = 388000
234#yminFremantle = 6449000
235#ymaxFremantle = 6461000
236
237#Rockingham extract ascii grid
238#xminRockingham = 373500
239#xmaxRockingham = 385500
240#yminRockingham = 6424000
241#ymaxRockingham = 6433000
242
Note: See TracBrowser for help on using the repository browser.