source: anuga_work/production/new_south_wales/batemans_bay/project.py @ 7600

Last change on this file since 7600 was 7600, checked in by jgriffin, 14 years ago
File size: 10.6 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
10import sys
11
12
13#-------------------------------------------------------------------------------
14# Directory setup
15#-------------------------------------------------------------------------------
16
17# this section needs to be updated to reflect the modelled community.
18# Note, the user needs to set up the directory system accordingly
19state = 'new_south_wales'
20scenario_name = 'batemans_bay'
21scenario_folder = 'batemans_bay_tsunami_scenario_2009'
22
23#-------------------------------------------------------------------------------
24# Initial Conditions
25#-------------------------------------------------------------------------------
26
27# Model specific parameters.
28# One or all can be changed each time the run_model script is executed
29tide = 0.0                # difference between MSL and HAT (1.0)
30
31# the event number or the mux file name
32##event_number = 58129     #1 in 200 yr Puyesgur
33##event_number = 58115     #1 in 500 yr Puysegur
34##event_number = 58226     #1 in 1000 yr Puysegur
35##event_number = 58284     #1 in 2000 yr Puysegur (Event 3)
36##event_number = 58286     #1 in 5000 yr Puysegur
37##event_number = 58346     #1 in 10000 yr Puysegur (Event 1)
38
39##event_number = 51077     #1 in 200 yr New Hebrides
40##event_number = 51378     #1 in 500 yr New Hebrides
41##event_number = 51347     #1 in 1000 yr New Hebrides
42##event_number = 51292     #1 in 2000 yr New Hebrides
43##event_number = 51424     #1 in 5000 yr New Hebrides
44##event_number = 51204     #1 in 10000 yr New Hebrides (Event 2)
45
46######event_number = 58368      #1 in 100 000 yr Puysegur
47######event_number = 51436      #1 in 100 000 yr New Hebrides
48######event_number = 58272      #1 in ~15000 yr Puysegur
49######event_number = 51445      #1 in ~15000 yr New Hebrides
50
51if len(sys.argv) > 1:
52    event_number = int(sys.argv[1])
53else:   
54    event_number = 58284
55#event_number_list = [31583,31602,31714,31913] #7871,#1.5-2.0m
56##event_number_list = [51268,51375,51436,51452] #31997, #1.5-2.0m
57##event_number_list =  [58286,58318,58337,58350] #58176,#1.5-2.0m
58
59##event_number_list = [31831,31897,31961,31973]#31708,
60##event_number_list = [51270,51328,51415,51460]#31981,
61##event_number_list = [58274,58331,58348,58357,58360]#51470,
62
63
64alpha = 0.1             # smoothing parameter for mesh
65friction=0.01           # manning's friction coefficient
66starttime=0             # start time for simulation
67finaltime=60000         # final time for simulation
68
69setup = 'final'         # This can be one of three values
70                        #    trial - coarsest mesh, fast
71                        #    basic - coarse mesh
72                        #    final - fine mesh, slowest
73
74#-------------------------------------------------------------------------------
75# Output filename
76#
77# Your output filename should be unique between different runs on different data.
78# The list of items below will be used to create a file in your output directory.
79# Your user name and time+date will be automatically added.  For example,
80#     [setup, tide, event_number]
81# will result in a filename like
82#     20090212_091046_run_final_0_27283_rwilson
83#-------------------------------------------------------------------------------
84
85output_comment = [setup, tide, event_number]
86
87#-------------------------------------------------------------------------------
88# Input Data
89#-------------------------------------------------------------------------------
90
91# ELEVATION DATA
92# Used in build_elevation.py
93# Format for ascii grids, as produced in ArcGIS + a projection file
94ascii_grid_filenames = []
95                   
96# Format for point is x,y,elevation (with header)
97point_filenames = []
98         
99
100### Add csv header list to all files in point_filenames
101##headerlist = ['x', 'y', 'elevation']
102##for f in point_filenames:
103##    add_csv_header(join(topographies_folder, f), headerlist)
104
105    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
106# Used in build_elevation.py
107# Format for points easting,northing (no header)
108bounding_polygon_filename = 'bounding_polygon.csv'
109bounding_polygon_maxarea = 100000
110
111# INTERIOR REGIONS -  for designing the mesh
112# Used in run_model.py
113# Format for points easting,northing (no header)
114
115interior_regions_data = [['area_of_interest.csv', 500],
116                        ['area_of_significance.csv', 2500],
117                        ['shallow_water.csv', 10000]]
118
119
120# LAND - used to set the initial stage/water to be offcoast only
121# Used in run_model.py.  Format for points easting,northing (no header)
122land_initial_conditions_filename = [['initial_conditions.csv', 0]]
123                                 
124
125# GAUGES - for creating timeseries at a specific point
126# Used in get_timeseries.py. 
127# Format easting,northing,name,elevation (with header)
128gauges_filename = 'phase2_comp.csv'
129
130# BUILDINGS EXPOSURE - for identifying inundated houses
131# Used in run_building_inundation.py
132# Format latitude,longitude etc (geographic)
133building_exposure_filename = '' # from NEXIS
134
135# AREA OF IMAGES - Extent of each image to find out highest runup
136# Header - easting,northing,id,value
137# Used in get_runup.py
138images_filename = ''
139
140# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
141# NOTE: when files are put together the points must be in sequence
142# For ease go clockwise!
143# Check the run_model.py for boundary_tags
144
145# Thinned ordering file from Hazard Map (geographic)
146# Format is index,latitude,longitude (with header)
147urs_order_filename = 'urs_order.csv'
148
149# Landward bounding points
150# Format easting,northing (no header)
151landward_boundary_filename = 'landward_boundary.csv'
152
153# MUX input filename.
154# If a meta-file from EventSelection is used, set 'multi-mux' to True.
155# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
156##mux_input_filename = event_number # to be found in event_folder
157                                    # (ie boundaries/event_number/)
158##multi_mux = False
159mux_input_filename = 'event.list'
160multi_mux = True
161
162zone = 56
163#-------------------------------------------------------------------------------
164# Clipping regions for export to asc and regions for clipping data
165# Final inundation maps should only be created in regions of the finest mesh
166#-------------------------------------------------------------------------------
167
168# ASCII export grid for Batemans Bay
169##xminBatemans_Bay =
170##xmaxBatemans_Bay =
171##yminBatemans_Bay =
172##ymaxBatemans_Bay =
173
174
175
176################################################################################
177################################################################################
178####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
179################################################################################
180################################################################################
181
182# Get system user and host names.
183# These values can be used to distinguish between two similar runs by two
184# different users or runs by the same user on two different machines.
185user = get_user_name()
186host = get_host_name()
187
188# Environment variable names.
189# The inundation directory, not the data directory.
190ENV_INUNDATIONHOME = 'INUNDATIONHOME'
191
192# Path to MUX data
193ENV_MUXHOME = 'MUXHOME'
194
195#-------------------------------------------------------------------------------
196# Output Elevation Data
197#-------------------------------------------------------------------------------
198
199# Output filename for elevation
200# this is a combination of all the data generated in build_elevation.py
201combined_elevation_basename = scenario_name + '_combined_elevation'
202
203#-------------------------------------------------------------------------------
204# Directory Structure
205#-------------------------------------------------------------------------------
206
207# determines time for setting up output directories
208time = strftime('%Y%m%d_%H%M%S', localtime()) 
209gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
210build_time = time + '_build'
211run_time = time + '_run_'
212
213# create paths generated from environment variables.
214home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
215muxhome = os.getenv(ENV_MUXHOME)
216   
217# check various directories/files that must exist
218anuga_folder = join(home, state, scenario_folder, 'anuga')
219topographies_folder = join(anuga_folder, 'topographies')
220polygons_folder = join(anuga_folder, 'polygons')
221boundaries_folder = join(anuga_folder, 'boundaries')
222output_folder = join(anuga_folder, 'outputs')
223gauges_folder = join(anuga_folder, 'gauges')
224meshes_folder = join(anuga_folder, 'meshes')
225event_folder = join(boundaries_folder, str(event_number))
226
227# MUX data files
228# Directory containing the MUX data files to be used with EventSelection.
229mux_data_folder = join(muxhome, 'mux')
230
231#-------------------------------------------------------------------------------
232# Location of input and output data
233#-------------------------------------------------------------------------------
234
235# Convert the user output_comment to a string for run_model.py
236output_comment = ('_'.join([str(x) for x in output_comment if x != user])
237                  + '_' + user)
238
239# The absolute pathname of the all elevation, generated in build_elevation.py
240combined_elevation = join(topographies_folder, combined_elevation_basename)
241
242# The absolute pathname of the mesh, generated in run_model.py
243meshes = join(meshes_folder, scenario_name) + '.msh'
244
245# The pathname for the urs order points, used within build_urs_boundary.py
246urs_order = join(boundaries_folder, urs_order_filename)
247
248# The absolute pathname for the landward points of the bounding polygon,
249# Used within run_model.py)
250landward_boundary = join(boundaries_folder, landward_boundary_filename)
251
252# The absolute pathname for the .sts file, generated in build_boundary.py
253event_sts = join(event_folder, scenario_name)
254
255# The absolute pathname for the output folder names
256# Used for build_elevation.py
257output_build = join(output_folder, build_time) + '_' + str(user) 
258# Used for run_model.py
259output_run = join(output_folder, run_time) + output_comment
260# Used by post processing
261output_run_time = join(output_run, scenario_name) 
262
263# The absolute pathname for the gauges file
264# Used for get_timeseries.py
265gauges = join(gauges_folder, gauges_filename)       
266
267# The absolute pathname for the building file
268# Used for run_building_inundation.py
269building_exposure = join(gauges_folder, building_exposure_filename)
270
271# The absolute pathname for the image file
272# Used for get_runup.py
273if images_filename:
274    images = join(polygons_folder, images_filename)
275
276# full path to where MUX files (or meta-files) live
277mux_input = join(event_folder, mux_input_filename)
278
Note: See TracBrowser for help on using the repository browser.