source: anuga_work/production/hobart_2009/project.py @ 6984

Last change on this file since 6984 was 6984, checked in by kristy, 16 years ago
File size: 11.3 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# Fitting Scenario
13#-------------------------------------------------------------------------------
14
15extent = None #'small' #None #'sw' # 'aos1' ##'aos1'
16extent_maxarea = 30000
17
18#-------------------------------------------------------------------------------
19# Directory setup
20#-------------------------------------------------------------------------------
21
22# this section needs to be updated to reflect the modelled community.
23# Note, the user needs to set up the directory system accordingly
24state = 'tasmania'
25scenario_name = 'hobart'
26scenario_folder = 'hobart_tsunami_scenario_2009'
27
28#-------------------------------------------------------------------------------
29# Initial Conditions
30#-------------------------------------------------------------------------------
31
32# Model specific parameters.
33# One or all can be changed each time the run_model script is executed
34tide = 0                # difference between MSL and HAT in metres
35zone = 55               # specify UTM zone of model
36event_number = 64477    # 58280, 64477 the event number or the mux file name
37alpha = 0.1             # smoothing parameter for mesh
38friction=0.01           # manning's friction coefficient
39starttime=0             # start time for simulation
40finaltime=65000         # final time for simulation
41
42setup = 'final'         # This can be one of three values
43                        #    trial - coarsest mesh, fast
44                        #    basic - coarse mesh
45                        #    final - fine mesh, slowest
46
47#-------------------------------------------------------------------------------
48# Output filename
49#
50# Your output filename should be unique between different runs on different data.
51# The list of items below will be used to create a file in your output directory.
52# Your user name and time+date will be automatically added.  For example,
53#     [setup, tide, event_number]
54# will result in a filename like
55#     20090212_091046_run_final_0_27283_rwilson
56#-------------------------------------------------------------------------------
57
58output_comment = [setup, tide, event_number, extent]
59
60#-------------------------------------------------------------------------------
61# Input Data
62#-------------------------------------------------------------------------------
63
64# ELEVATION DATA
65# Used in build_elevation.py
66if extent == None:
67    ascii_grid_filenames = ['topo_grid_notsw', 'fitting_problem_sw_elevation']
68    point_filenames = []
69elif extent == 'sw':
70    # Format for ascii grids, as produced in ArcGIS + a projection file
71    ascii_grid_filenames = ['hob3_pro_extract', 'grid_250m_project', 'ldr_bbay',
72                            'ldr_bellerive', 'ldr_brunyislandneck',
73                            'ldr_calvertsbeach', 'ldr_carltonbeach',
74                            'ldr_connelly', 'ldr_cremorne', 'ldr_dodge1',
75                            'ldr_dodge2', 'ldr_kingston', 'ldr_lauderdale',
76                            'ldr_linersfarne', 'ldr_oppossumbay', 'ldr_primrose',
77                            'ldr_rosny', 'ldr_sandybay', 'ldr_selfspoint',
78                            'ldr_sevenmile', 'ldr_southarm1', 'ldr_southarm2',
79                            'ldr_sullivanscove', 'ldr_tranmere', 'tasdem_mask']
80
81    # Format for point is x,y,elevation (with header)
82    point_filenames = ['Topo_1.txt','Topo_2.txt','Topo_3.txt',
83                       'tasmania_data.txt',    # The data from Tasmania
84                       'hydro_data.txt']       # Data from Hydro
85
86### Add csv header list to all files in point_filenames
87##headerlist = ['x', 'y', 'elevation']
88##for f in point_filenames:
89##    add_csv_header(join(topographies_folder, f), headerlist)
90
91# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
92# Used in build_elevation.py
93# Format for points easting,northing (no header)
94bounding_polygon_filename = 'bounding_polygon.csv'
95bounding_polygon_maxarea = 1000000
96
97# INTERIOR REGIONS -  for designing the mesh
98# Used in run_model.py
99# Format for points easting,northing (no header)                   
100if extent == 'sw':
101    interior_regions_data = [['aos1.csv', 1500],
102                             ['aos2.csv', 1500]]
103    PriorityArea_filename = 'PriorityAreas.csv'
104elif extent == 'aos1':
105    interior_regions_data = []
106    PriorityArea_filename = 'PriorityAreas_aos1.csv'
107elif extent == 'aos2':
108    interior_regions_data = []
109    PriorityArea_filename = 'PriorityAreas_aos2.csv'
110elif extent == 'small':
111    interior_regions_data = [['aoi_bruny.csv', 500],
112                             ['aoi_S_arms.csv', 500],
113                             ['aos1_small.csv', 1500],
114                             ['aos2.csv', 1500],
115                             ['sw.csv', 30000]]
116    PriorityArea_filename = None
117elif extent == None:
118    interior_regions_data = [['aos1.csv', 1500],
119                             ['aos2.csv', 1500],
120                             ['sw.csv', 30000]]
121    PriorityArea_filename = 'PriorityAreas.csv'
122   
123# LAND - used to set the initial stage/water to be offcoast only
124# Used in run_model.py.  Format for points easting,northing (no header)
125land_initial_conditions_filename = []
126
127# GAUGES - for creating timeseries at a specific point
128# Used in get_timeseries.py. 
129# Format easting,northing,name,elevation (with header)
130gauges_filename = 'tsunamipointsMGA.csv'
131
132# BUILDINGS EXPOSURE - for identifying inundated houses
133# Used in run_building_inundation.py
134# Format latitude,longitude etc (geographic)
135building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
136
137# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
138# NOTE: when files are put together the points must be in sequence
139# For ease go clockwise!
140# Check the run_model.py for boundary_tags
141
142# Thinned ordering file from Hazard Map (geographic)
143# Format is index,latitude,longitude (with header)
144urs_order_filename = 'urs_order.csv'
145
146# Landward bounding points
147# Format easting,northing (no header)
148landward_boundary_filename = 'landward_boundary.csv'
149
150# MUX input filename.
151# If a meta-file from EventSelection is used, set 'multi-mux' to True.
152# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
153##mux_input_filename = event_number # to be found in event_folder
154                                    # (ie boundaries/event_number/)
155##multi_mux = False
156mux_input_filename = 'event.list'
157multi_mux = True
158
159#-------------------------------------------------------------------------------
160# Clipping regions for export to asc and regions for clipping data
161# Final inundation maps should only be created in regions of the finest mesh
162#-------------------------------------------------------------------------------
163
164# ASCII export grid for Bruny
165xminBruny = 523900
166xmaxBruny = 533200
167yminBruny = 5204300
168ymaxBruny = 5213100
169
170# ASCII export grid for South Arms
171xminSArms = 532497
172xmaxSArms = 534326
173yminSArms = 5237028
174ymaxSArms = 5238465
175
176
177################################################################################
178################################################################################
179####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
180################################################################################
181################################################################################
182
183# Get system user and host names.
184# These values can be used to distinguish between two similar runs by two
185# different users or runs by the same user on two different machines.
186user = get_user_name()
187host = get_host_name()
188
189# Environment variable names.
190# The inundation directory, not the data directory.
191ENV_INUNDATIONHOME = 'INUNDATIONHOME'
192
193# Path to MUX data
194ENV_MUXHOME = 'MUXHOME'
195
196#-------------------------------------------------------------------------------
197# Output Elevation Data
198#-------------------------------------------------------------------------------
199
200# Output filename for elevation
201# this is a combination of all the data generated in build_elevation.py
202combined_elevation_basename = scenario_name + '_combined_elevation'
203
204#-------------------------------------------------------------------------------
205# Directory Structure
206#-------------------------------------------------------------------------------
207
208# determines time for setting up output directories
209time = strftime('%Y%m%d_%H%M%S', localtime()) 
210gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
211build_time = time + '_build'
212run_time = time + '_run_'
213
214# create paths generated from environment variables.
215home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
216muxhome = os.getenv(ENV_MUXHOME)
217   
218# check various directories/files that must exist
219anuga_folder = join(home, state, scenario_folder, 'anuga')
220topographies_folder = join(anuga_folder, 'topographies')
221polygons_folder = join(anuga_folder, 'polygons')
222boundaries_folder = join(anuga_folder, 'boundaries')
223output_folder = join(anuga_folder, 'outputs')
224gauges_folder = join(anuga_folder, 'gauges')
225event_folder = join(boundaries_folder, str(event_number))
226
227# MUX data files
228# Directory containing the MUX data files to be used with EventSelection.
229mux_data_folder = join(muxhome, 'mux')
230
231#-------------------------------------------------------------------------------
232# Location of input and output data
233#-------------------------------------------------------------------------------
234
235# Convert the user output_comment to a string for run_model.py
236output_comment = ('_'.join([str(x) for x in output_comment if x != user])
237                  + '_' + user)
238
239# The absolute pathname of the all elevation, generated in build_elevation.py
240combined_elevation = join(topographies_folder, combined_elevation_basename)
241
242# The pathname for the urs order points, used within build_urs_boundary.py
243if urs_order_filename:
244    urs_order = join(boundaries_folder, urs_order_filename)
245
246# The absolute pathname for the landward points of the bounding polygon,
247# Used within run_model.py)
248if landward_boundary_filename:
249    landward_boundary = join(boundaries_folder, landward_boundary_filename)
250
251# The absolute pathname for the .sts file, generated in build_boundary.py
252event_sts = join(event_folder, scenario_name)
253
254# The absolute pathname for the output folder names
255# Used for build_elevation.py
256output_build = join(output_folder, build_time) + '_' + str(user) 
257# Used for run_model.py
258output_run = join(output_folder, run_time) + output_comment
259# Used by post processing
260output_run_time = join(output_run, scenario_name) 
261
262# The absolute pathname of the mesh, generated in run_model.py
263meshes = join(output_run, scenario_name) + '.msh'
264
265# The absolute pathname for the gauges file
266# Used for get_timeseries.py
267if gauges_filename:
268    gauges = join(gauges_folder, gauges_filename)       
269
270# The absolute pathname for the building file
271# Used for run_building_inundation.py
272if building_exposure_filename:
273    building_exposure = join(gauges_folder, building_exposure_filename)
274
275# full path to where MUX files (or meta-files) live
276mux_input = join(event_folder, mux_input_filename)
277
278#Multiple polygons in one CSV file to make internal polygons
279if not PriorityArea_filename == None:
280    PriorityAreas = join(polygons_folder, PriorityArea_filename)
281
282
Note: See TracBrowser for help on using the repository browser.