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

Last change on this file since 7120 was 7120, checked in by kristy, 15 years ago
File size: 12.0 KB
RevLine 
[6457]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
[6984]11#-------------------------------------------------------------------------------
12# Fitting Scenario
13#-------------------------------------------------------------------------------
[6457]14
[6984]15extent = None #'small' #None #'sw' # 'aos1' ##'aos1'
16extent_maxarea = 30000
17
[6457]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
[6984]35zone = 55               # specify UTM zone of model
36event_number = 64477    # 58280, 64477 the event number or the mux file name
[6457]37alpha = 0.1             # smoothing parameter for mesh
38friction=0.01           # manning's friction coefficient
39starttime=0             # start time for simulation
[6984]40finaltime=65000         # final time for simulation
[6457]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
[6984]58output_comment = [setup, tide, event_number, extent]
[6457]59
60#-------------------------------------------------------------------------------
61# Input Data
62#-------------------------------------------------------------------------------
63
64# ELEVATION DATA
65# Used in build_elevation.py
[6984]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']
[6457]80
[6984]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
[6457]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'
[6499]95bounding_polygon_maxarea = 1000000
[6457]96
97# INTERIOR REGIONS -  for designing the mesh
98# Used in run_model.py
99# Format for points easting,northing (no header)                   
[6984]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   
[6457]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)
[7120]130gauges_filename = 'time_of_arrival_hobart.csv' #'TideGaugesPoints.csv' #'tsunamipointsMGA.csv'
[6457]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
[7082]137# AREA OF IMAGES - Extent of each image to find out highest runup
[7120]138# Header - easting,northing,id,value
[7082]139# Used in get_runup.py
140images_filename = 'images.csv'
141
[6457]142# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
143# NOTE: when files are put together the points must be in sequence
144# For ease go clockwise!
145# Check the run_model.py for boundary_tags
146
147# Thinned ordering file from Hazard Map (geographic)
148# Format is index,latitude,longitude (with header)
149urs_order_filename = 'urs_order.csv'
150
151# Landward bounding points
152# Format easting,northing (no header)
153landward_boundary_filename = 'landward_boundary.csv'
154
155# MUX input filename.
156# If a meta-file from EventSelection is used, set 'multi-mux' to True.
157# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
158##mux_input_filename = event_number # to be found in event_folder
159                                    # (ie boundaries/event_number/)
160##multi_mux = False
161mux_input_filename = 'event.list'
162multi_mux = True
163
164#-------------------------------------------------------------------------------
165# Clipping regions for export to asc and regions for clipping data
166# Final inundation maps should only be created in regions of the finest mesh
167#-------------------------------------------------------------------------------
168
[6984]169# ASCII export grid for Bruny
170xminBruny = 523900
171xmaxBruny = 533200
172yminBruny = 5204300
173ymaxBruny = 5213100
[6457]174
[6984]175# ASCII export grid for South Arms
176xminSArms = 532497
177xmaxSArms = 534326
178yminSArms = 5237028
179ymaxSArms = 5238465
[6457]180
[7082]181# ASCII export grid for Hobart Large
182xminHobart = 520000
183xmaxHobart = 545000
184yminHobart = 5230000
185ymaxHobart = 5260000
[6984]186
[7082]187# ASCII export grid for North West Communities
188xminNW = 548000
189xmaxNW = 561000
190yminNW = 5250000
191ymaxNW = 5258000
192
193# ASCII export grid for South Communities
194xminSouth = 523000
195xmaxSouth = 533300
196yminSouth = 5197000
197ymaxSouth = 5214000
198
199
[6457]200################################################################################
201################################################################################
202####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
203################################################################################
204################################################################################
205
206# Get system user and host names.
207# These values can be used to distinguish between two similar runs by two
208# different users or runs by the same user on two different machines.
209user = get_user_name()
210host = get_host_name()
211
212# Environment variable names.
213# The inundation directory, not the data directory.
214ENV_INUNDATIONHOME = 'INUNDATIONHOME'
215
216# Path to MUX data
217ENV_MUXHOME = 'MUXHOME'
218
219#-------------------------------------------------------------------------------
220# Output Elevation Data
221#-------------------------------------------------------------------------------
222
223# Output filename for elevation
224# this is a combination of all the data generated in build_elevation.py
225combined_elevation_basename = scenario_name + '_combined_elevation'
226
227#-------------------------------------------------------------------------------
228# Directory Structure
229#-------------------------------------------------------------------------------
230
231# determines time for setting up output directories
232time = strftime('%Y%m%d_%H%M%S', localtime()) 
233gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
234build_time = time + '_build'
235run_time = time + '_run_'
236
237# create paths generated from environment variables.
238home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
239muxhome = os.getenv(ENV_MUXHOME)
240   
241# check various directories/files that must exist
242anuga_folder = join(home, state, scenario_folder, 'anuga')
243topographies_folder = join(anuga_folder, 'topographies')
244polygons_folder = join(anuga_folder, 'polygons')
245boundaries_folder = join(anuga_folder, 'boundaries')
246output_folder = join(anuga_folder, 'outputs')
247gauges_folder = join(anuga_folder, 'gauges')
248event_folder = join(boundaries_folder, str(event_number))
249
250# MUX data files
251# Directory containing the MUX data files to be used with EventSelection.
252mux_data_folder = join(muxhome, 'mux')
253
254#-------------------------------------------------------------------------------
255# Location of input and output data
256#-------------------------------------------------------------------------------
257
258# Convert the user output_comment to a string for run_model.py
259output_comment = ('_'.join([str(x) for x in output_comment if x != user])
260                  + '_' + user)
261
262# The absolute pathname of the all elevation, generated in build_elevation.py
263combined_elevation = join(topographies_folder, combined_elevation_basename)
264
265# The pathname for the urs order points, used within build_urs_boundary.py
266if urs_order_filename:
267    urs_order = join(boundaries_folder, urs_order_filename)
268
269# The absolute pathname for the landward points of the bounding polygon,
270# Used within run_model.py)
271if landward_boundary_filename:
272    landward_boundary = join(boundaries_folder, landward_boundary_filename)
273
274# The absolute pathname for the .sts file, generated in build_boundary.py
275event_sts = join(event_folder, scenario_name)
276
277# The absolute pathname for the output folder names
278# Used for build_elevation.py
279output_build = join(output_folder, build_time) + '_' + str(user) 
280# Used for run_model.py
281output_run = join(output_folder, run_time) + output_comment
282# Used by post processing
283output_run_time = join(output_run, scenario_name) 
284
[6984]285# The absolute pathname of the mesh, generated in run_model.py
286meshes = join(output_run, scenario_name) + '.msh'
287
[6457]288# The absolute pathname for the gauges file
289# Used for get_timeseries.py
290if gauges_filename:
291    gauges = join(gauges_folder, gauges_filename)       
292
293# The absolute pathname for the building file
294# Used for run_building_inundation.py
295if building_exposure_filename:
296    building_exposure = join(gauges_folder, building_exposure_filename)
297
[7082]298# The absolute pathname for the image file
299# Used for get_runup.py
300if images_filename:
301    images = join(polygons_folder, images_filename)
302
303
[6457]304# full path to where MUX files (or meta-files) live
305mux_input = join(event_folder, mux_input_filename)
306
[6499]307#Multiple polygons in one CSV file to make internal polygons
[6984]308if not PriorityArea_filename == None:
309    PriorityAreas = join(polygons_folder, PriorityArea_filename)
[6499]310
311
Note: See TracBrowser for help on using the repository browser.