source: anuga_work/production/wa/broome_2009/project.py @ 7855

Last change on this file since 7855 was 7384, checked in by kristy, 16 years ago
File size: 10.2 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 = 70444    # 27283 the event number or the mux file name
30                        # 70408
31                        # 70444
32alpha = 0.1             # smoothing parameter for mesh
33friction=0.01           # manning's friction coefficient
34starttime=0             # start time for simulation
35finaltime=80000         # 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
61ascii_grid_filenames = ['town_topo_10m',
62                        'cable_250m',
63                        'inferred_north',
64                        'inferred_south',
65                        'north_250m',
66                        'other_topo_250m',
67                        'south_250m']
68point_filenames = ['Broome_coastline.txt','Broome_Bathymetry_exWADPI.txt']
69
70### Add csv header list to all files in point_filenames
71##headerlist = ['x', 'y', 'elevation']
72##for f in point_filenames:
73##    add_csv_header(join(topographies_folder, f), headerlist)
74
75# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
76# Used in build_elevation.py
77# Format for points easting,northing (no header)
78bounding_polygon_filename = 'poly_all.csv'
79bounding_polygon_maxarea = 100000
80
81# INTERIOR REGIONS -  for designing the mesh
82# Used in run_model.py
83# Format for points easting,northing (no header)                   
84interior_regions_data = [['aoi.csv', 500],
85                         ['aos.csv', 1000],
86                         ['sw.csv', 5000]]
87##interior_regions_data = [['Shallow_Water_large_MH.csv', 5000],
88##                         ['AoS_MH.csv', 800],
89##                         ['AoI_MH.csv', 500],
90##                         ['AoS_north_MH.csv', 800],
91##                         ['AoI_north_MH.csv', 500],
92####                         ['bay_coast_MH.csv', 5000],
93##                         ['bay_coast_small_MH.csv', 1500]]
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 (no header)
98##land_initial_conditions_filename = []
99
100#Format for points easting,northing,id,value
101land_initial_conditions_filename = 'initial_conditions.csv'
102
103# GAUGES - for creating timeseries at a specific point
104# Used in get_timeseries.py. 
105# Format easting,northing,name,elevation (with header)
106gauges_filename = ''
107# BUILDINGS EXPOSURE - for identifying inundated houses
108# Used in run_building_inundation.py
109# Format latitude,longitude etc (geographic)
110building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
111
112# AREA OF IMAGES - Extent of each image to find out highest runup
113# Header - easting,northing,id,value
114# Used in get_runup.py
115images_filename = ''
116
117# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
118# NOTE: when files are put together the points must be in sequence
119# For ease go clockwise!
120# Check the run_model.py for boundary_tags
121
122# Thinned ordering file from Hazard Map (geographic)
123# Format is index,latitude,longitude (with header)
124urs_order_filename = 'thinned_boundary_ordering.csv'
125
126# Landward bounding points
127# Format easting,northing (no header)
128landward_boundary_filename = 'landward_boundary.csv'
129
130# MUX input filename.
131# If a meta-file from EventSelection is used, set 'multi-mux' to True.
132# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
133##mux_input_filename = event_number # to be found in event_folder
134                                    # (ie boundaries/event_number/)
135##multi_mux = False
136mux_input_filename = 'event.list'
137multi_mux = True
138
139#-------------------------------------------------------------------------------
140# Clipping regions for export to asc and regions for clipping data
141# Final inundation maps should only be created in regions of the finest mesh
142#-------------------------------------------------------------------------------
143
144# ASCII export grid for Broome
145xminBroome = 410900
146xmaxBroome = 424500
147yminBroome = 8007000
148ymaxBroome = 8017500
149
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# MUX data files
203# Directory containing the MUX data files to be used with EventSelection.
204mux_data_folder = join(muxhome, 'mux')
205
206#-------------------------------------------------------------------------------
207# Location of input and output data
208#-------------------------------------------------------------------------------
209
210# Convert the user output_comment to a string for run_model.py
211output_comment = ('_'.join([str(x) for x in output_comment if x != user])
212                  + '_' + user)
213
214# The absolute pathname of the all elevation, generated in build_elevation.py
215combined_elevation = join(topographies_folder, combined_elevation_basename)
216
217# The pathname for the urs order points, used within build_urs_boundary.py
218if urs_order_filename:
219    urs_order = join(boundaries_folder, urs_order_filename)
220
221# The absolute pathname for the landward points of the bounding polygon,
222# Used within run_model.py)
223if landward_boundary_filename:
224    landward_boundary = join(boundaries_folder, landward_boundary_filename)
225
226# The absolute pathname for the .sts file, generated in build_boundary.py
227event_sts = join(event_folder, scenario_name)
228
229# The absolute pathname for the output folder names
230# Used for build_elevation.py
231output_build = join(output_folder, build_time) + '_' + str(user) 
232# Used for run_model.py
233output_run = join(output_folder, run_time) + output_comment
234# Used by post processing
235output_run_time = join(output_run, scenario_name) 
236
237# The absolute pathname of the mesh, generated in run_model.py
238meshes = join(output_run, scenario_name) + '.msh'
239
240# The absolute pathname for the gauges file
241# Used for get_timeseries.py
242if gauges_filename:
243    gauges = join(gauges_folder, gauges_filename)       
244
245# The absolute pathname for the building file
246# Used for run_building_inundation.py
247if building_exposure_filename:
248    building_exposure = join(gauges_folder, building_exposure_filename)
249
250# The absolute pathname for the image file
251# Used for get_runup.py
252if images_filename:
253    images = join(polygons_folder, images_filename)
254
255
256# full path to where MUX files (or meta-files) live
257mux_input = join(event_folder, mux_input_filename)
258
259#Multiple polygons in one CSV file to make internal polygons
260if not PriorityArea_filename == None:
261    PriorityAreas = join(polygons_folder, PriorityArea_filename)
262
263
Note: See TracBrowser for help on using the repository browser.