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

Last change on this file since 6457 was 6457, checked in by kristy, 15 years ago

new script for hobart2009

File size: 9.3 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
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 = 'tasmania'
19scenario_name = 'hobart'
20scenario_folder = 'hobart_tsunami_scenario_2009'
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 in metres
29zone = 55               # specify zone of model
30event_number = 58364    # the event number or the mux file name
31alpha = 0.1             # smoothing parameter for mesh
32friction=0.01           # manning's friction coefficient
33starttime=0             # start time for simulation
34finaltime=1000         # final time for simulation
35
36setup = 'final'         # This can be one of three values
37                        #    trial - coarsest mesh, fast
38                        #    basic - coarse mesh
39                        #    final - fine mesh, slowest
40
41#-------------------------------------------------------------------------------
42# Output filename
43#
44# Your output filename should be unique between different runs on different data.
45# The list of items below will be used to create a file in your output directory.
46# Your user name and time+date will be automatically added.  For example,
47#     [setup, tide, event_number]
48# will result in a filename like
49#     20090212_091046_run_final_0_27283_rwilson
50#-------------------------------------------------------------------------------
51
52output_comment = [setup, tide, event_number]
53
54#-------------------------------------------------------------------------------
55# Input Data
56#-------------------------------------------------------------------------------
57
58# ELEVATION DATA
59# Used in build_elevation.py
60# Format for ascii grids, as produced in ArcGIS + a projection file
61ascii_grid_filenames = ['hob3_project',   # Topo
62                        'grid_250m_project'] # Busselton Topo
63
64# Format for point is x,y,elevation (with header)
65point_filenames = ['tasmania_data.txt',    # The data from Tasmania
66                   'hydro_data.txt']       # Data from Hydro
67
68### Add csv header list to all files in point_filenames
69##headerlist = ['x', 'y', 'elevation']
70##for f in point_filenames:
71##    add_csv_header(join(topographies_folder, f), headerlist)
72
73# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
74# Used in build_elevation.py
75# Format for points easting,northing (no header)
76bounding_polygon_filename = 'bounding_polygon.csv'
77bounding_polygon_maxarea = 100000
78
79# INTERIOR REGIONS -  for designing the mesh
80# Used in run_model.py
81# Format for points easting,northing (no header)                   
82interior_regions_data = []
83
84# LAND - used to set the initial stage/water to be offcoast only
85# Used in run_model.py.  Format for points easting,northing (no header)
86land_initial_conditions_filename = []
87
88# GAUGES - for creating timeseries at a specific point
89# Used in get_timeseries.py. 
90# Format easting,northing,name,elevation (with header)
91gauges_filename = 'gauges.csv'
92
93# BUILDINGS EXPOSURE - for identifying inundated houses
94# Used in run_building_inundation.py
95# Format latitude,longitude etc (geographic)
96building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
97
98# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
99# NOTE: when files are put together the points must be in sequence
100# For ease go clockwise!
101# Check the run_model.py for boundary_tags
102
103# Thinned ordering file from Hazard Map (geographic)
104# Format is index,latitude,longitude (with header)
105urs_order_filename = 'urs_order.csv'
106
107# Landward bounding points
108# Format easting,northing (no header)
109landward_boundary_filename = 'landward_boundary.csv'
110
111# MUX input filename.
112# If a meta-file from EventSelection is used, set 'multi-mux' to True.
113# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
114##mux_input_filename = event_number # to be found in event_folder
115                                    # (ie boundaries/event_number/)
116##multi_mux = False
117mux_input_filename = 'event.list'
118multi_mux = True
119
120#-------------------------------------------------------------------------------
121# Clipping regions for export to asc and regions for clipping data
122# Final inundation maps should only be created in regions of the finest mesh
123#-------------------------------------------------------------------------------
124
125# ASCII export grid for Busselton
126xminBusselton = 340000
127xmaxBusselton = 352000
128yminBusselton = 6271500
129ymaxBusselton = 6280000
130
131# ASCII export grid for Bunbury
132xminBunbury = 369000
133xmaxBunbury = 381000
134yminBunbury = 6308000
135ymaxBunbury = 6316500
136
137################################################################################
138################################################################################
139####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
140################################################################################
141################################################################################
142
143# Get system user and host names.
144# These values can be used to distinguish between two similar runs by two
145# different users or runs by the same user on two different machines.
146user = get_user_name()
147host = get_host_name()
148
149# Environment variable names.
150# The inundation directory, not the data directory.
151ENV_INUNDATIONHOME = 'INUNDATIONHOME'
152
153# Path to MUX data
154ENV_MUXHOME = 'MUXHOME'
155
156#-------------------------------------------------------------------------------
157# Output Elevation Data
158#-------------------------------------------------------------------------------
159
160# Output filename for elevation
161# this is a combination of all the data generated in build_elevation.py
162combined_elevation_basename = scenario_name + '_combined_elevation'
163
164#-------------------------------------------------------------------------------
165# Directory Structure
166#-------------------------------------------------------------------------------
167
168# determines time for setting up output directories
169time = strftime('%Y%m%d_%H%M%S', localtime()) 
170gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
171build_time = time + '_build'
172run_time = time + '_run_'
173
174# create paths generated from environment variables.
175home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
176muxhome = os.getenv(ENV_MUXHOME)
177   
178# check various directories/files that must exist
179anuga_folder = join(home, state, scenario_folder, 'anuga')
180topographies_folder = join(anuga_folder, 'topographies')
181polygons_folder = join(anuga_folder, 'polygons')
182boundaries_folder = join(anuga_folder, 'boundaries')
183output_folder = join(anuga_folder, 'outputs')
184gauges_folder = join(anuga_folder, 'gauges')
185meshes_folder = join(anuga_folder, 'meshes')
186event_folder = join(boundaries_folder, str(event_number))
187
188# MUX data files
189# Directory containing the MUX data files to be used with EventSelection.
190mux_data_folder = join(muxhome, 'mux')
191
192#-------------------------------------------------------------------------------
193# Location of input and output data
194#-------------------------------------------------------------------------------
195
196# Convert the user output_comment to a string for run_model.py
197output_comment = ('_'.join([str(x) for x in output_comment if x != user])
198                  + '_' + user)
199
200# The absolute pathname of the all elevation, generated in build_elevation.py
201combined_elevation = join(topographies_folder, combined_elevation_basename)
202
203# The absolute pathname of the mesh, generated in run_model.py
204meshes = join(meshes_folder, scenario_name) + '.msh'
205
206# The pathname for the urs order points, used within build_urs_boundary.py
207if urs_order_filename:
208    urs_order = join(boundaries_folder, urs_order_filename)
209
210# The absolute pathname for the landward points of the bounding polygon,
211# Used within run_model.py)
212if landward_boundary_filename:
213    landward_boundary = join(boundaries_folder, landward_boundary_filename)
214
215# The absolute pathname for the .sts file, generated in build_boundary.py
216event_sts = join(event_folder, scenario_name)
217
218# The absolute pathname for the output folder names
219# Used for build_elevation.py
220output_build = join(output_folder, build_time) + '_' + str(user) 
221# Used for run_model.py
222output_run = join(output_folder, run_time) + output_comment
223# Used by post processing
224output_run_time = join(output_run, scenario_name) 
225
226# The absolute pathname for the gauges file
227# Used for get_timeseries.py
228if gauges_filename:
229    gauges = join(gauges_folder, gauges_filename)       
230
231# The absolute pathname for the building file
232# Used for run_building_inundation.py
233if building_exposure_filename:
234    building_exposure = join(gauges_folder, building_exposure_filename)
235
236# full path to where MUX files (or meta-files) live
237mux_input = join(event_folder, mux_input_filename)
238
Note: See TracBrowser for help on using the repository browser.