source: anuga_work/production/australia_ph2/eucla_motel/project.py @ 6384

Last change on this file since 6384 was 6384, checked in by kristy, 16 years ago

Added new scripts from standard_version

File size: 10.1 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#-------------------------------------------------------------------------------
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 = 'busselton'
20scenario_folder = 'busselton_tsunami_scenario'
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                # difference between MSL and HAT
29zone = 50               # specify zone of model
30event_number = 27197    # 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=80000         # 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 = ['busselton_v2',   # Topo
62                        'grid_250m_clip'] # Busselton Topo
63
64# Format for point is x,y,elevation (with header)
65point_filenames = ['Busselton_Contour0.txt',    # Coastline
66                   'Busselton_BeachSurvey.txt', # Beach survey
67                   'Busselton_NavyFinal.txt',   # Bathymetry
68                   'Busselton_Chart.txt',       # Bathymetry Charts
69                   'Busselton_Digitised.txt',   # Digitised Fairsheet
70                   'Busselton_250m.txt',        # 250m
71                   'Bunbury_TIN.txt',           # Bunbury aoi TIN'd in ArcGIS
72                   'Busselton_TIN.txt',         # Busselton aoi TIN'd in ArcGIS
73                   'XYAHD_clip.txt']            # To extend boundary
74
75### Add csv header list to all files in point_filenames
76##headerlist = ['x', 'y', 'elevation']
77##for f in point_filenames:
78##    add_csv_header(join(topographies_folder, f), headerlist)
79
80    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
81# Used in build_elevation.py
82# Format for points easting,northing (no header)
83bounding_polygon_filename = 'bounding_polygon.csv'
84bounding_polygon_maxarea = 100000
85
86# INTERIOR REGIONS -  for designing the mesh
87# Used in run_model.py
88# Format for points easting,northing (no header)                   
89interior_regions_data = [['busselton_1km.csv', 500],
90                         ['bunbury_1km.csv', 500],
91                         ['busselton_2km.csv', 10000],
92                         ['bunbury_2km.csv', 10000],
93                         ['island1.csv', 10000],
94                         ['island2.csv', 10000],
95                         ['coast_5km_d20m.csv', 40000]]
96
97# LAND - used to set the initial stage/water to be offcoast only
98# Used in run_model.py.  Format for points easting,northing (no header)
99land_initial_conditions_filename = [['initial_condition_extend.csv', 0],
100                                    ['initial_condition_marina.csv', 0]]
101
102# GAUGES - for creating timeseries at a specific point
103# Used in get_timeseries.py. 
104# Format easting,northing,name,elevation (with header)
105gauges_filename = 'gauges.csv'
106
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# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
113# NOTE: when files are put together the points must be in sequence
114# For ease go clockwise!
115# Check the run_model.py for boundary_tags
116
117# Thinned ordering file from Hazard Map (geographic)
118# Format is index,latitude,longitude (with header)
119urs_order_filename = 'thinned_boundary_ordering_extend.csv'
120
121# Landward bounding points
122# Format easting,northing (no header)
123landward_boundary_filename = 'landward_boundary_extend.csv'
124
125# MUX input filename.
126# If a meta-file from EventSelection is used, set 'multi-mux' to True.
127# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
128##mux_input_filename = event_number # to be found in event_folder
129                                    # (ie boundaries/event_number/)
130##multi_mux = False
131mux_input_filename = 'event.list'
132multi_mux = True
133
134#-------------------------------------------------------------------------------
135# Clipping regions for export to asc and regions for clipping data
136# Final inundation maps should only be created in regions of the finest mesh
137#-------------------------------------------------------------------------------
138
139# ASCII export grid for Busselton
140xminBusselton = 340000
141xmaxBusselton = 352000
142yminBusselton = 6271500
143ymaxBusselton = 6280000
144
145# ASCII export grid for Bunbury
146xminBunbury = 369000
147xmaxBunbury = 381000
148yminBunbury = 6308000
149ymaxBunbury = 6316500
150
151################################################################################
152################################################################################
153####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
154################################################################################
155################################################################################
156
157# Get system user and host names.
158# These values can be used to distinguish between two similar runs by two
159# different users or runs by the same user on two different machines.
160user = get_user_name()
161host = get_host_name()
162
163# Environment variable names.
164# The inundation directory, not the data directory.
165ENV_INUNDATIONHOME = 'INUNDATIONHOME'
166
167# Path to MUX data
168ENV_MUXHOME = 'MUXHOME'
169
170#-------------------------------------------------------------------------------
171# Output Elevation Data
172#-------------------------------------------------------------------------------
173
174# Output filename for elevation
175# this is a combination of all the data generated in build_elevation.py
176combined_elevation_basename = scenario_name + '_combined_elevation'
177
178#-------------------------------------------------------------------------------
179# Directory Structure
180#-------------------------------------------------------------------------------
181
182# determines time for setting up output directories
183time = strftime('%Y%m%d_%H%M%S', localtime()) 
184gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
185build_time = time + '_build'
186run_time = time + '_run_'
187
188# create paths generated from environment variables.
189home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
190muxhome = os.getenv(ENV_MUXHOME)
191   
192# check various directories/files that must exist
193anuga_folder = join(home, state, scenario_folder, 'anuga')
194topographies_folder = join(anuga_folder, 'topographies')
195polygons_folder = join(anuga_folder, 'polygons')
196boundaries_folder = join(anuga_folder, 'boundaries')
197output_folder = join(anuga_folder, 'outputs')
198gauges_folder = join(anuga_folder, 'gauges')
199meshes_folder = join(anuga_folder, 'meshes')
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 absolute pathname of the mesh, generated in run_model.py
218meshes = join(meshes_folder, scenario_name) + '.msh'
219
220# The pathname for the urs order points, used within build_urs_boundary.py
221urs_order = join(boundaries_folder, urs_order_filename)
222
223# The absolute pathname for the landward points of the bounding polygon,
224# Used within run_model.py)
225landward_boundary = join(boundaries_folder, landward_boundary_filename)
226
227# The absolute pathname for the .sts file, generated in build_boundary.py
228event_sts = join(event_folder, scenario_name)
229
230# The absolute pathname for the output folder names
231# Used for build_elevation.py
232output_build = join(output_folder, build_time) + '_' + str(user) 
233# Used for run_model.py
234output_run = join(output_folder, run_time) + output_comment
235# Used by post processing
236output_run_time = join(output_run, scenario_name) 
237
238# The absolute pathname for the gauges file
239# Used for get_timeseries.py
240gauges = join(gauges_folder, gauges_filename)       
241
242# The absolute pathname for the building file
243# Used for run_building_inundation.py
244building_exposure = join(gauges_folder, building_exposure_filename)
245
246# full path to where MUX files (or meta-files) live
247mux_input = join(event_folder, mux_input_filename)
248
Note: See TracBrowser for help on using the repository browser.