source: anuga_work/production/wa/mandurah_2009/project.py @ 7611

Last change on this file since 7611 was 7611, checked in by monica, 14 years ago

updated for mandurah

File size: 11.5 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#-------------------------------------------------------------------------------
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 = 'western_australia'
19scenario_name = 'mandurah'
20scenario_folder = 'mandurah_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.6              # difference between MSL and HAT in metres
29zone = 50               # specify zone of model
30event_number = 27255    # 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=10         #80000 # final time for simulation
35yieldstep=60            # timestep to save output
36
37setup = 'final'         # This can be one of three values
38                        #    trial - coarsest mesh, fast
39                        #    basic - coarse mesh
40                        #    final - fine mesh, slowest
41
42#-------------------------------------------------------------------------------
43# Output filename
44#
45# Your output filename should be unique between different runs on different data.
46# The list of items below will be used to create a file in your output directory.
47# Your user name and time+date will be automatically added.  For example,
48#     [setup, tide, event_number]
49# will result in a filename like
50#     20090212_091046_run_final_0_27283_rwilson
51#-------------------------------------------------------------------------------
52
53output_comment = [setup, tide, event_number]
54
55#-------------------------------------------------------------------------------
56# Input Data
57#-------------------------------------------------------------------------------
58
59# ELEVATION DATA
60# Used in build_elevation.py
61# Format for ascii grids, as produced in ArcGIS + a projection file
62ascii_grid_filenames = ['m_harvey_10m',   # Topo
63                        'm_peel_10m',
64                        'peel_aoi_1',
65                        'peel_aoi_2',
66                        'peel_aoi_3']
67                        #'extract_m_peel' # mandurah Topo
68
69# Format for point is x,y,elevation (with header)
70point_filenames = ['bathy_update.txt',
71                   'DpiU1A03.txt',
72                   'MA-46893-SNDS_AHD.txt',
73                   'MS0205HY_AHD.txt',
74                   'MS0404_AHD.txt',
75                   'YU0403HY_AHD.txt', # All data
76                   'coastline_v1.txt']    # Coastline
77
78### Add csv header list to all files in point_filenames
79##headerlist = ['x', 'y', 'elevation']
80##for f in point_filenames:
81##    add_csv_header(join(topographies_folder, f), headerlist)
82
83# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
84# Used in build_elevation.py
85# Format for points easting,northing (no header)
86bounding_polygon_filename = 'bounding_polygon.csv'
87bounding_polygon_maxarea = 100000
88
89# INTERIOR REGIONS -  for designing the mesh
90# Used in run_model.py
91# Format for points easting,northing (no header)                   
92interior_regions_data = [['aoi_1.csv', 500],
93                         ['aoi_2.csv', 500],
94                         ['aoi_3.csv', 500],
95                         ['aoi_4.csv', 500],
96                         ['area_of_interest_2.csv', 500],
97                         ['area_of_interest_3.csv', 500],
98                         ['aoi_explode_2.csv', 500],
99                         ['aoi_explode_3.csv', 500],
100                         ['aoi_explode_4.csv', 500],
101                         ['aoi_explode_5.csv', 500],
102                         ['aoi_explode_6.csv', 500],
103                         ['aoi_explode_7.csv', 500],
104                         ['aoi_explode_8.csv', 500],
105                         ['aoi_explode_9.csv', 500],
106                         ['aoi_explode_10.csv', 500],
107                         ['aoi_explode_11.csv', 500],
108                         ['aoi_explode_12.csv', 500],
109                         ['aoi_clip2a_explode1.csv', 500],
110                         ['aoi_clip2a_explode2.csv', 500],
111                         ['aoi_clip2a_explode3.csv', 500],
112                         ['aoi_clip2a_explode4.csv', 500],
113                         ['aoi_clip2a_explode5.csv', 500],
114                         ['aoi_clip2a_explode6.csv', 500],
115                         ['bounding_area_of_interest.csv', 2500]]
116
117# LAND - used to set the initial stage/water to be offcoast only
118# Used in run_model.py.  Format for points easting,northing (no header)
119land_initial_conditions_filename = [['initial_conditions.csv', 0]]
120
121# GAUGES - for creating timeseries at a specific point
122# Used in get_timeseries.py. 
123# Format easting,northing,name,elevation (with header)
124# gauges_filename = 'MH_gauges2.csv'
125
126# BUILDINGS EXPOSURE - for identifying inundated houses
127# Used in run_building_inundation.py
128# Format latitude,longitude etc (geographic)
129# building_exposure_filename = 'mandurah_res_clip.csv' # from NEXIS
130
131# AREA OF IMAGES - Extent of each image to find out highest runup
132# Header - easting,northing,id,value
133# Used in get_runup.py
134# images_filename = 'define_area_clip.csv'
135
136# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
137# NOTE: when files are put together the points must be in sequence
138# For ease go clockwise!
139# Check the run_model.py for boundary_tags
140
141# Thinned ordering file from Hazard Map (geographic)
142# Format is index,latitude,longitude (with header)
143urs_order_filename = 'urs_order.csv'
144
145# Landward bounding points
146# Format easting,northing (no header)
147landward_boundary_filename = 'landward_boundary_polygon.csv'
148
149# MUX input filename.
150# If a meta-file from EventSelection is used, set 'multi-mux' to True.
151# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
152##mux_input_filename = event_number # to be found in event_folder
153                                    # (ie boundaries/event_number/)
154##multi_mux = False
155mux_input_filename = 'event.list'
156multi_mux = True
157
158#-------------------------------------------------------------------------------
159# Clipping regions for export to asc and regions for clipping data
160# Final inundation maps should only be created in regions of the finest mesh
161#-------------------------------------------------------------------------------
162
163# This is my clipping region for topo
164clip_box = 'clip_box.csv'
165
166# ASCII export grid for mandurah for inundation maps
167#xminRegion = 369013
168#xmaxRegion = 385914
169#yminRegion = 6390118
170#ymaxRegion = 6415260
171
172xminAoiR = 370407
173xmaxAoiR = 385745
174yminAoiR = 6390330
175ymaxAoiR = 6405626
176
177#xminAoi1 = 380524
178#xmaxAoi1 = 382123
179#yminAoi1 = 6401707
180#ymaxAoi1 = 6405240
181
182#xminAoi2 = 377764
183#xmaxAoi2 = 381493
184#yminAoi2 = 6396471
185#ymaxAoi2 = 6401692
186
187#xminAoi3 = 371074
188#xmaxAoi3 = 374219
189#yminAoi3 = 6390639
190#ymaxAoi3 = 6394731
191
192
193
194################################################################################
195################################################################################
196####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
197################################################################################
198################################################################################
199
200# Get system user and host names.
201# These values can be used to distinguish between two similar runs by two
202# different users or runs by the same user on two different machines.
203user = get_user_name()
204host = get_host_name()
205
206# Environment variable names.
207# The inundation directory, not the data directory.
208ENV_INUNDATIONHOME = 'INUNDATIONHOME'
209
210# Path to MUX data
211ENV_MUXHOME = 'MUXHOME'
212
213#-------------------------------------------------------------------------------
214# Output Elevation Data
215#-------------------------------------------------------------------------------
216
217# Output filename for elevation
218# this is a combination of all the data generated in build_elevation.py
219combined_elevation_basename = scenario_name + '_combined_elevation'
220
221#-------------------------------------------------------------------------------
222# Directory Structure
223#-------------------------------------------------------------------------------
224
225# determines time for setting up output directories
226time = strftime('%Y%m%d_%H%M%S', localtime()) 
227gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
228build_time = time + '_build'
229run_time = time + '_run_'
230
231# create paths generated from environment variables.
232home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
233muxhome = os.getenv(ENV_MUXHOME)
234   
235# check various directories/files that must exist
236anuga_folder = join(home, state, scenario_folder, 'anuga')
237topographies_folder = join(anuga_folder, 'topographies')
238polygons_folder = join(anuga_folder, 'polygons')
239boundaries_folder = join(anuga_folder, 'boundaries')
240output_folder = join(anuga_folder, 'outputs')
241gauges_folder = join(anuga_folder, 'gauges')
242event_folder = join(boundaries_folder, str(event_number))
243
244# MUX data files
245# Directory containing the MUX data files to be used with EventSelection.
246mux_data_folder = join(muxhome, 'mux')
247
248#-------------------------------------------------------------------------------
249# Location of input and output data
250#-------------------------------------------------------------------------------
251
252# Convert the user output_comment to a string for run_model.py
253output_comment = ('_'.join([str(x) for x in output_comment if x != user])
254                  + '_' + user)
255
256# The absolute pathname of the all elevation, generated in build_elevation.py
257combined_elevation = join(topographies_folder, combined_elevation_basename)
258
259# The pathname for the urs order points, used within build_urs_boundary.py
260if urs_order_filename:
261    urs_order = join(boundaries_folder, urs_order_filename)
262
263# The absolute pathname for the landward points of the bounding polygon,
264# Used within run_model.py)
265if landward_boundary_filename:
266    landward_boundary = join(boundaries_folder, landward_boundary_filename)
267
268# The absolute pathname for the .sts file, generated in build_boundary.py
269event_sts = join(event_folder, scenario_name)
270
271# The absolute pathname for the output folder names
272# Used for build_elevation.py
273output_build = join(output_folder, build_time) + '_' + str(user) 
274# Used for run_model.py
275output_run = join(output_folder, run_time) + output_comment
276# Used by post processing
277output_run_time = join(output_run, scenario_name) 
278
279# The absolute pathname of the mesh, generated in run_model.py
280meshes = join(output_run, scenario_name) + '.msh'
281
282# The absolute pathname for the gauges file
283# Used for get_timeseries.py
284#if gauges_filename:
285#    gauges = join(gauges_folder, gauges_filename)       
286
287# The absolute pathname for the building file
288# Used for run_building_inundation.py
289# if building_exposure_filename:
290#    building_exposure = join(gauges_folder, building_exposure_filename)
291
292# The absolute pathname for the image file
293# Used for get_runup.py
294# if images_filename:
295#    images = join(polygons_folder, images_filename)
296
297# full path to where MUX files (or meta-files) live
298mux_input = join(event_folder, mux_input_filename)
299
Note: See TracBrowser for help on using the repository browser.