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

Last change on this file since 6558 was 6558, checked in by Leharne, 15 years ago

Gold Coast tsunami scenario 2009

File size: 9.1 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
28tide = 0                # difference between MSL and HAT in metres
29zone = 56               # specify zone of model
30event_number = 51469    # 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 = 'trial'         # 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 = ['GC_DTM_30m',   # Supplied DTM
62                        'grid250m'] # Supplemented data from 2005 250m grid
63
64# Format for point is x,y,elevation (with header)
65point_filenames = []
66
67### Add csv header list to all files in point_filenames
68##headerlist = ['x', 'y', 'elevation']
69##for f in point_filenames:
70##    add_csv_header(join(topographies_folder, f), headerlist)
71
72# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
73# Used in build_elevation.py
74# Format for points easting,northing (no header)
75bounding_polygon_filename = 'bounding_polygon.csv'
76bounding_polygon_maxarea = 100000
77
78# INTERIOR REGIONS -  for designing the mesh
79# Used in run_model.py
80# Format for points easting,northing (no header)                   
81interior_regions_data = [['buffer_3km_simplify.csv', 500]]
82
83# LAND - used to set the initial stage/water to be offcoast only
84# Used in run_model.py.  Format for points easting,northing (no header)
85land_initial_conditions_filename = [['initial_conditions.csv', 0]]
86
87# GAUGES - for creating timeseries at a specific point
88# Used in get_timeseries.py. 
89# Format easting,northing,name,elevation (with header)
90gauges_filename = 'gauges.csv'
91
92# BUILDINGS EXPOSURE - for identifying inundated houses
93# Used in run_building_inundation.py
94# Format latitude,longitude etc (geographic)
95building_exposure_filename = 'gold_coast_res_clip.csv' # from NEXIS
96
97# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
98# NOTE: when files are put together the points must be in sequence
99# For ease go clockwise!
100# Check the run_model.py for boundary_tags
101
102# Thinned ordering file from Hazard Map (geographic)
103# Format is index,latitude,longitude (with header)
104urs_order_filename = 'urs_order.csv'
105
106# Landward bounding points
107# Format easting,northing (no header)
108landward_boundary_filename = 'landward_boundary.csv'
109
110# MUX input filename.
111# If a meta-file from EventSelection is used, set 'multi-mux' to True.
112# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
113##mux_input_filename = event_number # to be found in event_folder
114                                    # (ie boundaries/event_number/)
115##multi_mux = False
116mux_input_filename = 'event.list'
117multi_mux = True
118
119#-------------------------------------------------------------------------------
120# Clipping regions for export to asc and regions for clipping data
121# Final inundation maps should only be created in regions of the finest mesh
122#-------------------------------------------------------------------------------
123
124# ASCII export grid for Gold Coast
125xminGold_Coast = 340000
126xmaxGold_Coast = 352000
127yminGold_Coast = 6271500
128ymaxGold_Coast = 6280000
129
130################################################################################
131################################################################################
132####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
133################################################################################
134################################################################################
135
136# Get system user and host names.
137# These values can be used to distinguish between two similar runs by two
138# different users or runs by the same user on two different machines.
139user = get_user_name()
140host = get_host_name()
141
142# Environment variable names.
143# The inundation directory, not the data directory.
144ENV_INUNDATIONHOME = 'INUNDATIONHOME'
145
146# Path to MUX data
147ENV_MUXHOME = 'MUXHOME'
148
149#-------------------------------------------------------------------------------
150# Output Elevation Data
151#-------------------------------------------------------------------------------
152
153# Output filename for elevation
154# this is a combination of all the data generated in build_elevation.py
155combined_elevation_basename = scenario_name + '_combined_elevation'
156
157#-------------------------------------------------------------------------------
158# Directory Structure
159#-------------------------------------------------------------------------------
160
161# determines time for setting up output directories
162time = strftime('%Y%m%d_%H%M%S', localtime()) 
163gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
164build_time = time + '_build'
165run_time = time + '_run_'
166
167# create paths generated from environment variables.
168home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
169muxhome = os.getenv(ENV_MUXHOME)
170   
171# check various directories/files that must exist
172anuga_folder = join(home, state, scenario_folder, 'anuga')
173topographies_folder = join(anuga_folder, 'topographies')
174polygons_folder = join(anuga_folder, 'polygons')
175boundaries_folder = join(anuga_folder, 'boundaries')
176output_folder = join(anuga_folder, 'outputs')
177gauges_folder = join(anuga_folder, 'gauges')
178event_folder = join(boundaries_folder, str(event_number))
179
180# MUX data files
181# Directory containing the MUX data files to be used with EventSelection.
182mux_data_folder = join(muxhome, 'mux')
183
184#-------------------------------------------------------------------------------
185# Location of input and output data
186#-------------------------------------------------------------------------------
187
188# Convert the user output_comment to a string for run_model.py
189output_comment = ('_'.join([str(x) for x in output_comment if x != user])
190                  + '_' + user)
191
192# The absolute pathname of the all elevation, generated in build_elevation.py
193combined_elevation = join(topographies_folder, combined_elevation_basename)
194
195
196# The pathname for the urs order points, used within build_urs_boundary.py
197if urs_order_filename:
198    urs_order = join(boundaries_folder, urs_order_filename)
199
200# The absolute pathname for the landward points of the bounding polygon,
201# Used within run_model.py)
202if landward_boundary_filename:
203    landward_boundary = join(boundaries_folder, landward_boundary_filename)
204
205# The absolute pathname for the .sts file, generated in build_boundary.py
206event_sts = join(event_folder, scenario_name)
207
208# The absolute pathname for the output folder names
209# Used for build_elevation.py
210output_build = join(output_folder, build_time) + '_' + str(user) 
211# Used for run_model.py
212output_run = join(output_folder, run_time) + output_comment
213# Used by post processing
214output_run_time = join(output_run, scenario_name) 
215
216# The absolute pathname of the mesh, generated in run_model.py
217meshes = join(output_run, scenario_name) + '.msh'
218
219# The absolute pathname for the gauges file
220# Used for get_timeseries.py
221if gauges_filename:
222    gauges = join(gauges_folder, gauges_filename)       
223
224# The absolute pathname for the building file
225# Used for run_building_inundation.py
226if building_exposure_filename:
227    building_exposure = join(gauges_folder, building_exposure_filename)
228
229# full path to where MUX files (or meta-files) live
230mux_input = join(event_folder, mux_input_filename)
231
Note: See TracBrowser for help on using the repository browser.