source: DVD_images/extra_files/Gosford/project/project.py @ 7359

Last change on this file since 7359 was 7359, checked in by jgriffin, 15 years ago
  • Property svn:executable set to *
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
10import csv
11#import run_model_later
12
13
14#-------------------------------------------------------------------------------
15# Directory setup
16#-------------------------------------------------------------------------------
17
18# this section needs to be updated to reflect the modelled community.
19# Note, the user needs to set up the directory system accordingly
20state = 'new_south_wales'
21scenario_name = 'gosford'
22scenario_folder = 'gosford_tsunami_scenario_2009'
23
24#-------------------------------------------------------------------------------
25# Initial Conditions
26#-------------------------------------------------------------------------------
27
28tide = 0.0   
29             # difference between MSL and HAT in metres
30zone = 56               # specify zone of model
31#event_number = 58242    # Puysegur 1 in 10 000 # the event number or the mux file name
32#event_number = 51436    # New Hebrides 1 in 10 000
33#event_number = 58349    # Puysegur 1 in 5000
34#event_number = 58284    # Puysegur 1 in 2000
35#event_number = 58187    # Puysegur 1 in 1000
36#event_number = 58113    # Puysegur 1 in 500
37event_number = 58025    # Puysegur 1 in 200
38
39alpha = 0.1             # smoothing parameter for mesh
40friction=0.01           # manning's friction coefficient
41starttime=0             # start time for simulation
42finaltime=60000         # final time for simulation
43
44setup = 'final'         # This can be one of three values
45                        #    trial - coarsest mesh, fast
46                        #    basic - coarse mesh
47                        #    final - fine mesh, slowest
48
49#-------------------------------------------------------------------------------
50# Output filename
51#
52# Your output filename should be unique between different runs on different data.
53# The list of items below will be used to create a file in your output directory.
54# Your user name and time+date will be automatically added.  For example,
55#     [setup, tide, event_number]
56# will result in a filename like
57#     20090212_091046_run_final_0_27283_rwilson
58#-------------------------------------------------------------------------------
59
60output_comment = [setup, tide, event_number]
61
62#-------------------------------------------------------------------------------
63# Input Data
64#-------------------------------------------------------------------------------
65
66# ELEVATION DATA
67# Used in build_elevation.py
68# Format for ascii grids, as produced in ArcGIS + a projection file
69ascii_grid_filenames = []   
70                   
71# Format for point is x,y,elevation (with header)
72point_filenames = []
73       
74
75# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
76# Used in build_elevation.py
77# Format for points easting,northing (no header)
78bounding_polygon_filename = 'bounding_polygon.csv'
79bounding_polygon_maxarea = 100000
80
81# INTERIOR REGIONS -  for designing the mesh
82# Used in run_model.py
83# Format for points easting,northing (no header)
84
85interior_regions_data =[['aoi_umina_large.csv', 500],
86                        ['aoi_terrigal.csv', 500],
87                        ['aos_umina_large.csv', 2500],
88                        ['aos_terrigal.csv', 2500]]
89
90
91# LAND - used to set the initial stage/water to be offcoast only
92# Used in run_model.py.  Format for points easting,northing (no header)
93land_initial_conditions_filename = [['initial_conditions.csv', 0]]
94                                 
95
96# GAUGES - for creating timeseries at a specific point
97# Used in get_timeseries.py. 
98# Format easting,northing,name,elevation (with header)
99gauges_filename = 'gauges.csv'
100
101# BUILDINGS EXPOSURE - for identifying inundated houses
102# Used in run_building_inundation.py
103# Format latitude,longitude etc (geographic)
104##building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
105
106# AREA OF IMAGES - Extent of each image to find out highest runup
107# Header - easting,northing,id,value
108# Used in get_runup.py
109images_filename = ''
110
111# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
112# NOTE: when files are put together the points must be in sequence
113# For ease go clockwise!
114# Check the run_model.py for boundary_tags
115
116# Thinned ordering file from Hazard Map (geographic)
117# Format is index,latitude,longitude (with header)
118urs_order_filename = 'urs_order.csv'
119
120# Landward bounding points
121# Format easting,northing (no header)
122landward_boundary_filename = 'landward_boundary.csv'
123
124# MUX input filename.
125# If a meta-file from EventSelection is used, set 'multi-mux' to True.
126# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
127##mux_input_filename = event_number # to be found in event_folder
128                                    # (ie boundaries/event_number/)
129##multi_mux = False
130mux_input_filename = 'event.list'
131multi_mux = True
132
133zone = 56
134#-------------------------------------------------------------------------------
135# Clipping regions for export to asc and regions for clipping data
136# Final inundation maps should only be created in regions of the finest mesh
137#-------------------------------------------------------------------------------
138
139# ASCII export grid for Gosford
140##xminGosford =
141##xmaxGosford =
142##yminGosford =
143##ymaxGosford =
144
145
146################################################################################
147################################################################################
148####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
149################################################################################
150################################################################################
151
152# Get system user and host names.
153# These values can be used to distinguish between two similar runs by two
154# different users or runs by the same user on two different machines.
155user = get_user_name()
156host = get_host_name()
157
158# Environment variable names.
159# The inundation directory, not the data directory.
160ENV_INUNDATIONHOME = 'ANUGADATA'
161
162#-------------------------------------------------------------------------------
163# Output Elevation Data
164#-------------------------------------------------------------------------------
165
166# Output filename for elevation
167# this is a combination of all the data generated in build_elevation.py
168combined_elevation_basename = scenario_name + '_combined_elevation'
169
170#-------------------------------------------------------------------------------
171# Directory Structure
172#-------------------------------------------------------------------------------
173
174# determines time for setting up output directories
175time = strftime('%Y%m%d_%H%M%S', localtime()) 
176gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
177build_time = time + '_build'
178run_time = time + '_run_'
179
180# create paths generated from environment variables.
181home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
182   
183# check various directories/files that must exist
184anuga_folder = join(home, state, scenario_folder, 'anuga')
185topographies_folder = join(anuga_folder, 'topographies')
186polygons_folder = join(anuga_folder, 'polygons')
187boundaries_folder = join(anuga_folder, 'boundaries')
188output_folder = join(anuga_folder, 'outputs')
189gauges_folder = join(anuga_folder, 'gauges')
190meshes_folder = join(anuga_folder, 'meshes')
191event_folder = join(boundaries_folder, str(event_number))
192
193#-------------------------------------------------------------------------------
194# Location of input and output data
195#-------------------------------------------------------------------------------
196
197# Convert the user output_comment to a string for run_model.py
198output_comment = ('_'.join([str(x) for x in output_comment if x != user])
199                  + '_' + user)
200
201# The absolute pathname of the all elevation, generated in build_elevation.py
202combined_elevation = join(topographies_folder, combined_elevation_basename)
203
204# The absolute pathname of the mesh, generated in run_model.py
205meshes = join(meshes_folder, scenario_name) + '.msh'
206
207# The pathname for the urs order points, used within build_urs_boundary.py
208urs_order = join(boundaries_folder, urs_order_filename)
209
210# The absolute pathname for the landward points of the bounding polygon,
211# Used within run_model.py)
212landward_boundary = join(boundaries_folder, landward_boundary_filename)
213
214# The absolute pathname for the .sts file, generated in build_boundary.py
215event_sts = join(event_folder, scenario_name)
216
217# The absolute pathname for the output folder names
218# Used for build_elevation.py
219output_build = join(output_folder, build_time) + '_' + str(user) 
220# Used for run_model.py
221output_run = join(output_folder, run_time) + output_comment
222# Used by post processing
223output_run_time = join(output_run, scenario_name) 
224
225# The absolute pathname for the gauges file
226# Used for get_timeseries.py
227gauges = join(gauges_folder, gauges_filename)       
228
229# The absolute pathname for the building file
230# Used for run_building_inundation.py
231##building_exposure = join(gauges_folder, building_exposure_filename)
232
233# The absolute pathname for the image file
234# Used for get_runup.py
235if images_filename:
236    images = join(polygons_folder, images_filename)
237
238# full path to where MUX files (or meta-files) live
239mux_input = join(event_folder, mux_input_filename)
240
Note: See TracBrowser for help on using the repository browser.