source: anuga_work/production/gold_coast_2009/project.py @ 7837

Last change on this file since 7837 was 7364, checked in by Leharne, 16 years ago
File size: 9.9 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 = 'queensland'
19scenario_name = 'gold_coast'
20scenario_folder = 'gold_coast_tsunami_scenario_2009'
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
28
29               # difference between MSL and HAT in metres
30central_meridian = None # Central meridian for projection (optional)
31zone = 56
32import sys
33if len(sys.argv) > 1:
34    event_number = int(sys.argv[1])
35else:   
36    event_number = 51253    # the event number or the mux file name
37
38event_number_list = [51469, 51392, 50863] # To piggy back multiple events
39
40# Event Details:
41# Event 1 (51469)
42# Source Zone = New Hebrides
43# Return Period = 10 000 years
44# Wave height at 100 m = 2.3 m
45#
46# Event 2 (51392)
47# Source Zone = New Hebrides
48# Return Period = 5000 years
49# Wave height at 100 m = 1.7 m
50#
51# Event 3 (50863)
52# Source Zone = New Hebrides
53# Return Period = 200 years
54# Wave height at 100 m = 0.3 m
55
56tide = 0                # Mean Sea Level = 0,
57                        # Highest Astronomical Tide = 1.1 m for Gold Coast                       
58alpha = 0.1             # smoothing parameter for mesh
59friction = 0.01           # manning's friction coefficient
60starttime = 0             # start time for simulation
61finaltime = 80000         # final time for simulation
62
63setup = 'final'         # This can be one of three values
64                        #    trial - coarsest mesh, fast
65                        #    basic - coarse mesh
66                        #    final - fine mesh, slowest
67
68#-------------------------------------------------------------------------------
69# Output filename
70#
71# Your output filename should be unique between different runs on different data.
72# The list of items below will be used to create a file in your output directory.
73# Your user name and time+date will be automatically added.  For example,
74#     [setup, tide, event_number]
75# will result in a filename like
76#     20090212_091046_run_final_0_27283_rwilson
77#-------------------------------------------------------------------------------
78
79output_comment = [setup, tide, event_number]
80
81#-------------------------------------------------------------------------------
82# Input Datayieldstep
83#-------------------------------------------------------------------------------
84
85# ELEVATION DATA
86# Used in build_elevation.py
87# Format for ascii grids, as produced in ArcGIS + a projection file
88ascii_grid_filenames = []
89
90# Format for point is x,y,elevation (with header)
91point_filenames = []
92
93# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
94# Used in build_elevation.py
95# Format for points easting,northing (no header)
96bounding_polygon_filename = 'bounding_polygon.csv'
97bounding_polygon_maxarea = 125000
98
99# INTERIOR REGIONS -  for designing the mesh
100# Used in run_model.py
101# Format for points easting,northing (no header)                   
102interior_regions_data = [['area_of_interest.csv', 500],
103                         ['intermediate.csv', 25000]]
104
105# LAND - used to set the initial stage/water to be offcoast only
106# Used in run_model.py.  Format for points easting,northing (no header)
107land_initial_conditions_filename = [['initial_conditions.csv', 0]]
108
109# GAUGES - for creating timeseries at a specific point
110# Used in get_timeseries.py. 
111# Format easting,northing,name,elevation (with header)
112gauges_filename = 'gauges.csv'
113
114# BUILDINGS EXPOSURE - for identifying inundated houses
115# Used in run_building_inundation.py
116# Format latitude,longitude etc (geographic)
117building_exposure_filename = '' # from NEXIS
118
119# AREA OF IMAGES - Extent of each image to find out highest runup
120# Headerr: easting, northing, id, value
121# Used in get_runup.py
122images_filename = 'images.csv'
123
124# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
125# NOTE: when files are put together the points must be in sequence
126# For ease go clockwise!
127# Check the run_model.py for boundary_tags
128
129
130# Thinned ordering file from Hazard Map (geographic)
131# Format is index,latitude,longitude (with header)
132urs_order_filename = 'urs_order.csv'
133
134# Landward bounding points
135# Format easting,northing (no header)
136landward_boundary_filename = 'landward_boundary.csv'
137
138# MUX input filename.
139# If a meta-file from EventSelection is used, set 'multi-mux' to True.
140# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
141##mux_input_filename = event_number # to be found in event_folder
142                                    # (ie boundaries/event_number/)
143##multi_mux = False
144mux_input_filename = 'event.list'
145multi_mux = True
146
147#-------------------------------------------------------------------------------
148# Clipping regions for export to asc and regions for clipping data
149# Final inundation maps should only be created in regions of the finest mesh
150#-------------------------------------------------------------------------------
151
152
153
154
155################################################################################
156################################################################################
157####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
158################################################################################
159################################################################################
160
161# Get system user and host names.
162# These values can be used to distinguish between two similar runs by two
163# different users or runs by the same user on two different machines.
164user = get_user_name()
165host = get_host_name()
166
167# Environment variable names.
168# The inundation directory, not the data directory.
169ENV_INUNDATIONHOME = 'INUNDATIONHOME'
170
171# Path to MUX data
172ENV_MUXHOME = 'MUXHOME'
173
174#-------------------------------------------------------------------------------
175# Output Elevation Data
176#-------------------------------------------------------------------------------
177
178# Output filename for elevation
179# this is a combination of all the data generated in build_elevation.py
180combined_elevation_basename = scenario_name + '_combined_elevation'
181
182#-------------------------------------------------------------------------------
183# Directory Structure
184#-------------------------------------------------------------------------------
185
186# determines time for setting up output directories
187time = strftime('%Y%m%d_%H%M%S', localtime()) 
188gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
189build_time = time + '_build'
190run_time = time + '_run_'
191
192# create paths generated from environment variables.
193home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
194muxhome = os.getenv(ENV_MUXHOME)
195   
196# check various directories/files that must exist
197anuga_folder = join(home, state, scenario_folder, 'anuga')
198topographies_folder = join(anuga_folder, 'topographies')
199polygons_folder = join(anuga_folder, 'polygons')
200boundaries_folder = join(anuga_folder, 'boundaries')
201output_folder = join(anuga_folder, 'outputs')
202gauges_folder = join(anuga_folder, 'gauges')
203event_folder = join(boundaries_folder, str(event_number))
204
205# MUX data files
206# Directory containing the MUX data files to be used with EventSelection.
207mux_data_folder = join(muxhome, 'mux')
208
209#-------------------------------------------------------------------------------
210# Location of input and output data
211#-------------------------------------------------------------------------------
212
213# Convert the user output_comment to a string for run_model.py
214output_comment = ('_'.join([str(x) for x in output_comment if x != user])
215                  + '_' + user)
216
217# The absolute pathname of the all elevation, generated in build_elevation.py
218combined_elevation = join(topographies_folder, combined_elevation_basename)
219
220
221# The pathname for the urs order points, used within build_urs_boundary.py
222if urs_order_filename:
223    urs_order = join(boundaries_folder, urs_order_filename)
224
225# The absolute pathname for the landward points of the bounding polygon,
226# Used within run_model.py)
227if landward_boundary_filename:
228    landward_boundary = join(boundaries_folder, landward_boundary_filename)
229
230# The absolute pathname for the .sts file, generated in build_boundary.py
231event_sts = join(event_folder, scenario_name)
232
233# The absolute pathname for the output folder names
234# Used for build_elevation.py
235output_build = join(output_folder, build_time) + '_' + str(user) 
236# Used for run_model.py
237output_run = join(output_folder, run_time) + output_comment
238# Used by post processing
239output_run_time = join(output_run, scenario_name) 
240
241# The absolute pathname of the mesh, generated in run_model.py
242meshes = join(output_run, scenario_name) + '.msh'
243
244# The absolute pathname for the gauges file
245# Used for get_timeseries.py
246if gauges_filename:
247    gauges = join(gauges_folder, gauges_filename)       
248
249# The absolute pathname for the building file
250# Used for run_building_inundation.py
251if building_exposure_filename:
252    building_exposure = join(gauges_folder, building_exposure_filename)
253
254# The absolute pathname for the image file
255# Used for get_runup.py
256if images_filename:
257    images = join(polygons_folder, images_filename)
258
259# full path to where MUX files (or meta-files) live
260mux_input = join(event_folder, mux_input_filename)
261
262
Note: See TracBrowser for help on using the repository browser.