source: anuga_work/production/Broome_2009/project.py @ 7179

Last change on this file since 7179 was 7179, checked in by myall, 15 years ago

setup june 2009

File size: 9.9 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 = 'broome'
19scenario_folder = 'broome_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                # difference between MSL and HAT in metres
28zone = 51               # specify UTM zone of model
29event_number = 27279    # 58280, 64477 the event number or the mux file name
30alpha = 0.1             # smoothing parameter for mesh
31friction=0.01           # manning's friction coefficient
32starttime=0             # start time for simulation
33finaltime=1000         # final time for simulation
34
35setup = 'trial'         # This can be one of three values
36                        #    trial - coarsest mesh, fast
37                        #    basic - coarse mesh
38                        #    final - fine mesh, slowest
39
40#-------------------------------------------------------------------------------
41# Output filename
42#
43# Your output filename should be unique between different runs on different data.
44# The list of items below will be used to create a file in your output directory.
45# Your user name and time+date will be automatically added.  For example,
46#     [setup, tide, event_number]
47# will result in a filename like
48#     20090212_091046_run_final_0_27283_rwilson
49#-------------------------------------------------------------------------------
50
51output_comment = [setup, tide, event_number]
52
53#-------------------------------------------------------------------------------
54# Input Data
55#-------------------------------------------------------------------------------
56
57# ELEVATION DATA
58# Used in build_elevation.py
59ascii_grid_filenames = ['town_topo_10m',
60                        'cable_250m',
61                        'inferred_north',
62                        'inferred_south',
63                        'north_250m',
64                        'other_topo_250m',
65                        'south_250m']
66point_filenames = ['Broome_coastline.txt','Broome_Bathymetry.txt']
67
68### Add csv header list to all files in point_filenames
69##headerlist = ['x', 'y', 'elevation']
70##for f in point_filenames:
71##    add_csv_header(join(topographies_folder, f), headerlist)
72
73# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
74# Used in build_elevation.py
75# Format for points easting,northing (no header)
76bounding_polygon_filename = 'bounding_polygon.csv'
77bounding_polygon_maxarea = 1000000
78
79# INTERIOR REGIONS -  for designing the mesh
80# Used in run_model.py
81# Format for points easting,northing (no header)                   
82interior_regions_data = [['Shallow_Water_MH.csv', 1500],
83                         ['AoS_MH', 800],
84                         ['AoI_MH', 500],
85                         ['AoS_north_MH', 800],
86                         ['AoI_north_MH', 500],
87                         ['bay_coast_MH', 1500],
88                         ['bay_coast_small_MH', 800]]
89PriorityArea_filename = 'PriorityAreas.csv'
90   
91# LAND - used to set the initial stage/water to be offcoast only
92# Used in run_model.py.  Format for points easting,northing (no header)
93land_initial_conditions_filename = 'initial_conditions_mainland.csv'
94
95# GAUGES - for creating timeseries at a specific point
96# Used in get_timeseries.py. 
97# Format easting,northing,name,elevation (with header)
98gauges_filename = ''
99# BUILDINGS EXPOSURE - for identifying inundated houses
100# Used in run_building_inundation.py
101# Format latitude,longitude etc (geographic)
102building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
103
104# AREA OF IMAGES - Extent of each image to find out highest runup
105# Header - easting,northing,id,value
106# Used in get_runup.py
107images_filename = ''
108
109# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
110# NOTE: when files are put together the points must be in sequence
111# For ease go clockwise!
112# Check the run_model.py for boundary_tags
113
114# Thinned ordering file from Hazard Map (geographic)
115# Format is index,latitude,longitude (with header)
116urs_order_filename = 'thinned_boundary_ordering.csv'
117
118# Landward bounding points
119# Format easting,northing (no header)
120landward_boundary_filename = 'landward_boundary_MH.csv'
121
122# MUX input filename.
123# If a meta-file from EventSelection is used, set 'multi-mux' to True.
124# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
125##mux_input_filename = event_number # to be found in event_folder
126                                    # (ie boundaries/event_number/)
127##multi_mux = False
128mux_input_filename = 'event.list'
129multi_mux = True
130
131#-------------------------------------------------------------------------------
132# Clipping regions for export to asc and regions for clipping data
133# Final inundation maps should only be created in regions of the finest mesh
134#-------------------------------------------------------------------------------
135
136# ASCII export grid for Bruny
137##xminBruny = 523900
138##xmaxBruny = 533200
139##yminBruny = 5204300
140##ymaxBruny = 5213100
141
142
143################################################################################
144################################################################################
145####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
146################################################################################
147################################################################################
148
149# Get system user and host names.
150# These values can be used to distinguish between two similar runs by two
151# different users or runs by the same user on two different machines.
152user = get_user_name()
153host = get_host_name()
154
155# Environment variable names.
156# The inundation directory, not the data directory.
157ENV_INUNDATIONHOME = 'INUNDATIONHOME'
158
159# Path to MUX data
160ENV_MUXHOME = 'MUXHOME'
161
162#-------------------------------------------------------------------------------
163# Output Elevation Data
164#-------------------------------------------------------------------------------
165
166# Output filename for elevation
167# this is a combination of all the data generated in build_elevation.py
168combined_elevation_basename = scenario_name + '_combined_elevation'
169
170#-------------------------------------------------------------------------------
171# Directory Structure
172#-------------------------------------------------------------------------------
173
174# determines time for setting up output directories
175time = strftime('%Y%m%d_%H%M%S', localtime()) 
176gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
177build_time = time + '_build'
178run_time = time + '_run_'
179
180# create paths generated from environment variables.
181home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
182muxhome = os.getenv(ENV_MUXHOME)
183   
184# check various directories/files that must exist
185anuga_folder = join(home, state, scenario_folder, 'anuga')
186topographies_folder = join(anuga_folder, 'topographies')
187polygons_folder = join(anuga_folder, 'polygons')
188boundaries_folder = join(anuga_folder, 'boundaries')
189output_folder = join(anuga_folder, 'outputs')
190gauges_folder = join(anuga_folder, 'gauges')
191event_folder = join(boundaries_folder, str(event_number))
192
193# MUX data files
194# Directory containing the MUX data files to be used with EventSelection.
195mux_data_folder = join(muxhome, 'mux')
196
197#-------------------------------------------------------------------------------
198# Location of input and output data
199#-------------------------------------------------------------------------------
200
201# Convert the user output_comment to a string for run_model.py
202output_comment = ('_'.join([str(x) for x in output_comment if x != user])
203                  + '_' + user)
204
205# The absolute pathname of the all elevation, generated in build_elevation.py
206combined_elevation = join(topographies_folder, combined_elevation_basename)
207
208# The pathname for the urs order points, used within build_urs_boundary.py
209if urs_order_filename:
210    urs_order = join(boundaries_folder, urs_order_filename)
211
212# The absolute pathname for the landward points of the bounding polygon,
213# Used within run_model.py)
214if landward_boundary_filename:
215    landward_boundary = join(boundaries_folder, landward_boundary_filename)
216
217# The absolute pathname for the .sts file, generated in build_boundary.py
218event_sts = join(event_folder, scenario_name)
219
220# The absolute pathname for the output folder names
221# Used for build_elevation.py
222output_build = join(output_folder, build_time) + '_' + str(user) 
223# Used for run_model.py
224output_run = join(output_folder, run_time) + output_comment
225# Used by post processing
226output_run_time = join(output_run, scenario_name) 
227
228# The absolute pathname of the mesh, generated in run_model.py
229meshes = join(output_run, scenario_name) + '.msh'
230
231# The absolute pathname for the gauges file
232# Used for get_timeseries.py
233if gauges_filename:
234    gauges = join(gauges_folder, gauges_filename)       
235
236# The absolute pathname for the building file
237# Used for run_building_inundation.py
238if building_exposure_filename:
239    building_exposure = join(gauges_folder, building_exposure_filename)
240
241# The absolute pathname for the image file
242# Used for get_runup.py
243if images_filename:
244    images = join(polygons_folder, images_filename)
245
246
247# full path to where MUX files (or meta-files) live
248mux_input = join(event_folder, mux_input_filename)
249
250#Multiple polygons in one CSV file to make internal polygons
251if not PriorityArea_filename == None:
252    PriorityAreas = join(polygons_folder, PriorityArea_filename)
253
254
Note: See TracBrowser for help on using the repository browser.