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

Last change on this file since 7558 was 7558, checked in by sexton, 15 years ago

minor updates to Mandurah scripts

File size: 10.0 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=80000         # final time for simulation
35yieldstep=60            # timestep to save output
36
37setup = 'trial'         # 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                        #'extract_m_peel' # mandurah Topo
65
66# Format for point is x,y,elevation (with header)
67point_filenames = ['bathymetry_all_data.txt',
68                   'DpiU1A03.txt',
69                   'MA-46893-SNDS_AHD.txt',
70                   'MS0205HY_AHD.txt',
71                   'MS0404_AHD.txt',
72                   'YU0403HY_AHD.txt', # All data
73                   'coastline_v1.txt']    # Coastline
74
75### Add csv header list to all files in point_filenames
76##headerlist = ['x', 'y', 'elevation']
77##for f in point_filenames:
78##    add_csv_header(join(topographies_folder, f), headerlist)
79
80# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
81# Used in build_elevation.py
82# Format for points easting,northing (no header)
83bounding_polygon_filename = 'bounding_polygon.csv'
84bounding_polygon_maxarea = 100000
85
86# INTERIOR REGIONS -  for designing the mesh
87# Used in run_model.py
88# Format for points easting,northing (no header)                   
89interior_regions_data = [['area_of_interest1.csv', 500],
90                         ['area_of_interest2.csv', 500],
91                         ['area_of_interest3.csv', 500],
92                         ['bounding_area_of_interest.csv', 2500]]
93
94# LAND - used to set the initial stage/water to be offcoast only
95# Used in run_model.py.  Format for points easting,northing (no header)
96land_initial_conditions_filename = [['initial_conditions.csv', 0]]
97
98# GAUGES - for creating timeseries at a specific point
99# Used in get_timeseries.py. 
100# Format easting,northing,name,elevation (with header)
101# gauges_filename = 'MH_gauges2.csv'
102
103# BUILDINGS EXPOSURE - for identifying inundated houses
104# Used in run_building_inundation.py
105# Format latitude,longitude etc (geographic)
106# building_exposure_filename = 'mandurah_res_clip.csv' # from NEXIS
107
108# AREA OF IMAGES - Extent of each image to find out highest runup
109# Header - easting,northing,id,value
110# Used in get_runup.py
111# images_filename = 'define_area_clip.csv'
112
113# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
114# NOTE: when files are put together the points must be in sequence
115# For ease go clockwise!
116# Check the run_model.py for boundary_tags
117
118# Thinned ordering file from Hazard Map (geographic)
119# Format is index,latitude,longitude (with header)
120urs_order_filename = 'urs_order.csv'
121
122# Landward bounding points
123# Format easting,northing (no header)
124landward_boundary_filename = 'landward_boundary_polygon.csv'
125
126# MUX input filename.
127# If a meta-file from EventSelection is used, set 'multi-mux' to True.
128# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
129##mux_input_filename = event_number # to be found in event_folder
130                                    # (ie boundaries/event_number/)
131##multi_mux = False
132mux_input_filename = 'event.list'
133multi_mux = True
134
135#-------------------------------------------------------------------------------
136# Clipping regions for export to asc and regions for clipping data
137# Final inundation maps should only be created in regions of the finest mesh
138#-------------------------------------------------------------------------------
139
140# This is my clipping region for topo
141clip_box = 'clip_box.csv'
142
143# ASCII export grid for mandurah
144xminmandurah = 377708
145xmaxmandurah = 380186
146yminmandurah = 6399699
147ymaxmandurah = 6401544
148
149
150################################################################################
151################################################################################
152####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
153################################################################################
154################################################################################
155
156# Get system user and host names.
157# These values can be used to distinguish between two similar runs by two
158# different users or runs by the same user on two different machines.
159user = get_user_name()
160host = get_host_name()
161
162# Environment variable names.
163# The inundation directory, not the data directory.
164ENV_INUNDATIONHOME = 'INUNDATIONHOME'
165
166# Path to MUX data
167ENV_MUXHOME = 'MUXHOME'
168
169#-------------------------------------------------------------------------------
170# Output Elevation Data
171#-------------------------------------------------------------------------------
172
173# Output filename for elevation
174# this is a combination of all the data generated in build_elevation.py
175combined_elevation_basename = scenario_name + '_combined_elevation'
176
177#-------------------------------------------------------------------------------
178# Directory Structure
179#-------------------------------------------------------------------------------
180
181# determines time for setting up output directories
182time = strftime('%Y%m%d_%H%M%S', localtime()) 
183gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
184build_time = time + '_build'
185run_time = time + '_run_'
186
187# create paths generated from environment variables.
188home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
189muxhome = os.getenv(ENV_MUXHOME)
190   
191# check various directories/files that must exist
192anuga_folder = join(home, state, scenario_folder, 'anuga')
193topographies_folder = join(anuga_folder, 'topographies')
194polygons_folder = join(anuga_folder, 'polygons')
195boundaries_folder = join(anuga_folder, 'boundaries')
196output_folder = join(anuga_folder, 'outputs')
197gauges_folder = join(anuga_folder, 'gauges')
198event_folder = join(boundaries_folder, str(event_number))
199
200# MUX data files
201# Directory containing the MUX data files to be used with EventSelection.
202mux_data_folder = join(muxhome, 'mux')
203
204#-------------------------------------------------------------------------------
205# Location of input and output data
206#-------------------------------------------------------------------------------
207
208# Convert the user output_comment to a string for run_model.py
209output_comment = ('_'.join([str(x) for x in output_comment if x != user])
210                  + '_' + user)
211
212# The absolute pathname of the all elevation, generated in build_elevation.py
213combined_elevation = join(topographies_folder, combined_elevation_basename)
214
215# The pathname for the urs order points, used within build_urs_boundary.py
216if urs_order_filename:
217    urs_order = join(boundaries_folder, urs_order_filename)
218
219# The absolute pathname for the landward points of the bounding polygon,
220# Used within run_model.py)
221if landward_boundary_filename:
222    landward_boundary = join(boundaries_folder, landward_boundary_filename)
223
224# The absolute pathname for the .sts file, generated in build_boundary.py
225event_sts = join(event_folder, scenario_name)
226
227# The absolute pathname for the output folder names
228# Used for build_elevation.py
229output_build = join(output_folder, build_time) + '_' + str(user) 
230# Used for run_model.py
231output_run = join(output_folder, run_time) + output_comment
232# Used by post processing
233output_run_time = join(output_run, scenario_name) 
234
235# The absolute pathname of the mesh, generated in run_model.py
236meshes = join(output_run, scenario_name) + '.msh'
237
238# The absolute pathname for the gauges file
239# Used for get_timeseries.py
240#if gauges_filename:
241#    gauges = join(gauges_folder, gauges_filename)       
242
243# The absolute pathname for the building file
244# Used for run_building_inundation.py
245# if building_exposure_filename:
246#    building_exposure = join(gauges_folder, building_exposure_filename)
247
248# The absolute pathname for the image file
249# Used for get_runup.py
250# if images_filename:
251#    images = join(polygons_folder, images_filename)
252
253# full path to where MUX files (or meta-files) live
254mux_input = join(event_folder, mux_input_filename)
255
Note: See TracBrowser for help on using the repository browser.