source: anuga_work/production/exmouth_2009/project.py @ 7209

Last change on this file since 7209 was 7209, checked in by myall, 15 years ago
File size: 10.0 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# Directory setup
13#-------------------------------------------------------------------------------
14
15# this section needs to be updated to reflect the modelled community.
16# Note, the user needs to set up the directory system accordingly
17state = 'western_australia'
18scenario_name = 'exmouth'
19scenario_folder = 'exmouth_tsunami_scenario_2009'
20
21#-------------------------------------------------------------------------------
22# Initial Conditions
23#-------------------------------------------------------------------------------
24
25# Model specific parameters.
26# One or all can be changed each time the run_model script is executed
27tide = 0.0              # 3.6 difference between MSL and HAT in metres
28zone = 50               # specify UTM zone of model
29central_meridian = None 
30event_number = 27283    # 27255,27283 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=1000         # 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]
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 = ['extract_dli',
62                        'extract_dted']
63
64# Format for point is x,y,elevation (with header)
65point_filenames = ['coastline.txt',
66                   'Exmouth.txt',]
67
68### Add csv header list to all files in point_filenames
69##headerlist = ['x', 'y', 'elevation']
70##for f in point_filenames:
71##    add_csv_header(join(topographies_folder, f), headerlist)
72
73# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
74# Used in build_elevation.py
75# Format for points easting,northing (no header)
76bounding_polygon_filename = 'poly_all.csv'
77bounding_polygon_maxarea = 100000
78
79# INTERIOR REGIONS -  for designing the mesh
80# Used in run_model.py
81# Format for points easting,northing (no header)                   
82interior_regions_data = [['sw_MH.csv', 3000],
83                         ['aos_MH.csv', 800],
84                         ['aoi_MH.csv', 500],
85                         ['island1_MH.csv', 3000],
86                         ['island2_MH.csv', 3000],
87                         ['island3_MH.csv', 3000],
88                         ['island4_MH.csv', 3000],
89                         ['island5_MH.csv', 3000],
90                         ['island6_MH.csv', 3000]]
91
92PriorityArea_filename = None
93   
94# LAND - used to set the initial stage/water to be offcoast only
95# Used in run_model.py.  Format for points easting,northing,id,value
96land_initial_conditions_filename = 'initial_conditions_comb.csv'
97
98# GAUGES - for creating timeseries at a specific point
99# Used in get_timeseries.py. 
100# Format easting,northing,name,elevation (with header)
101gauges_filename = ''
102# BUILDINGS EXPOSURE - for identifying inundated houses
103# Used in run_building_inundation.py
104# Format latitude,longitude etc (geographic)
105building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
106
107# AREA OF IMAGES - Extent of each image to find out highest runup
108# Header - easting,northing,id,value
109# Used in get_runup.py
110images_filename = ''
111
112# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
113# NOTE: when files are put together the points must be in sequence
114# For ease go clockwise!
115# Check the run_model.py for boundary_tags
116
117# Thinned ordering file from Hazard Map (geographic)
118# Format is index,latitude,longitude (with header)
119urs_order_filename = 'thinned_boundary_ordering.csv'
120
121# Landward bounding points
122# Format easting,northing (no header)
123landward_boundary_filename = 'landward_bounding_polygon.csv'
124
125# MUX input filename.
126# If a meta-file from EventSelection is used, set 'multi-mux' to True.
127# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
128##mux_input_filename = event_number # to be found in event_folder
129                                    # (ie boundaries/event_number/)
130##multi_mux = False
131mux_input_filename = 'event.list'
132multi_mux = True
133
134#-------------------------------------------------------------------------------
135# Clipping regions for export to asc and regions for clipping data
136# Final inundation maps should only be created in regions of the finest mesh
137#-------------------------------------------------------------------------------
138
139# ASCII export grid for Bruny
140##xminBruny = 523900
141##xmaxBruny = 533200
142##yminBruny = 5204300
143##ymaxBruny = 5213100
144
145
146################################################################################
147################################################################################
148####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
149################################################################################
150################################################################################
151
152# Get system user and host names.
153# These values can be used to distinguish between two similar runs by two
154# different users or runs by the same user on two different machines.
155user = get_user_name()
156host = get_host_name()
157
158# Environment variable names.
159# The inundation directory, not the data directory.
160ENV_INUNDATIONHOME = 'INUNDATIONHOME'
161
162# Path to MUX data
163ENV_MUXHOME = 'MUXHOME'
164
165#-------------------------------------------------------------------------------
166# Output Elevation Data
167#-------------------------------------------------------------------------------
168
169# Output filename for elevation
170# this is a combination of all the data generated in build_elevation.py
171combined_elevation_basename = scenario_name + '_combined_elevation'
172
173#-------------------------------------------------------------------------------
174# Directory Structure
175#-------------------------------------------------------------------------------
176
177# determines time for setting up output directories
178time = strftime('%Y%m%d_%H%M%S', localtime()) 
179gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
180build_time = time + '_build'
181run_time = time + '_run_'
182
183# create paths generated from environment variables.
184home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
185muxhome = os.getenv(ENV_MUXHOME)
186   
187# check various directories/files that must exist
188anuga_folder = join(home, state, scenario_folder, 'anuga')
189topographies_folder = join(anuga_folder, 'topographies')
190polygons_folder = join(anuga_folder, 'polygons')
191boundaries_folder = join(anuga_folder, 'boundaries')
192output_folder = join(anuga_folder, 'outputs')
193gauges_folder = join(anuga_folder, 'gauges')
194event_folder = join(boundaries_folder, str(event_number))
195
196# MUX data files
197# Directory containing the MUX data files to be used with EventSelection.
198mux_data_folder = join(muxhome, 'mux')
199
200#-------------------------------------------------------------------------------
201# Location of input and output data
202#-------------------------------------------------------------------------------
203
204# Convert the user output_comment to a string for run_model.py
205output_comment = ('_'.join([str(x) for x in output_comment if x != user])
206                  + '_' + user)
207
208# The absolute pathname of the all elevation, generated in build_elevation.py
209combined_elevation = join(topographies_folder, combined_elevation_basename)
210
211# The pathname for the urs order points, used within build_urs_boundary.py
212if urs_order_filename:
213    urs_order = join(boundaries_folder, urs_order_filename)
214
215# The absolute pathname for the landward points of the bounding polygon,
216# Used within run_model.py)
217if landward_boundary_filename:
218    landward_boundary = join(boundaries_folder, landward_boundary_filename)
219
220# The absolute pathname for the .sts file, generated in build_boundary.py
221event_sts = join(event_folder, scenario_name)
222
223# The absolute pathname for the output folder names
224# Used for build_elevation.py
225output_build = join(output_folder, build_time) + '_' + str(user) 
226# Used for run_model.py
227output_run = join(output_folder, run_time) + output_comment
228# Used by post processing
229output_run_time = join(output_run, scenario_name) 
230
231# The absolute pathname of the mesh, generated in run_model.py
232meshes = join(output_run, scenario_name) + '.msh'
233
234# The absolute pathname for the gauges file
235# Used for get_timeseries.py
236if gauges_filename:
237    gauges = join(gauges_folder, gauges_filename)       
238
239# The absolute pathname for the building file
240# Used for run_building_inundation.py
241if building_exposure_filename:
242    building_exposure = join(gauges_folder, building_exposure_filename)
243
244# The absolute pathname for the image file
245# Used for get_runup.py
246if images_filename:
247    images = join(polygons_folder, images_filename)
248
249
250# full path to where MUX files (or meta-files) live
251mux_input = join(event_folder, mux_input_filename)
252
253#Multiple polygons in one CSV file to make internal polygons
254if not PriorityArea_filename == None:
255    PriorityAreas = join(polygons_folder, PriorityArea_filename)
256
257
Note: See TracBrowser for help on using the repository browser.