source: anuga_work/production/dampier_2009/project.py @ 7293

Last change on this file since 7293 was 7272, checked in by kristy, 16 years ago

New scripts for inundation

File size: 11.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
10from anuga.lib.add_csv_header.add_csv_header import add_csv_header
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 = 'western_australia'
19scenario_name = 'dampier'
20scenario_folder = 'dampier_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.0              # 3.6 difference between MSL and HAT in metres
29zone = 50               # specify UTM zone of model
30central_meridian = None 
31event_number = 27283    # 27255,27283 the event number or the mux file name
32alpha = 0.1             # smoothing parameter for mesh
33friction=0.01           # manning's friction coefficient
34starttime=0             # start time for simulation
35finaltime=1000         # final time for simulation
36
37setup = 'final'         # This can be one of three values
38                        #    trial - coarsest mesh, fast
39                        #    basic - coarse mesh
40                        #    final - fine mesh, slowest
41
42#-------------------------------------------------------------------------------
43# Output filename
44#
45# Your output filename should be unique between different runs on different data.
46# The list of items below will be used to create a file in your output directory.
47# Your user name and time+date will be automatically added.  For example,
48#     [setup, tide, event_number]
49# will result in a filename like
50#     20090212_091046_run_final_0_27283_rwilson
51#-------------------------------------------------------------------------------
52
53output_comment = [setup, tide, event_number]
54
55#-------------------------------------------------------------------------------
56# Input Data
57#-------------------------------------------------------------------------------
58
59# ELEVATION DATA
60# Used in build_elevation.py
61# Format for ascii grids, as produced in ArcGIS + a projection file
62ascii_grid_filenames = []
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 = [['dampier_region.csv', 3000],
82                         ['dampier_aos.csv', 800],
83                         ['dampier_aoi.csv', 500],
84                         ['dampier_north_aos.csv', 800],
85                         ['dampier_north_aoi.csv', 500],
86                         ['karratha_aos.csv', 800],
87                         ['karratha_aoi.csv', 500],
88                         ['ref_ne_islands1.csv', 1500],  ## islands to the NE and headland between dampier and karratha
89                         ['ref_ne_islands2.csv', 1500],  ## island in entrance to bay for Karratha
90##                         ['nwislands.csv', 1500],   ## all islands to the NW:
91                         ['ref_nw4.csv', 1500],
92                         ['ref_nw5.csv', 1500],
93                         ['ref_nw6.csv', 1500],
94                         ['ref_nw7.csv', 1500],
95                         ['ref_nw8.csv', 1500],
96                         ['island0.csv', 10000],   ## make large triangles for land areas of islands to reduce no. of triangles
97                         ['island1.csv', 10000],
98                         ['island2.csv', 10000],
99                         ['island3.csv', 10000],
100                         ['island4.csv', 10000],
101                         ['island5.csv', 10000],
102                         ['island6.csv', 10000],
103                         ['island7.csv', 10000],
104                         ['island8.csv', 10000]]
105
106PriorityArea_filename = None
107   
108# LAND - used to set the initial stage/water to be offcoast only
109# Used in run_model.py.  Format for points easting,northing,id,value
110land_initial_conditions_filename = [['mainland_only.csv',0],  ## these are all placeholders until proper initial conditions made
111                                    ['island0.csv',0]]
112
113# GAUGES - for creating timeseries at a specific point
114# Used in get_timeseries.py. 
115# Format easting,northing,name,elevation (with header)
116gauges_filename = ''
117# BUILDINGS EXPOSURE - for identifying inundated houses
118# Used in run_building_inundation.py
119# Format latitude,longitude etc (geographic)
120building_exposure_filename = '' # from NEXIS
121
122# AREA OF IMAGES - Extent of each image to find out highest runup
123# Header - easting,northing,id,value
124# Used in get_runup.py
125images_filename = ''
126
127# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
128# NOTE: when files are put together the points must be in sequence
129# For ease go clockwise!
130# Check the run_model.py for boundary_tags
131
132# Thinned ordering file from Hazard Map (geographic)
133# Format is index,latitude,longitude (with header)
134urs_order_filename = 'thinned_boundary_ordering.csv'
135
136# Landward bounding points
137# Format easting,northing (no header)
138landward_boundary_filename = 'landward_boundary.csv'
139
140# MUX input filename.
141# If a meta-file from EventSelection is used, set 'multi-mux' to True.
142# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
143##mux_input_filename = event_number # to be found in event_folder
144                                    # (ie boundaries/event_number/)
145##multi_mux = False
146mux_input_filename = 'event.list'
147multi_mux = True
148
149#-------------------------------------------------------------------------------
150# Clipping regions for export to asc and regions for clipping data
151# Final inundation maps should only be created in regions of the finest mesh
152#-------------------------------------------------------------------------------
153
154# ASCII export grid for Dampier
155##xmin =
156##xmax =
157##ymin =
158##ymax =
159
160# ASCII export grid for Karratha
161##xmin =
162##xmax =
163##ymin =
164##ymax =
165
166# ASCII export grid for Dampier northern area
167##xmin =
168##xmax =
169##ymin =
170##ymax =
171
172
173################################################################################
174################################################################################
175####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
176################################################################################
177################################################################################
178
179# Get system user and host names.
180# These values can be used to distinguish between two similar runs by two
181# different users or runs by the same user on two different machines.
182user = get_user_name()
183host = get_host_name()
184
185# Environment variable names.
186# The inundation directory, not the data directory.
187ENV_INUNDATIONHOME = 'INUNDATIONHOME'
188
189# Path to MUX data
190ENV_MUXHOME = 'MUXHOME'
191
192#-------------------------------------------------------------------------------
193# Output Elevation Data
194#-------------------------------------------------------------------------------
195
196# Output filename for elevation
197# this is a combination of all the data generated in build_elevation.py
198combined_elevation_basename = scenario_name + '_combined_elevation'
199
200#-------------------------------------------------------------------------------
201# Directory Structure
202#-------------------------------------------------------------------------------
203
204# determines time for setting up output directories
205time = strftime('%Y%m%d_%H%M%S', localtime()) 
206gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
207build_time = time + '_build'
208run_time = time + '_run_'
209
210# create paths generated from environment variables.
211home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
212muxhome = os.getenv(ENV_MUXHOME)
213   
214# check various directories/files that must exist
215anuga_folder = join(home, state, scenario_folder, 'anuga')
216topographies_folder = join(anuga_folder, 'topographies')
217polygons_folder = join(anuga_folder, 'polygons')
218boundaries_folder = join(anuga_folder, 'boundaries')
219output_folder = join(anuga_folder, 'outputs')
220gauges_folder = join(anuga_folder, 'gauges')
221event_folder = join(boundaries_folder, str(event_number))
222
223### Add csv header list to all files in point_filenames
224##headerlist = ['x', 'y', 'elevation']
225##for f in point_filenames:
226##    add_csv_header(join(topographies_folder, f), headerlist)
227
228# MUX data files
229# Directory containing the MUX data files to be used with EventSelection.
230mux_data_folder = join(muxhome, 'mux')
231
232#-------------------------------------------------------------------------------
233# Location of input and output data
234#-------------------------------------------------------------------------------
235
236# Convert the user output_comment to a string for run_model.py
237output_comment = ('_'.join([str(x) for x in output_comment if x != user])
238                  + '_' + user)
239
240# The absolute pathname of the all elevation, generated in build_elevation.py
241combined_elevation = join(topographies_folder, combined_elevation_basename)
242
243# The pathname for the urs order points, used within build_urs_boundary.py
244if urs_order_filename:
245    urs_order = join(boundaries_folder, urs_order_filename)
246
247# The absolute pathname for the landward points of the bounding polygon,
248# Used within run_model.py)
249if landward_boundary_filename:
250    landward_boundary = join(boundaries_folder, landward_boundary_filename)
251
252# The absolute pathname for the .sts file, generated in build_boundary.py
253event_sts = join(event_folder, scenario_name)
254
255# The absolute pathname for the output folder names
256# Used for build_elevation.py
257output_build = join(output_folder, build_time) + '_' + str(user) 
258# Used for run_model.py
259output_run = join(output_folder, run_time) + output_comment
260# Used by post processing
261output_run_time = join(output_run, scenario_name) 
262
263# The absolute pathname of the mesh, generated in run_model.py
264meshes = join(output_run, scenario_name) + '.msh'
265
266# The absolute pathname for the gauges file
267# Used for get_timeseries.py
268if gauges_filename:
269    gauges = join(gauges_folder, gauges_filename)       
270
271# The absolute pathname for the building file
272# Used for run_building_inundation.py
273if building_exposure_filename:
274    building_exposure = join(gauges_folder, building_exposure_filename)
275
276# The absolute pathname for the image file
277# Used for get_runup.py
278if images_filename:
279    images = join(polygons_folder, images_filename)
280
281
282# full path to where MUX files (or meta-files) live
283mux_input = join(event_folder, mux_input_filename)
284
285#Multiple polygons in one CSV file to make internal polygons
286if not PriorityArea_filename == None:
287    PriorityAreas = join(polygons_folder, PriorityArea_filename)
288
289
Note: See TracBrowser for help on using the repository browser.