source: anuga_work/production/geraldton/geraldton_rerun/project.py @ 6839

Last change on this file since 6839 was 6839, checked in by kristy, 15 years ago

updated scripts to test theory of no wave

File size: 10.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
30#event_number = 27255    # the event number or the mux file name
31event_number = 'wa04_val'    # the event number or the mux file name
32alpha = 0.1             # smoothing parameter for mesh
33friction=0.01           # manning's friction coefficient
34starttime=0             # start time for simulation
35finaltime=1000         # final time for simulation
36
37setup = 'final'         # 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, 'Bt']
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 = ['landgate_dem_clip',   # Topo
63                        'dted_srtm_islands'] # Islands Topo
64
65# Format for point is x,y,elevation (with header)
66point_filenames = ['XYcoastline_KVP.txt',    # Coastline
67                   'Geraldton_bathymetry.txt', # Original data
68                   'DPI_Data.txt',   # new bathymetry from DPI
69                   'grid250.txt',       # Wholes use 250m grid 2005
70                   'Top_bathymetry.txt']            # To extend boundary
71
72### Add csv header list to all files in point_filenames
73##headerlist = ['x', 'y', 'elevation']
74##for f in point_filenames:
75##    add_csv_header(join(topographies_folder, f), headerlist)
76
77extent_polygon_filenames = ['buffer_20m.csv',
78                            'ocean_initial_condition.csv',
79                            'land_initial_condition.csv']
80
81# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
82# Used in build_elevation.py
83# Format for points easting,northing (no header)
84bounding_polygon_filename = 'poly_all.csv'
85bounding_polygon_maxarea = 100000
86
87# INTERIOR REGIONS -  for designing the mesh
88# Used in run_model.py
89# Format for points easting,northing (no header)                   
90interior_regions_data = [['harbour.csv', 20],
91                         ['CBD_500m.csv', 500],
92                         ['CBD_1km.csv', 800],
93                         ['island_wallabi_poly2.csv', 5000],
94                         ['island_dingiville_poly.csv', 5000],
95                         ['island_pelsaert_poly.csv', 5000]]
96
97# LAND - used to set the initial stage/water to be offcoast only
98# Used in run_model.py.  Format for points easting,northing (no header)
99land_initial_conditions_filename = [['land_initial_condition.csv', 0],
100                                    ['ocean_initial_condition.csv', 0]]
101
102# GAUGES - for creating timeseries at a specific point
103# Used in get_timeseries.py. 
104# Format easting,northing,name,elevation (with header)
105#gauges_filename = 'MH_gauges.csv'
106gauges_filename = 'nick_geraldton_gauges.csv'
107gauges_myall_filename = 'MH_gauges2.csv'
108
109# BUILDINGS EXPOSURE - for identifying inundated houses
110# Used in run_building_inundation.py
111# Format latitude,longitude etc (geographic)
112building_exposure_filename = 'geraldton_res_clip.csv' # from NEXIS
113
114# barrier
115barrier_filename = 'CBD.csv'
116barrier_filename1 = 'wall.csv'
117
118# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
119# NOTE: when files are put together the points must be in sequence
120# For ease go clockwise!
121# Check the run_model.py for boundary_tags
122
123# Thinned ordering file from Hazard Map (geographic)
124# Format is index,latitude,longitude (with header)
125#urs_order_filename = 'thinned_boundary_ordering.csv'
126urs_order_filename = 'urs_order.csv'
127
128# Landward bounding points
129# Format easting,northing (no header)
130#landward_boundary_filename = 'landward_bounding_polygon.csv'
131landward_boundary_filename = 'landward_boundary.csv'
132
133# MUX input filename.
134# If a meta-file from EventSelection is used, set 'multi-mux' to True.
135# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
136mux_input_filename = event_number # to be found in event_folder
137                                    # (ie boundaries/event_number/)
138multi_mux = False
139##mux_input_filename = 'event.list'
140##multi_mux = True
141
142#-------------------------------------------------------------------------------
143# Clipping regions for export to asc and regions for clipping data
144# Final inundation maps should only be created in regions of the finest mesh
145#-------------------------------------------------------------------------------
146
147# Geraldton CBD extract ascii grid
148xminCBD = 262700
149xmaxCBD = 267600
150yminCBD = 6811500
151ymaxCBD = 6816400
152
153################################################################################
154################################################################################
155####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
156################################################################################
157################################################################################
158
159# Get system user and host names.
160# These values can be used to distinguish between two similar runs by two
161# different users or runs by the same user on two different machines.
162user = get_user_name()
163host = get_host_name()
164
165# Environment variable names.
166# The inundation directory, not the data directory.
167ENV_INUNDATIONHOME = 'INUNDATIONHOME'
168
169# Path to MUX data
170ENV_MUXHOME = 'MUXHOME'
171
172#-------------------------------------------------------------------------------
173# Output Elevation Data
174#-------------------------------------------------------------------------------
175
176# Output filename for elevation
177# this is a combination of all the data generated in build_elevation.py
178combined_elevation_basename = scenario_name + '_combined_elevation'
179
180#-------------------------------------------------------------------------------
181# Directory Structure
182#-------------------------------------------------------------------------------
183
184# determines time for setting up output directories
185time = strftime('%Y%m%d_%H%M%S', localtime()) 
186gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
187build_time = time + '_build'
188run_time = time + '_run_'
189
190# create paths generated from environment variables.
191home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
192muxhome = os.getenv(ENV_MUXHOME)
193   
194# check various directories/files that must exist
195anuga_folder = join(home, state, scenario_folder, 'anuga')
196topographies_folder = join(anuga_folder, 'topographies')
197polygons_folder = join(anuga_folder, 'polygons')
198boundaries_folder = join(anuga_folder, 'boundaries')
199output_folder = join(anuga_folder, 'outputs')
200gauges_folder = join(anuga_folder, 'gauges')
201meshes_folder = join(anuga_folder, 'meshes')
202event_folder = join(boundaries_folder, str(event_number))
203
204# MUX data files
205# Directory containing the MUX data files to be used with EventSelection.
206mux_data_folder = join(muxhome, 'mux')
207
208#-------------------------------------------------------------------------------
209# Location of input and output data
210#-------------------------------------------------------------------------------
211
212# Convert the user output_comment to a string for run_model.py
213output_comment = ('_'.join([str(x) for x in output_comment if x != user])
214                  + '_' + user)
215
216# The absolute pathname of the all elevation, generated in build_elevation.py
217combined_elevation = join(topographies_folder, combined_elevation_basename)
218
219# The pathname for the urs order points, used within build_urs_boundary.py
220if urs_order_filename:
221    urs_order = join(boundaries_folder, urs_order_filename)
222
223# The absolute pathname for the landward points of the bounding polygon,
224# Used within run_model.py)
225if landward_boundary_filename:
226    landward_boundary = join(boundaries_folder, landward_boundary_filename)
227
228# The absolute pathname for the .sts file, generated in build_boundary.py
229event_sts = join(event_folder, scenario_name)
230
231# The absolute pathname for the output folder names
232# Used for build_elevation.py
233output_build = join(output_folder, build_time) + '_' + str(user) 
234# Used for run_model.py
235output_run = join(output_folder, run_time) + output_comment
236# Used by post processing
237output_run_time = join(output_run, scenario_name) 
238
239# The absolute pathname of the mesh, generated in run_model.py
240meshes = join(output_run, scenario_name) + '.msh'
241
242# The absolute pathname for the gauges file
243# Used for get_timeseries.py
244if gauges_filename:
245    gauges = join(gauges_folder, gauges_filename)       
246
247if gauges_myall_filename:
248    gauges_myall = join(gauges_folder, gauges_myall_filename) 
249
250# The absolute pathname for the building file
251# Used for run_building_inundation.py
252if building_exposure_filename:
253    building_exposure = join(gauges_folder, building_exposure_filename)
254
255# The absolute pathname for the building file
256# Used for run_building_inundation.py
257if barrier_filename:
258    barrier = join(meshes_folder, barrier_filename)
259if barrier_filename1:
260    barrier1 = join(meshes_folder, barrier_filename1)
261
262# full path to where MUX files (or meta-files) live
263mux_input = join(event_folder, mux_input_filename)
264
Note: See TracBrowser for help on using the repository browser.