source: DVD_images/extra_files/Geraldton/project/project.py @ 7594

Last change on this file since 7594 was 7594, checked in by jgriffin, 14 years ago

Added project file

File size: 9.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 = 'geraldton'
20scenario_folder = 'geraldton_tsunami_scenario'
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                # difference between MSL and HAT in metres
29zone = 50               # specify zone of model
30event_number = 'wa04_val'    # 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=1000         # final time for simulation
35
36setup = 'final'         # This can be one of three values
37                        #    trial - coarsest mesh, fast
38                        #    basic - coarse mesh
39                        #    final - fine mesh, slowest
40
41#-------------------------------------------------------------------------------
42# Output filename
43#
44# Your output filename should be unique between different runs on different data.
45# The list of items below will be used to create a file in your output directory.
46# Your user name and time+date will be automatically added.  For example,
47#     [setup, tide, event_number]
48# will result in a filename like
49#     20090212_091046_run_final_0_27283_rwilson
50#-------------------------------------------------------------------------------
51
52output_comment = [setup, tide, event_number]
53
54#-------------------------------------------------------------------------------
55# Input Data
56#-------------------------------------------------------------------------------
57
58# ELEVATION DATA
59# Used in build_elevation.py
60# Format for ascii grids, as produced in ArcGIS + a projection file
61ascii_grid_filenames = [] 
62
63# Format for point is x,y,elevation (with header)
64point_filenames = []         
65
66### Add csv header list to all files in point_filenames
67##headerlist = ['x', 'y', 'elevation']
68##for f in point_filenames:
69##    add_csv_header(join(topographies_folder, f), headerlist)
70
71extent_polygon_filenames = ['buffer_20m.csv',
72                            'ocean_initial_condition.csv',
73                            'land_initial_condition.csv']
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 = 'poly_all.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)                   
84interior_regions_data = [['harbour.csv', 20],
85                         ['CBD_500m.csv', 500],
86                         ['CBD_1km.csv', 800],
87                         ['island_wallabi_poly2.csv', 5000],
88                         ['island_dingiville_poly.csv', 5000],
89                         ['island_pelsaert_poly.csv', 5000]]
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 = [['land_initial_condition.csv', 0],
94                                    ['ocean_initial_condition.csv', 0]]
95
96# GAUGES - for creating timeseries at a specific point
97# Used in get_timeseries.py. 
98# Format easting,northing,name,elevation (with header)
99#gauges_filename = 'MH_gauges.csv'
100gauges_filename = 'geraldton_validation_gauges.csv'
101
102
103# BUILDINGS EXPOSURE - for identifying inundated houses
104# Used in run_building_inundation.py
105# Format latitude,longitude etc (geographic)
106building_exposure_filename = '' 
107
108# barrier
109barrier_filename = 'CBD.csv'
110barrier_filename1 = 'wall.csv'
111
112# Thinned ordering file from Hazard Map (geographic)
113# Format is index,latitude,longitude (with header)
114#urs_order_filename = 'thinned_boundary_ordering.csv'
115urs_order_filename = 'urs_order.csv'
116
117# Landward bounding points
118# Format easting,northing (no header)
119#landward_boundary_filename = 'landward_bounding_polygon.csv'
120landward_boundary_filename = 'landward_boundary.csv'
121
122# MUX input filename.
123# If a meta-file from EventSelection is used, set 'multi-mux' to True.
124# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
125mux_input_filename = event_number # to be found in event_folder
126                                    # (ie boundaries/event_number/)
127multi_mux = False
128##mux_input_filename = 'event.list'
129##multi_mux = True
130
131#-------------------------------------------------------------------------------
132# Clipping regions for export to asc and regions for clipping data
133# Final inundation maps should only be created in regions of the finest mesh
134#-------------------------------------------------------------------------------
135
136# Geraldton CBD extract ascii grid
137xminCBD = 262700
138xmaxCBD = 267600
139yminCBD = 6811500
140ymaxCBD = 6816400
141
142################################################################################
143################################################################################
144####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
145################################################################################
146################################################################################
147
148# Get system user and host names.
149# These values can be used to distinguish between two similar runs by two
150# different users or runs by the same user on two different machines.
151user = get_user_name()
152host = get_host_name()
153
154# Environment variable names.
155# The inundation directory, not the data directory.
156ENV_INUNDATIONHOME = 'ANUGADATA'
157
158#-------------------------------------------------------------------------------
159# Output Elevation Data
160#-------------------------------------------------------------------------------
161
162# Output filename for elevation
163# this is a combination of all the data generated in build_elevation.py
164combined_elevation_basename = scenario_name + '_combined_elevation'
165
166#-------------------------------------------------------------------------------
167# Directory Structure
168#-------------------------------------------------------------------------------
169
170# determines time for setting up output directories
171time = strftime('%Y%m%d_%H%M%S', localtime()) 
172gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
173build_time = time + '_build'
174run_time = time + '_run_'
175
176# create paths generated from environment variables.
177home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
178
179   
180# check various directories/files that must exist
181anuga_folder = join(home, state, scenario_folder, 'anuga')
182topographies_folder = join(anuga_folder, 'topographies')
183polygons_folder = join(anuga_folder, 'polygons')
184boundaries_folder = join(anuga_folder, 'boundaries')
185output_folder = join(anuga_folder, 'outputs')
186gauges_folder = join(anuga_folder, 'gauges')
187meshes_folder = join(anuga_folder, 'meshes')
188event_folder = join(boundaries_folder, str(event_number))
189
190
191#-------------------------------------------------------------------------------
192# Location of input and output data
193#-------------------------------------------------------------------------------
194
195# Convert the user output_comment to a string for run_model.py
196output_comment = ('_'.join([str(x) for x in output_comment if x != user])
197                  + '_' + user)
198
199# The absolute pathname of the all elevation, generated in build_elevation.py
200combined_elevation = join(topographies_folder, combined_elevation_basename)
201
202# The pathname for the urs order points, used within build_urs_boundary.py
203if urs_order_filename:
204    urs_order = join(boundaries_folder, urs_order_filename)
205
206# The absolute pathname for the landward points of the bounding polygon,
207# Used within run_model.py)
208if landward_boundary_filename:
209    landward_boundary = join(boundaries_folder, landward_boundary_filename)
210
211# The absolute pathname for the .sts file, generated in build_boundary.py
212event_sts = join(event_folder, scenario_name)
213
214# The absolute pathname for the output folder names
215# Used for build_elevation.py
216output_build = join(output_folder, build_time) + '_' + str(user) 
217# Used for run_model.py
218output_run = join(output_folder, run_time) + output_comment
219# Used by post processing
220output_run_time = join(output_run, scenario_name) 
221
222# The absolute pathname of the mesh, generated in run_model.py
223meshes = join(output_run, scenario_name) + '.msh'
224
225# The absolute pathname for the gauges file
226# Used for get_timeseries.py
227if gauges_filename:
228    gauges = join(gauges_folder, gauges_filename)       
229
230# The absolute pathname for the building file
231# Used for run_building_inundation.py
232if building_exposure_filename:
233    building_exposure = join(gauges_folder, building_exposure_filename)
234
235# The absolute pathname for the building file
236# Used for run_building_inundation.py
237if barrier_filename:
238    barrier = join(meshes_folder, barrier_filename)
239if barrier_filename1:
240    barrier1 = join(meshes_folder, barrier_filename1)
241
242# full path to where MUX files (or meta-files) live
243mux_input = join(event_folder, mux_input_filename)
244
Note: See TracBrowser for help on using the repository browser.