source: anuga_work/production/busselton/standardised_version/project.py @ 6324

Last change on this file since 6324 was 6324, checked in by rwilson, 16 years ago

Changes to project+setup_model+build_urs_boundary+run_model.

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