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

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

Ready for use, fixed known problems

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#-------------------------------------------------------------------------------
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 = 27197    # 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=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### Add csv header list to all files in point_filenames
75##headerlist = ['x', 'y', 'elevation']
76##for f in point_filenames:
77##    add_csv_header(join(topographies_folder, f), headerlist)
78
79    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
80# Used in build_elevation.py
81# Format for points easting,northing (no header)
82bounding_polygon_filename = 'bounding_polygon.csv'
83bounding_polygon_maxarea = 100000
84
85# INTERIOR REGIONS -  for designing the mesh
86# Used in run_model.py
87# Format for points easting,northing (no header)                   
88interior_regions_data = [['busselton_1km.csv', 500],
89                         ['bunbury_1km.csv', 500],
90                         ['busselton_2km.csv', 10000],
91                         ['bunbury_2km.csv', 10000],
92                         ['island1.csv', 10000],
93                         ['island2.csv', 10000],
94                         ['coast_5km_d20m.csv', 40000]]
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)
98land_initial_conditions_filename = [['initial_condition_extend.csv', 0],
99                                    ['initial_condition_marina.csv', 0]]
100
101# GAUGES - for creating timeseries at a specific point
102# Used in get_timeseries.py. 
103# Format easting,northing,name,elevation (with header)
104gauges_filename = 'gauges.csv'
105
106# BUILDINGS EXPOSURE - for identifying inundated houses
107# Used in run_building_inundation.py
108# Format latitude,longitude etc (geographic)
109building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
110
111# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
112# NOTE: when files are put together the points must be in sequence
113# For ease go clockwise!
114# Check the run_model.py for boundary_tags
115
116# Thinned ordering file from Hazard Map (geographic)
117# Format is index,latitude,longitude (with header)
118urs_order_filename = 'thinned_boundary_ordering_extend.csv'
119
120# Landward bounding points
121# Format easting,northing (no header)
122landward_boundary_filename = 'landward_boundary_extend.csv'
123
124# MUX input filename.
125# If a meta-file from EventSelection is used, set 'multi-mux' to True.
126# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
127##mux_input_filename = event_number # to be found in event_folder
128                                    # (ie boundaries/event_number/)
129##multi_mux = False
130mux_input_filename = 'event.list'
131multi_mux = True
132
133#-------------------------------------------------------------------------------
134# Clipping regions for export to asc and regions for clipping data
135# Final inundation maps should only be created in regions of the finest mesh
136#-------------------------------------------------------------------------------
137
138# ASCII export grid for Busselton
139xminBusselton = 340000
140xmaxBusselton = 352000
141yminBusselton = 6271500
142ymaxBusselton = 6280000
143
144# ASCII export grid for Bunbury
145xminBunbury = 369000
146xmaxBunbury = 381000
147yminBunbury = 6308000
148ymaxBunbury = 6316500
149
150################################################################################
151################################################################################
152####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
153################################################################################
154################################################################################
155
156# Get system user and host names.
157# These values can be used to distinguish between two similar runs by two
158# different users or runs by the same user on two different machines.
159user = get_user_name()
160host = get_host_name()
161
162# Environment variable names.
163# The inundation directory, not the data directory.
164ENV_INUNDATIONHOME = 'INUNDATIONHOME'
165
166# Path to MUX data
167ENV_MUXHOME = 'MUXHOME'
168
169#-------------------------------------------------------------------------------
170# Output Elevation Data
171#-------------------------------------------------------------------------------
172
173# Output filename for elevation
174# this is a combination of all the data generated in build_elevation.py
175combined_elevation_basename = scenario_name + '_combined_elevation'
176
177#-------------------------------------------------------------------------------
178# Directory Structure
179#-------------------------------------------------------------------------------
180
181# determines time for setting up output directories
182time = strftime('%Y%m%d_%H%M%S', localtime()) 
183gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
184build_time = time + '_build'
185run_time = time + '_run_'
186
187# create paths generated from environment variables.
188home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
189muxhome = os.getenv(ENV_MUXHOME)
190   
191# check various directories/files that must exist
192anuga_folder = join(home, state, scenario_folder, 'anuga')
193topographies_folder = join(anuga_folder, 'topographies')
194polygons_folder = join(anuga_folder, 'polygons')
195boundaries_folder = join(anuga_folder, 'boundaries')
196output_folder = join(anuga_folder, 'outputs')
197gauges_folder = join(anuga_folder, 'gauges')
198meshes_folder = join(anuga_folder, 'meshes')
199event_folder = join(boundaries_folder, str(event_number))
200
201# MUX data files
202# Directory containing the MUX data files to be used with EventSelection.
203mux_data_folder = join(muxhome, 'mux')
204
205#-------------------------------------------------------------------------------
206# Location of input and output data
207#-------------------------------------------------------------------------------
208
209# Convert the user output_comment to a string for run_model.py
210output_comment = ('_'.join([str(x) for x in output_comment if x != user])
211                  + '_' + user)
212
213# The absolute pathname of the all elevation, generated in build_elevation.py
214combined_elevation = join(topographies_folder, combined_elevation_basename)
215
216# The absolute pathname of the mesh, generated in run_model.py
217meshes = join(meshes_folder, scenario_name) + '.msh'
218
219# The pathname for the urs order points, used within build_urs_boundary.py
220urs_order = join(boundaries_folder, urs_order_filename)
221
222# The absolute pathname for the landward points of the bounding polygon,
223# Used within run_model.py)
224landward_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 for the gauges file
238# Used for get_timeseries.py
239gauges = join(gauges_folder, gauges_filename)       
240
241# The absolute pathname for the building file
242# Used for run_building_inundation.py
243building_exposure = join(gauges_folder, building_exposure_filename)
244
245# full path to where MUX files (or meta-files) live
246mux_input = join(event_folder, mux_input_filename)
247
Note: See TracBrowser for help on using the repository browser.