source: anuga_work/production/wa/onslow_2009/project.py @ 7855

Last change on this file since 7855 was 7385, checked in by kristy, 16 years ago
File size: 10.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 = 'western_australia'
18scenario_name = 'onslow'
19scenario_folder = 'onslow_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= 50               # specify UTM zone of model
29central_meridian = None 
30event_number = 27283    # 27255,27283 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# MUX input filename.
42# If a meta-file from EventSelection is used, set 'multi-mux' to True.
43# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
44##mux_input_filename = event_number # to be found in event_folder
45                                    # (ie boundaries/event_number/)
46##multi_mux = False
47mux_input_filename = 'event.list'
48multi_mux = True
49
50#-------------------------------------------------------------------------------
51# Output filename
52#
53# Your output filename should be unique between different runs on different data.
54# The list of items below will be used to create a file in your output directory.
55# Your user name and time+date will be automatically added.  For example,
56#     [setup, tide, event_number]
57# will result in a filename like
58#     20090212_091046_run_final_0_27283_rwilson
59#-------------------------------------------------------------------------------
60
61output_comment = [setup, tide, event_number]
62
63#-------------------------------------------------------------------------------
64# Input Data
65#-------------------------------------------------------------------------------
66
67# ELEVATION DATA
68# Used in build_elevation.py
69# Format for ascii grids, as produced in ArcGIS + a projection file
70ascii_grid_filenames = ['revised_onshore_20m_dli',
71                        'onslow_islands_dted2']
72
73# Format for point is x,y,elevation (with header)
74point_filenames = ['onslow_offshore_points.txt',
75                   'beach_survey.txt',
76                   'ONS16FINAL.txt',
77                   'ONS17FINAL.txt',
78                   'ONS18FINAL.txt' ]
79
80### Add csv header list to all files in point_filenames
81##headerlist = ['x', 'y', 'elevation']
82##for f in point_filenames:
83##    add_csv_header(join(topographies_folder, f), headerlist)
84
85# SIMPLE BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
86# Used in build_elevation.py
87# Format for points easting,northing (no header)
88bounding_polygon_filename = 'bounding_polygon.csv'
89bounding_polygon_maxarea = 100000
90
91# INTERIOR REGIONS -  for designing the mesh
92# Used in run_model.py
93# Format for points easting,northing (no header)                   
94interior_regions_data = [['sw_MH.csv', 3000],
95                         ['aos_MH.csv', 800],
96                         ['aoi_MH.csv', 500],
97                         ['island1_MH.csv', 3000],
98                         ['island2_MH.csv', 3000],
99                         ['island3_MH.csv', 3000],
100                         ['island4_MH.csv', 3000]]
101
102#Format for points easting,northing,id,value
103interior_regions_combined_filename = None
104   
105# LAND - used to set the initial stage/water to be offcoast only
106# Used in run_model.py.
107# If a list format for points easting,northing (no header)
108
109##land_initial_conditions_filename = []
110
111#Format for points easting,northing,id,value
112land_initial_conditions_filename = 'initial_conditions_simple.csv'
113
114# MODEL BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
115# NOTE: when files are put together the points must be in sequence
116# For ease go clockwise!
117# Check the run_model.py for boundary_tags
118
119# Thinned ordering file from Hazard Map (geographic)
120# Format is index,latitude,longitude (with header)
121urs_order_filename = 'urs_order.csv'
122
123# Landward bounding points
124# Format easting,northing (no header)
125landward_boundary_filename = 'landward_boundary.csv'
126
127#-------------------------------------------------------------------------------
128# For output sww file
129#-------------------------------------------------------------------------------
130
131# GAUGES - for creating timeseries at a specific point
132# Used in get_timeseries.py. 
133# Format easting,northing,name,elevation (with header)
134gauges_filename = ''
135# BUILDINGS EXPOSURE - for identifying inundated houses
136# Used in run_building_inundation.py
137# Format latitude,longitude etc (geographic)
138building_exposure_filename = '' # from NEXIS
139
140# AREA OF IMAGES - Extent of each image to find out highest runup
141# Header - easting,northing,id,value
142# Used in get_runup.py
143images_filename = ''
144
145
146# Clipping regions for export to asc and regions for clipping data
147# Final inundation maps should only be created in regions of the finest mesh
148
149# ASCII export grid for Onslow
150xminOnslow = 301200
151xmaxOnslow = 311500
152yminOnslow = 7601000
153ymaxOnslow = 7609200
154
155
156################################################################################
157################################################################################
158####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
159################################################################################
160################################################################################
161
162# Get system user and host names.
163# These values can be used to distinguish between two similar runs by two
164# different users or runs by the same user on two different machines.
165user = get_user_name()
166host = get_host_name()
167
168# Environment variable names.
169# The inundation directory, not the data directory.
170ENV_INUNDATIONHOME = 'INUNDATIONHOME'
171
172# Path to MUX data
173ENV_MUXHOME = 'MUXHOME'
174
175#-------------------------------------------------------------------------------
176# Output Elevation Data
177#-------------------------------------------------------------------------------
178
179# Output filename for elevation
180# this is a combination of all the data generated in build_elevation.py
181combined_elevation_basename = scenario_name + '_2009_combined_elevation'
182
183#-------------------------------------------------------------------------------
184# Directory Structure
185#-------------------------------------------------------------------------------
186
187# determines time for setting up output directories
188time = strftime('%Y%m%d_%H%M%S', localtime()) 
189gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
190build_time = time + '_build'
191run_time = time + '_run_'
192
193# create paths generated from environment variables.
194home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
195muxhome = os.getenv(ENV_MUXHOME)
196   
197# check various directories/files that must exist
198anuga_folder = join(home, state, scenario_folder, 'anuga')
199topographies_folder = join(anuga_folder, 'topographies')
200polygons_folder = join(anuga_folder, 'polygons')
201boundaries_folder = join(anuga_folder, 'boundaries')
202output_folder = join(anuga_folder, 'outputs')
203gauges_folder = join(anuga_folder, 'gauges')
204event_folder = join(boundaries_folder, str(event_number))
205
206# MUX data files
207# Directory containing the MUX data files to be used with EventSelection.
208mux_data_folder = join(muxhome, 'mux')
209
210#-------------------------------------------------------------------------------
211# Location of input and output data
212#-------------------------------------------------------------------------------
213
214# Convert the user output_comment to a string for run_model.py
215output_comment = ('_'.join([str(x) for x in output_comment if x != user])
216                  + '_' + user)
217
218# The absolute pathname of the all elevation, generated in build_elevation.py
219combined_elevation = join(topographies_folder, combined_elevation_basename)
220
221# The pathname for the urs order points, used within build_urs_boundary.py
222if urs_order_filename:
223    urs_order = join(boundaries_folder, urs_order_filename)
224
225# The absolute pathname for the landward points of the bounding polygon,
226# Used within run_model.py)
227if landward_boundary_filename:
228    landward_boundary = join(boundaries_folder, landward_boundary_filename)
229
230# The absolute pathname for the .sts file, generated in build_boundary.py
231event_sts = join(event_folder, scenario_name)
232
233# The absolute pathname for the output folder names
234# Used for build_elevation.py
235output_build = join(output_folder, build_time) + '_' + str(user) 
236# Used for run_model.py
237output_run = join(output_folder, run_time) + output_comment
238# Used by post processing
239output_run_time = join(output_run, scenario_name) 
240
241# The absolute pathname of the mesh, generated in run_model.py
242meshes = join(output_run, scenario_name) + '.msh'
243
244# The absolute pathname for the gauges file
245# Used for get_timeseries.py
246if gauges_filename:
247    gauges = join(gauges_folder, gauges_filename)       
248
249# The absolute pathname for the building file
250# Used for run_building_inundation.py
251if building_exposure_filename:
252    building_exposure = join(gauges_folder, building_exposure_filename)
253
254# The absolute pathname for the image file
255# Used for get_runup.py
256if images_filename:
257    images = join(polygons_folder, images_filename)
258
259
260# full path to where MUX files (or meta-files) live
261mux_input = join(event_folder, mux_input_filename)
262
263#Multiple polygons in one CSV file to make internal polygons
264if not interior_regions_combined_filename == None:
265    interior_regions_combined = join(polygons_folder, interior_regions_combined_filename)
266
267
Note: See TracBrowser for help on using the repository browser.