source: anuga_work/production/onslow_2009_june/project.py @ 7238

Last change on this file since 7238 was 7209, checked in by myall, 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 = 'onslow'
19scenario_folder = 'onslow_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.0              # 3.6 difference between MSL and HAT in metres
28zone = 50               # specify UTM zone of model
29central_meridian = None 
30event_number = 27283    # 27255,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 = ['revised_onshore_20m_dli',
62                        'onslow_islands_dted2']
63
64# Format for point is x,y,elevation (with header)
65point_filenames = ['onslow_offshore_points.txt',
66                   'revised_coastline.txt',
67                   'beach_survey.txt',
68                   'ONS16FINAL.txt',
69                   'ONS17FINAL.txt',
70                   'ONS18FINAL.txt' ]
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 = [['sw_MH.csv', 3000],
87                         ['aos_MH.csv', 800],
88                         ['aoi_MH.csv', 500],
89                         ['island1_MH.csv', 3000],
90                         ['island2_MH.csv', 3000],
91                         ['island3_MH.csv', 3000],
92                         ['island4_MH.csv', 3000]]
93
94PriorityArea_filename = None
95   
96# LAND - used to set the initial stage/water to be offcoast only
97# Used in run_model.py.  Format for points easting,northing,id,value
98land_initial_conditions_filename = 'initial_conditions_mainland.csv'
99
100# GAUGES - for creating timeseries at a specific point
101# Used in get_timeseries.py. 
102# Format easting,northing,name,elevation (with header)
103gauges_filename = ''
104# BUILDINGS EXPOSURE - for identifying inundated houses
105# Used in run_building_inundation.py
106# Format latitude,longitude etc (geographic)
107building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
108
109# AREA OF IMAGES - Extent of each image to find out highest runup
110# Header - easting,northing,id,value
111# Used in get_runup.py
112images_filename = ''
113
114# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
115# NOTE: when files are put together the points must be in sequence
116# For ease go clockwise!
117# Check the run_model.py for boundary_tags
118
119# Thinned ordering file from Hazard Map (geographic)
120# Format is index,latitude,longitude (with header)
121urs_order_filename = 'urs_order.csv'
122
123# Landward bounding points
124# Format easting,northing (no header)
125landward_boundary_filename = 'landward_boundary.csv'
126
127# MUX input filename.
128# If a meta-file from EventSelection is used, set 'multi-mux' to True.
129# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
130##mux_input_filename = event_number # to be found in event_folder
131                                    # (ie boundaries/event_number/)
132##multi_mux = False
133mux_input_filename = 'event.list'
134multi_mux = True
135
136#-------------------------------------------------------------------------------
137# Clipping regions for export to asc and regions for clipping data
138# Final inundation maps should only be created in regions of the finest mesh
139#-------------------------------------------------------------------------------
140
141# ASCII export grid for Bruny
142##xminBruny = 523900
143##xmaxBruny = 533200
144##yminBruny = 5204300
145##ymaxBruny = 5213100
146
147
148################################################################################
149################################################################################
150####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
151################################################################################
152################################################################################
153
154# Get system user and host names.
155# These values can be used to distinguish between two similar runs by two
156# different users or runs by the same user on two different machines.
157user = get_user_name()
158host = get_host_name()
159
160# Environment variable names.
161# The inundation directory, not the data directory.
162ENV_INUNDATIONHOME = 'INUNDATIONHOME'
163
164# Path to MUX data
165ENV_MUXHOME = 'MUXHOME'
166
167#-------------------------------------------------------------------------------
168# Output Elevation Data
169#-------------------------------------------------------------------------------
170
171# Output filename for elevation
172# this is a combination of all the data generated in build_elevation.py
173combined_elevation_basename = scenario_name + '_2009_combined_elevation'
174
175#-------------------------------------------------------------------------------
176# Directory Structure
177#-------------------------------------------------------------------------------
178
179# determines time for setting up output directories
180time = strftime('%Y%m%d_%H%M%S', localtime()) 
181gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
182build_time = time + '_build'
183run_time = time + '_run_'
184
185# create paths generated from environment variables.
186home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
187muxhome = os.getenv(ENV_MUXHOME)
188   
189# check various directories/files that must exist
190anuga_folder = join(home, state, scenario_folder, 'anuga')
191topographies_folder = join(anuga_folder, 'topographies')
192polygons_folder = join(anuga_folder, 'polygons')
193boundaries_folder = join(anuga_folder, 'boundaries')
194output_folder = join(anuga_folder, 'outputs')
195gauges_folder = join(anuga_folder, 'gauges')
196event_folder = join(boundaries_folder, str(event_number))
197
198# MUX data files
199# Directory containing the MUX data files to be used with EventSelection.
200mux_data_folder = join(muxhome, 'mux')
201
202#-------------------------------------------------------------------------------
203# Location of input and output data
204#-------------------------------------------------------------------------------
205
206# Convert the user output_comment to a string for run_model.py
207output_comment = ('_'.join([str(x) for x in output_comment if x != user])
208                  + '_' + user)
209
210# The absolute pathname of the all elevation, generated in build_elevation.py
211combined_elevation = join(topographies_folder, combined_elevation_basename)
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
252# full path to where MUX files (or meta-files) live
253mux_input = join(event_folder, mux_input_filename)
254
255#Multiple polygons in one CSV file to make internal polygons
256if not PriorityArea_filename == None:
257    PriorityAreas = join(polygons_folder, PriorityArea_filename)
258
259
Note: See TracBrowser for help on using the repository browser.