source: DVD_images/extra_files/GoldCoast/project/project.py @ 7343

Last change on this file since 7343 was 7300, checked in by rwilson, 16 years ago
  • Property svn:executable set to *
File size: 9.6 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 = 51469    # 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 = 'ANUGADATA'
170
171#-------------------------------------------------------------------------------
172# Output Elevation Data
173#-------------------------------------------------------------------------------
174
175# Output filename for elevation
176# this is a combination of all the data generated in build_elevation.py
177combined_elevation_basename = scenario_name + '_combined_elevation'
178
179#-------------------------------------------------------------------------------
180# Directory Structure
181#-------------------------------------------------------------------------------
182
183# determines time for setting up output directories
184time = strftime('%Y%m%d_%H%M%S', localtime()) 
185gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
186build_time = time + '_build'
187run_time = time + '_run_'
188
189# create paths generated from environment variables.
190home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
191   
192# check various directories/files that must exist
193anuga_folder = join(home, state, scenario_folder, 'anuga')
194topographies_folder = join(anuga_folder, 'topographies')
195polygons_folder = join(anuga_folder, 'polygons')
196boundaries_folder = join(anuga_folder, 'boundaries')
197output_folder = join(anuga_folder, 'outputs')
198gauges_folder = join(anuga_folder, 'gauges')
199event_folder = join(boundaries_folder, str(event_number))
200
201#-------------------------------------------------------------------------------
202# Location of input and output data
203#-------------------------------------------------------------------------------
204
205# Convert the user output_comment to a string for run_model.py
206output_comment = ('_'.join([str(x) for x in output_comment if x != user])
207                  + '_' + user)
208
209# The absolute pathname of the all elevation, generated in build_elevation.py
210combined_elevation = join(topographies_folder, combined_elevation_basename)
211
212
213# The pathname for the urs order points, used within build_urs_boundary.py
214if urs_order_filename:
215    urs_order = join(boundaries_folder, urs_order_filename)
216
217# The absolute pathname for the landward points of the bounding polygon,
218# Used within run_model.py)
219if landward_boundary_filename:
220    landward_boundary = join(boundaries_folder, landward_boundary_filename)
221
222# The absolute pathname for the .sts file, generated in build_boundary.py
223event_sts = join(event_folder, scenario_name)
224
225# The absolute pathname for the output folder names
226# Used for build_elevation.py
227output_build = join(output_folder, build_time) + '_' + str(user) 
228# Used for run_model.py
229output_run = join(output_folder, run_time) + output_comment
230# Used by post processing
231output_run_time = join(output_run, scenario_name) 
232
233# The absolute pathname of the mesh, generated in run_model.py
234meshes = join(output_run, scenario_name) + '.msh'
235
236# The absolute pathname for the gauges file
237# Used for get_timeseries.py
238if gauges_filename:
239    gauges = join(gauges_folder, gauges_filename)       
240
241# The absolute pathname for the building file
242# Used for run_building_inundation.py
243if building_exposure_filename:
244    building_exposure = join(gauges_folder, building_exposure_filename)
245
246# The absolute pathname for the image file
247# Used for get_runup.py
248if images_filename:
249    images = join(polygons_folder, images_filename)
250
251
Note: See TracBrowser for help on using the repository browser.