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

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