source: anuga_work/production/exmouth_2009/project.py @ 7254

Last change on this file since 7254 was 7254, checked in by myall, 15 years ago
File size: 10.4 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 = 'exmouth'
20scenario_folder = 'exmouth_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 = None               # specify UTM zone of model
30central_meridian = 114.0 
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 = 'trial'         # 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
62##ascii_grid_filenames = ['extract_dli',
63##                        'extract_dted']
64ascii_grid_filenames = []
65
66# Format for point is x,y,elevation (with header)
67point_filenames = ['coastline.txt',
68                   'Exmouth.txt',
69                   'extract_dgapcs100.txt',
70                   'extract_rivoli.txt',
71                   'extract_dli.txt',
72                   'extract_dted.txt']
73
74### Add csv header list to all files in point_filenames
75##headerlist = ['x', 'y', 'elevation']
76##for f in point_filenames:
77##    add_csv_header(join(topographies_folder, f), headerlist)
78
79# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
80# Used in build_elevation.py
81# Format for points easting,northing (no header)
82bounding_polygon_filename = 'poly_all_MH.csv'
83bounding_polygon_maxarea = 100000
84
85# INTERIOR REGIONS -  for designing the mesh
86# Used in run_model.py
87# Format for points easting,northing (no header)                   
88interior_regions_data = [['sw_MH.csv', 3000],
89                         ['aos_MH.csv', 800],
90                         ['aoi_MH.csv', 500],
91                         ['island1_MH.csv', 3000],
92                         ['island2_MH.csv', 3000],
93                         ['island3_MH.csv', 3000],
94                         ['island4_MH.csv', 3000],
95                         ['island5_MH.csv', 3000]]#,
96##                         ['island6_MH.csv', 3000]]
97
98PriorityArea_filename = None
99   
100# LAND - used to set the initial stage/water to be offcoast only
101# Used in run_model.py.  Format for points easting,northing,id,value
102land_initial_conditions_filename = 'initial_condition_comb.csv'
103
104# GAUGES - for creating timeseries at a specific point
105# Used in get_timeseries.py. 
106# Format easting,northing,name,elevation (with header)
107gauges_filename = ''
108# BUILDINGS EXPOSURE - for identifying inundated houses
109# Used in run_building_inundation.py
110# Format latitude,longitude etc (geographic)
111building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
112
113# AREA OF IMAGES - Extent of each image to find out highest runup
114# Header - easting,northing,id,value
115# Used in get_runup.py
116images_filename = ''
117
118# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
119# NOTE: when files are put together the points must be in sequence
120# For ease go clockwise!
121# Check the run_model.py for boundary_tags
122
123# Thinned ordering file from Hazard Map (geographic)
124# Format is index,latitude,longitude (with header)
125urs_order_filename = 'thinned_boundary_ordering.csv'
126
127# Landward bounding points
128# Format easting,northing (no header)
129landward_boundary_filename = 'landward_bounding_polygon.csv'
130
131# MUX input filename.
132# If a meta-file from EventSelection is used, set 'multi-mux' to True.
133# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
134##mux_input_filename = event_number # to be found in event_folder
135                                    # (ie boundaries/event_number/)
136##multi_mux = False
137mux_input_filename = 'event.list'
138multi_mux = True
139
140#-------------------------------------------------------------------------------
141# Clipping regions for export to asc and regions for clipping data
142# Final inundation maps should only be created in regions of the finest mesh
143#-------------------------------------------------------------------------------
144
145# ASCII export grid for Bruny
146##xminBruny = 523900
147##xmaxBruny = 533200
148##yminBruny = 5204300
149##ymaxBruny = 5213100
150
151
152################################################################################
153################################################################################
154####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
155################################################################################
156################################################################################
157
158# Get system user and host names.
159# These values can be used to distinguish between two similar runs by two
160# different users or runs by the same user on two different machines.
161user = get_user_name()
162host = get_host_name()
163
164# Environment variable names.
165# The inundation directory, not the data directory.
166ENV_INUNDATIONHOME = 'INUNDATIONHOME'
167
168# Path to MUX data
169ENV_MUXHOME = 'MUXHOME'
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
191muxhome = os.getenv(ENV_MUXHOME)
192   
193# check various directories/files that must exist
194anuga_folder = join(home, state, scenario_folder, 'anuga')
195topographies_folder = join(anuga_folder, 'topographies')
196polygons_folder = join(anuga_folder, 'polygons')
197boundaries_folder = join(anuga_folder, 'boundaries')
198output_folder = join(anuga_folder, 'outputs')
199gauges_folder = join(anuga_folder, 'gauges')
200event_folder = join(boundaries_folder, str(event_number))
201
202### Add csv header list to all files in point_filenames
203##headerlist = ['x', 'y', 'elevation']
204##for f in point_filenames:
205##    add_csv_header(join(topographies_folder, f), headerlist)
206
207# MUX data files
208# Directory containing the MUX data files to be used with EventSelection.
209mux_data_folder = join(muxhome, 'mux')
210
211#-------------------------------------------------------------------------------
212# Location of input and output data
213#-------------------------------------------------------------------------------
214
215# Convert the user output_comment to a string for run_model.py
216output_comment = ('_'.join([str(x) for x in output_comment if x != user])
217                  + '_' + user)
218
219# The absolute pathname of the all elevation, generated in build_elevation.py
220combined_elevation = join(topographies_folder, combined_elevation_basename)
221
222# The pathname for the urs order points, used within build_urs_boundary.py
223if urs_order_filename:
224    urs_order = join(boundaries_folder, urs_order_filename)
225
226# The absolute pathname for the landward points of the bounding polygon,
227# Used within run_model.py)
228if landward_boundary_filename:
229    landward_boundary = join(boundaries_folder, landward_boundary_filename)
230
231# The absolute pathname for the .sts file, generated in build_boundary.py
232event_sts = join(event_folder, scenario_name)
233
234# The absolute pathname for the output folder names
235# Used for build_elevation.py
236output_build = join(output_folder, build_time) + '_' + str(user) 
237# Used for run_model.py
238output_run = join(output_folder, run_time) + output_comment
239# Used by post processing
240output_run_time = join(output_run, scenario_name) 
241
242# The absolute pathname of the mesh, generated in run_model.py
243meshes = join(output_run, scenario_name) + '.msh'
244
245# The absolute pathname for the gauges file
246# Used for get_timeseries.py
247if gauges_filename:
248    gauges = join(gauges_folder, gauges_filename)       
249
250# The absolute pathname for the building file
251# Used for run_building_inundation.py
252if building_exposure_filename:
253    building_exposure = join(gauges_folder, building_exposure_filename)
254
255# The absolute pathname for the image file
256# Used for get_runup.py
257if images_filename:
258    images = join(polygons_folder, images_filename)
259
260
261# full path to where MUX files (or meta-files) live
262mux_input = join(event_folder, mux_input_filename)
263
264#Multiple polygons in one CSV file to make internal polygons
265if not PriorityArea_filename == None:
266    PriorityAreas = join(polygons_folder, PriorityArea_filename)
267
268
Note: See TracBrowser for help on using the repository browser.