source: anuga_work/production/wa/perth_2009/project.py @ 7436

Last change on this file since 7436 was 7113, checked in by kristy, 16 years ago
File size: 10.7 KB
Line 
1"""
2This file contains all your file and directory definitions
3for elevation, meshes and outputs.
4"""
5
6import os
7from anuga.utilities.system_tools import get_user_name, get_host_name
8from time import localtime, strftime, gmtime
9from os.path import join, exists
10
11
12#-------------------------------------------------------------------------------
13# Directory setup
14#-------------------------------------------------------------------------------
15
16# this section needs to be updated to reflect the modelled community.
17# Note, the user needs to set up the directory system accordingly
18state = 'western_australia'
19scenario_name = 'perth'
20scenario_folder = 'perth_tsunami_scenario'
21
22#-------------------------------------------------------------------------------
23# Initial Conditions
24#-------------------------------------------------------------------------------
25
26# Model specific parameters.
27# One or all can be changed each time the run_model script is executed
28tide = 0                # difference between MSL and HAT in metres
29zone = 50               # specify zone of model
30event_number = 68693    # the event number or the mux file name
31alpha = 0.1             # smoothing parameter for mesh
32friction=0.01           # manning's friction coefficient
33starttime=0             # start time for simulation
34finaltime=80000         # final time for simulation
35
36setup = 'final'         # This can be one of three values
37                        #    trial - coarsest mesh, fast
38                        #    basic - coarse mesh
39                        #    final - fine mesh, slowest
40
41#-------------------------------------------------------------------------------
42# Output filename
43#
44# Your output filename should be unique between different runs on different data.
45# The list of items below will be used to create a file in your output directory.
46# Your user name and time+date will be automatically added.  For example,
47#     [setup, tide, event_number]
48# will result in a filename like
49#     20090212_091046_run_final_0_27283_rwilson
50#-------------------------------------------------------------------------------
51
52output_comment = [setup, tide, event_number, 'Bt']
53
54#-------------------------------------------------------------------------------
55# Input Data
56#-------------------------------------------------------------------------------
57
58# ELEVATION DATA
59# Used in build_elevation.py
60# Format for ascii grids, as produced in ArcGIS + a projection file
61ascii_grid_filenames = ['perth_dli_ext',   # Topo
62                        'rott_dli_ext',
63                        'gard_dli_ext',
64                        'carnac_island_dli_ext',
65                        'penguin_dli_ext'] 
66
67# Format for point is x,y,elevation (with header)
68point_filenames = ['coastline_perthP.txt',    # Coastline
69                   'Perth.txt',         # Original
70                   'Perth_Chart.txt',   # Bathymetry Charts
71                   'Fremantle_north.txt',       # DPI data
72                   'port_swanriver.txt',]           
73
74### Add csv header list to all files in point_filenames
75##headerlist = ['x', 'y', 'elevation']
76##for f in point_filenames:
77##    add_csv_header(join(topographies_folder, f), headerlist)
78
79# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
80# Used in build_elevation.py
81# Format for points easting,northing (no header)
82bounding_polygon_filename = 'poly_all.csv'
83bounding_polygon_maxarea = 100000
84
85# INTERIOR REGIONS -  for designing the mesh
86# Used in run_model.py
87# Format for points easting,northing (no header)                   
88interior_regions_data = [['CBD_coastal.csv', 500],
89                         ['rockingham_penguin.csv', 500],
90                         ['garden.csv', 500],
91                         ['geordie_bay.csv', 500],
92                         ['sorrento_gauge.csv', 500],
93                         ['garden_rockingham.csv', 1000],
94                         ['rottnest_external.csv', 1000],
95                         ['DredgeArea.csv', 1000],
96                         ['internal_h20mORd3km.csv', 25000],
97                         ['rottnest_internal.csv', 100000]]
98
99# LAND - used to set the initial stage/water to be offcoast only
100# Used in run_model.py.  Format for points easting,northing (no header)
101land_initial_conditions_filename = [['initial_conditions_N.csv', 0],
102                                    ['initial_conditions_S.csv', 0],
103                                    ['initial_conditions_rottnest.csv',0],
104                                    ['initial_conditions_garden.csv',0]]
105
106# GAUGES - for creating timeseries at a specific point
107# Used in get_timeseries.py. 
108# Format easting,northing,name,elevation (with header)
109gauges_filename = 'MH_gauges2.csv'
110
111# BUILDINGS EXPOSURE - for identifying inundated houses
112# Used in run_building_inundation.py
113# Format latitude,longitude etc (geographic)
114building_exposure_filename = 'perth_res_combined.csv' # from NEXIS
115
116# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
117# NOTE: when files are put together the points must be in sequence
118# For ease go clockwise!
119# Check the run_model.py for boundary_tags
120
121# Thinned ordering file from Hazard Map (geographic)
122# Format is index,latitude,longitude (with header)
123urs_order_filename = 'thinned_boundary_ordering.csv'
124
125# Landward bounding points
126# Format easting,northing (no header)
127landward_boundary_filename = 'landward_bounding_polygon.csv'
128
129# MUX input filename.
130# If a meta-file from EventSelection is used, set 'multi-mux' to True.
131# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
132##mux_input_filename = event_number # to be found in event_folder
133                                    # (ie boundaries/event_number/)
134##multi_mux = False
135mux_input_filename = 'event.list'
136multi_mux = True
137
138#-------------------------------------------------------------------------------
139# Clipping regions for export to asc and regions for clipping data
140# Final inundation maps should only be created in regions of the finest mesh
141#-------------------------------------------------------------------------------
142
143#Geordie Bay extract ascii grid
144xminGeordie = 358000
145xmaxGeordie = 362000
146yminGeordie = 6458500
147ymaxGeordie = 6461000
148
149#Sorrento extract ascii grid
150xminSorrento = 379000
151xmaxSorrento = 382500
152yminSorrento = 6477000
153ymaxSorrento = 6480000
154
155#Fremantle extract ascii grid
156xminFremantle = 376000
157xmaxFremantle = 388000
158yminFremantle = 6449000
159ymaxFremantle = 6461000
160
161#Rockingham extract ascii grid
162xminRockingham = 373500
163xmaxRockingham = 385500
164yminRockingham = 6424000
165ymaxRockingham = 6433000
166
167#Fremantle and Perth extract ascii grid
168xminPerth = 376000
169xmaxPerth = 396000
170yminPerth = 6449000
171ymaxPerth = 6467000
172
173#Rottnest
174xminRottnest = 352700
175xmaxRottnest = 364800
176yminRottnest = 6455000
177ymaxRottnest = 6460500
178
179
180
181
182################################################################################
183################################################################################
184####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
185################################################################################
186################################################################################
187
188# Get system user and host names.
189# These values can be used to distinguish between two similar runs by two
190# different users or runs by the same user on two different machines.
191user = get_user_name()
192host = get_host_name()
193
194# Environment variable names.
195# The inundation directory, not the data directory.
196ENV_INUNDATIONHOME = 'INUNDATIONHOME'
197
198# Path to MUX data
199ENV_MUXHOME = 'MUXHOME'
200
201#-------------------------------------------------------------------------------
202# Output Elevation Data
203#-------------------------------------------------------------------------------
204
205# Output filename for elevation
206# this is a combination of all the data generated in build_elevation.py
207combined_elevation_basename = scenario_name + '_combined_elevation'
208
209#-------------------------------------------------------------------------------
210# Directory Structure
211#-------------------------------------------------------------------------------
212
213# determines time for setting up output directories
214time = strftime('%Y%m%d_%H%M%S', localtime()) 
215gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
216build_time = time + '_build'
217run_time = time + '_run_'
218
219# create paths generated from environment variables.
220home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
221muxhome = os.getenv(ENV_MUXHOME)
222   
223# check various directories/files that must exist
224anuga_folder = join(home, state, scenario_folder, 'anuga')
225topographies_folder = join(anuga_folder, 'topographies')
226polygons_folder = join(anuga_folder, 'polygons')
227boundaries_folder = join(anuga_folder, 'boundaries')
228output_folder = join(anuga_folder, 'outputs')
229gauges_folder = join(anuga_folder, 'gauges')
230event_folder = join(boundaries_folder, str(event_number))
231
232# MUX data files
233# Directory containing the MUX data files to be used with EventSelection.
234mux_data_folder = join(muxhome, 'mux')
235
236#-------------------------------------------------------------------------------
237# Location of input and output data
238#-------------------------------------------------------------------------------
239
240# Convert the user output_comment to a string for run_model.py
241output_comment = ('_'.join([str(x) for x in output_comment if x != user])
242                  + '_' + user)
243
244# The absolute pathname of the all elevation, generated in build_elevation.py
245combined_elevation = join(topographies_folder, combined_elevation_basename)
246
247
248# The pathname for the urs order points, used within build_urs_boundary.py
249if urs_order_filename:
250    urs_order = join(boundaries_folder, urs_order_filename)
251
252# The absolute pathname for the landward points of the bounding polygon,
253# Used within run_model.py)
254if landward_boundary_filename:
255    landward_boundary = join(boundaries_folder, landward_boundary_filename)
256
257# The absolute pathname for the .sts file, generated in build_boundary.py
258event_sts = join(event_folder, scenario_name)
259
260# The absolute pathname for the output folder names
261# Used for build_elevation.py
262output_build = join(output_folder, build_time) + '_' + str(user) 
263# Used for run_model.py
264output_run = join(output_folder, run_time) + output_comment
265# Used by post processing
266output_run_time = join(output_run, scenario_name) 
267
268# The absolute pathname of the mesh, generated in run_model.py
269meshes = join(output_run, scenario_name) + '.msh'
270
271# The absolute pathname for the gauges file
272# Used for get_timeseries.py
273if gauges_filename:
274    gauges = join(gauges_folder, gauges_filename)       
275
276# The absolute pathname for the building file
277# Used for run_building_inundation.py
278if building_exposure_filename:
279    building_exposure = join(gauges_folder, building_exposure_filename)
280
281# full path to where MUX files (or meta-files) live
282mux_input = join(event_folder, mux_input_filename)
283
Note: See TracBrowser for help on using the repository browser.