source: anuga_work/production/wa/exmouth_2009/project.py @ 7436

Last change on this file since 7436 was 7385, checked in by kristy, 16 years ago
File size: 10.0 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# Directory setup
13#-------------------------------------------------------------------------------
14
15# this section needs to be updated to reflect the modelled community.
16# Note, the user needs to set up the directory system accordingly
17state = 'western_australia'
18scenario_name = 'exmouth'
19scenario_folder = 'exmouth_tsunami_scenario_2009'
20
21#-------------------------------------------------------------------------------
22# Initial Conditions
23#-------------------------------------------------------------------------------
24
25# Model specific parameters.
26# One or all can be changed each time the run_model script is executed
27tide = 0                # difference between MSL and HAT in metres
28zone = None
29central_meridian = 114   # specify the central merdian for the data
30event_number = 27283    # 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 = 'final'         # 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 = ['extract_dli', 'extract_dted'] # onshore elevation data
62
63
64    # Format for point is x,y,elevation (with header)
65point_filenames = ['coastline.txt',  # coastline points with 0m elevation
66                   'Exmouth.txt',    # combined bathymetry for most of model
67                   'extract_dgap_cs100.txt',  # interpolated bathy. for gap in data just NE of Exmouth itself
68                   'extract_rivoli100.txt']     # interpolated bathy. for gap in data near Rivoli islands
69                   #'exmouth_aoi_aos_gridded.txt']  # fine grid of data interpolated from Exmouth.txt for use in refined grids (aoi and aos)
70
71### Add csv header list to all files in point_filenames
72##headerlist = ['x', 'y', 'elevation']
73##for f in point_filenames:
74##    add_csv_header(join(topographies_folder, f), headerlist)
75
76# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
77# Used in build_elevation.py
78# Format for points easting,northing (no header)
79bounding_polygon_filename = 'bounding_polygon.csv'
80bounding_polygon_maxarea = 1000000
81
82# INTERIOR REGIONS -  for designing the mesh
83# Used in run_model.py
84# Format for points easting,northing (no header)                   
85
86interior_regions_data = [['aoi.csv', 500]]
87PriorityArea_filename = 'aos.csv'
88   
89# LAND - used to set the initial stage/water to be offcoast only
90# Used in run_model.py.  Format for points easting,northing (no header)
91land_initial_conditions_filename = 'initial_conditions_simple.csv'
92
93# GAUGES - for creating timeseries at a specific point
94# Used in get_timeseries.py. 
95# Format easting,northing,name,elevation (with header)
96gauges_filename = '' #'TideGaugesPoints.csv' #'tsunamipointsMGA.csv'
97
98# BUILDINGS EXPOSURE - for identifying inundated houses
99# Used in run_building_inundation.py
100# Format latitude,longitude etc (geographic)
101building_exposure_filename = '' # from NEXIS
102
103# AREA OF IMAGES - Extent of each image to find out highest runup
104# Header - easting,northing,id,value
105# Used in get_runup.py
106images_filename = 'images.csv'
107
108# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
109# NOTE: when files are put together the points must be in sequence
110# For ease go clockwise!
111# Check the run_model.py for boundary_tags
112
113# Thinned ordering file from Hazard Map (geographic)
114# Format is index,latitude,longitude (with header)
115urs_order_filename = 'thinned_boundary_ordering.csv'
116
117# Landward bounding points
118# Format easting,northing (no header)
119landward_boundary_filename = 'landward_bounding_polygon.csv'
120
121# MUX input filename.
122# If a meta-file from EventSelection is used, set 'multi-mux' to True.
123# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
124##mux_input_filename = event_number # to be found in event_folder
125                                    # (ie boundaries/event_number/)
126##multi_mux = False
127mux_input_filename = 'event.list'
128multi_mux = True
129
130#-------------------------------------------------------------------------------
131# Clipping regions for export to asc and regions for clipping data
132# Final inundation maps should only be created in regions of the finest mesh
133#-------------------------------------------------------------------------------
134
135# ASCII export grid for Exmouth
136xminExmouth = 511000
137xmaxExmouth = 516000
138yminExmouth = 7567700
139ymaxExmouth = 7576500
140
141################################################################################
142################################################################################
143####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
144################################################################################
145################################################################################
146
147# Get system user and host names.
148# These values can be used to distinguish between two similar runs by two
149# different users or runs by the same user on two different machines.
150user = get_user_name()
151host = get_host_name()
152
153# Environment variable names.
154# The inundation directory, not the data directory.
155ENV_INUNDATIONHOME = 'INUNDATIONHOME'
156
157# Path to MUX data
158ENV_MUXHOME = 'MUXHOME'
159
160#-------------------------------------------------------------------------------
161# Output Elevation Data
162#-------------------------------------------------------------------------------
163
164# Output filename for elevation
165# this is a combination of all the data generated in build_elevation.py
166combined_elevation_basename = scenario_name + '_combined_elevation'
167
168#-------------------------------------------------------------------------------
169# Directory Structure
170#-------------------------------------------------------------------------------
171
172# determines time for setting up output directories
173time = strftime('%Y%m%d_%H%M%S', localtime()) 
174gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
175build_time = time + '_build'
176run_time = time + '_run_'
177
178# create paths generated from environment variables.
179home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
180muxhome = os.getenv(ENV_MUXHOME)
181   
182# check various directories/files that must exist
183anuga_folder = join(home, state, scenario_folder, 'anuga')
184topographies_folder = join(anuga_folder, 'topographies')
185polygons_folder = join(anuga_folder, 'polygons')
186boundaries_folder = join(anuga_folder, 'boundaries')
187output_folder = join(anuga_folder, 'outputs')
188gauges_folder = join(anuga_folder, 'gauges')
189event_folder = join(boundaries_folder, str(event_number))
190
191# MUX data files
192# Directory containing the MUX data files to be used with EventSelection.
193mux_data_folder = join(muxhome, 'mux')
194
195#-------------------------------------------------------------------------------
196# Location of input and output data
197#-------------------------------------------------------------------------------
198
199# Convert the user output_comment to a string for run_model.py
200output_comment = ('_'.join([str(x) for x in output_comment if x != user])
201                  + '_' + user)
202
203# The absolute pathname of the all elevation, generated in build_elevation.py
204combined_elevation = join(topographies_folder, combined_elevation_basename)
205
206# The pathname for the urs order points, used within build_urs_boundary.py
207if urs_order_filename:
208    urs_order = join(boundaries_folder, urs_order_filename)
209
210# The absolute pathname for the landward points of the bounding polygon,
211# Used within run_model.py)
212if landward_boundary_filename:
213    landward_boundary = join(boundaries_folder, landward_boundary_filename)
214
215# The absolute pathname for the .sts file, generated in build_boundary.py
216event_sts = join(event_folder, scenario_name)
217
218# The absolute pathname for the output folder names
219# Used for build_elevation.py
220output_build = join(output_folder, build_time) + '_' + str(user) 
221# Used for run_model.py
222output_run = join(output_folder, run_time) + output_comment
223# Used by post processing
224output_run_time = join(output_run, scenario_name) 
225
226# The absolute pathname of the mesh, generated in run_model.py
227meshes = join(output_run, scenario_name) + '.msh'
228
229# The absolute pathname for the gauges file
230# Used for get_timeseries.py
231if gauges_filename:
232    gauges = join(gauges_folder, gauges_filename)       
233
234# The absolute pathname for the building file
235# Used for run_building_inundation.py
236if building_exposure_filename:
237    building_exposure = join(gauges_folder, building_exposure_filename)
238
239# The absolute pathname for the image file
240# Used for get_runup.py
241if images_filename:
242    images = join(polygons_folder, images_filename)
243
244
245# full path to where MUX files (or meta-files) live
246mux_input = join(event_folder, mux_input_filename)
247
248#Multiple polygons in one CSV file to make internal polygons
249if not PriorityArea_filename == None:
250    PriorityAreas = join(polygons_folder, PriorityArea_filename)
251
252
Note: See TracBrowser for help on using the repository browser.