source: anuga_work/production/pt_hedland_2009/project.py @ 7201

Last change on this file since 7201 was 7201, checked in by myall, 15 years ago
File size: 9.5 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 = 'pt_hedland'
19scenario_folder = 'pt_hedland_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              # 3.6 difference between MSL and HAT in metres
28zone = 51               # specify UTM zone of model
29event_number = 27283    # 27255,27283 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 = '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
59ascii_grid_filenames = ['dli_dem_clip']
60point_filenames = ['coastline.txt','port_hedland_new2.txt']
61
62### Add csv header list to all files in point_filenames
63##headerlist = ['x', 'y', 'elevation']
64##for f in point_filenames:
65##    add_csv_header(join(topographies_folder, f), headerlist)
66
67# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
68# Used in build_elevation.py
69# Format for points easting,northing (no header)
70bounding_polygon_filename = 'poly_all.csv'
71bounding_polygon_maxarea = 100000
72
73# INTERIOR REGIONS -  for designing the mesh
74# Used in run_model.py
75# Format for points easting,northing (no header)                   
76interior_regions_data = [['shallow_water.csv', 5000],
77                         ['area_of_significance.csv', 1500],
78                         ['area_of_interest.csv', 800]]
79
80PriorityArea_filename = None
81   
82# LAND - used to set the initial stage/water to be offcoast only
83# Used in run_model.py.  Format for points easting,northing,id,value
84land_initial_conditions_filename = 'initial_conditions_comb.csv'
85
86# GAUGES - for creating timeseries at a specific point
87# Used in get_timeseries.py. 
88# Format easting,northing,name,elevation (with header)
89gauges_filename = ''
90# BUILDINGS EXPOSURE - for identifying inundated houses
91# Used in run_building_inundation.py
92# Format latitude,longitude etc (geographic)
93building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
94
95# AREA OF IMAGES - Extent of each image to find out highest runup
96# Header - easting,northing,id,value
97# Used in get_runup.py
98images_filename = ''
99
100# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
101# NOTE: when files are put together the points must be in sequence
102# For ease go clockwise!
103# Check the run_model.py for boundary_tags
104
105# Thinned ordering file from Hazard Map (geographic)
106# Format is index,latitude,longitude (with header)
107urs_order_filename = 'thinned_boundary_ordering.csv'
108
109# Landward bounding points
110# Format easting,northing (no header)
111landward_boundary_filename = 'landward_bounding_polygon.csv'
112
113# MUX input filename.
114# If a meta-file from EventSelection is used, set 'multi-mux' to True.
115# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
116##mux_input_filename = event_number # to be found in event_folder
117                                    # (ie boundaries/event_number/)
118##multi_mux = False
119mux_input_filename = 'event.list'
120multi_mux = True
121
122#-------------------------------------------------------------------------------
123# Clipping regions for export to asc and regions for clipping data
124# Final inundation maps should only be created in regions of the finest mesh
125#-------------------------------------------------------------------------------
126
127# ASCII export grid for Bruny
128##xminBruny = 523900
129##xmaxBruny = 533200
130##yminBruny = 5204300
131##ymaxBruny = 5213100
132
133
134################################################################################
135################################################################################
136####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
137################################################################################
138################################################################################
139
140# Get system user and host names.
141# These values can be used to distinguish between two similar runs by two
142# different users or runs by the same user on two different machines.
143user = get_user_name()
144host = get_host_name()
145
146# Environment variable names.
147# The inundation directory, not the data directory.
148ENV_INUNDATIONHOME = 'INUNDATIONHOME'
149
150# Path to MUX data
151ENV_MUXHOME = 'MUXHOME'
152
153#-------------------------------------------------------------------------------
154# Output Elevation Data
155#-------------------------------------------------------------------------------
156
157# Output filename for elevation
158# this is a combination of all the data generated in build_elevation.py
159combined_elevation_basename = scenario_name + '_combined_elevation'
160
161#-------------------------------------------------------------------------------
162# Directory Structure
163#-------------------------------------------------------------------------------
164
165# determines time for setting up output directories
166time = strftime('%Y%m%d_%H%M%S', localtime()) 
167gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
168build_time = time + '_build'
169run_time = time + '_run_'
170
171# create paths generated from environment variables.
172home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
173muxhome = os.getenv(ENV_MUXHOME)
174   
175# check various directories/files that must exist
176anuga_folder = join(home, state, scenario_folder, 'anuga')
177topographies_folder = join(anuga_folder, 'topographies')
178polygons_folder = join(anuga_folder, 'polygons')
179boundaries_folder = join(anuga_folder, 'boundaries')
180output_folder = join(anuga_folder, 'outputs')
181gauges_folder = join(anuga_folder, 'gauges')
182event_folder = join(boundaries_folder, str(event_number))
183
184# MUX data files
185# Directory containing the MUX data files to be used with EventSelection.
186mux_data_folder = join(muxhome, 'mux')
187
188#-------------------------------------------------------------------------------
189# Location of input and output data
190#-------------------------------------------------------------------------------
191
192# Convert the user output_comment to a string for run_model.py
193output_comment = ('_'.join([str(x) for x in output_comment if x != user])
194                  + '_' + user)
195
196# The absolute pathname of the all elevation, generated in build_elevation.py
197combined_elevation = join(topographies_folder, combined_elevation_basename)
198
199# The pathname for the urs order points, used within build_urs_boundary.py
200if urs_order_filename:
201    urs_order = join(boundaries_folder, urs_order_filename)
202
203# The absolute pathname for the landward points of the bounding polygon,
204# Used within run_model.py)
205if landward_boundary_filename:
206    landward_boundary = join(boundaries_folder, landward_boundary_filename)
207
208# The absolute pathname for the .sts file, generated in build_boundary.py
209event_sts = join(event_folder, scenario_name)
210
211# The absolute pathname for the output folder names
212# Used for build_elevation.py
213output_build = join(output_folder, build_time) + '_' + str(user) 
214# Used for run_model.py
215output_run = join(output_folder, run_time) + output_comment
216# Used by post processing
217output_run_time = join(output_run, scenario_name) 
218
219# The absolute pathname of the mesh, generated in run_model.py
220meshes = join(output_run, scenario_name) + '.msh'
221
222# The absolute pathname for the gauges file
223# Used for get_timeseries.py
224if gauges_filename:
225    gauges = join(gauges_folder, gauges_filename)       
226
227# The absolute pathname for the building file
228# Used for run_building_inundation.py
229if building_exposure_filename:
230    building_exposure = join(gauges_folder, building_exposure_filename)
231
232# The absolute pathname for the image file
233# Used for get_runup.py
234if images_filename:
235    images = join(polygons_folder, images_filename)
236
237
238# full path to where MUX files (or meta-files) live
239mux_input = join(event_folder, mux_input_filename)
240
241#Multiple polygons in one CSV file to make internal polygons
242if not PriorityArea_filename == None:
243    PriorityAreas = join(polygons_folder, PriorityArea_filename)
244
245
Note: See TracBrowser for help on using the repository browser.