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

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