source: anuga_work/production/tweed_heads/project.py @ 7837

Last change on this file since 7837 was 7479, checked in by miriam, 16 years ago

Scripts copied from Hobart, rewritten for tweed valley

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