source: anuga_work/production/geraldton/NewScripts/project.py @ 6421

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

change internal polygon to fit inside bounding_polygon

File size: 9.5 KB
RevLine 
[6420]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
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 = ['landgate_dem_clip',   # Topo
62                        'dted_srtm_islands'] # Geraldton Island Topo
63
64# Format for point is x,y,elevation (with header)
65point_filenames = ['XYcoastline_KVP.txt',      # Coastline
66                   'DPI_Data.txt',             # DPI Bathymetry
67                   'Geraldton_bathymetry.txt', # Original Bathymetry
68                   'Top_bathymetry.txt',       # Top bathymetry
69                   'grid250.txt']              # Grid 250m
70
71# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
72# Used in build_elevation.py
73# Format for points easting,northing (no header)
74bounding_polygon_filename = 'poly_all.csv'
75bounding_polygon_maxarea = 100000
76
77# INTERIOR REGIONS -  for designing the mesh
78# Used in run_model.py
79# Format for points easting,northing (no header)                   
80interior_regions_data = [['CBD_500m.csv', 500],
81                         ['CBD_1km.csv', 800],
[6421]82                         ['island_wallabi_poly2.csv', 5000],
[6420]83                         ['island_dingiville_poly.csv', 5000],
84                         ['island_pelsaert_poly.csv', 5000],
85                         ['neg20_pos20.csv', 25000]]
86
87# LAND - used to set the initial stage/water to be offcoast only
88# Used in run_model.py.  Format for points easting,northing (no header)
89land_initial_conditions_filename = [['land_initial_condition.csv', 0]]
90
91# GAUGES - for creating timeseries at a specific point
92# Used in get_timeseries.py. 
93# Format easting,northing,name,elevation (with header)
94gauges_filename = 'gauges.csv'
95
96# BUILDINGS EXPOSURE - for identifying inundated houses
97# Used in run_building_inundation.py
98# Format latitude,longitude etc (geographic)
99building_exposure_filename = 'geraldton_res_clip.csv' # from NEXIS
100
101# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
102# NOTE: when files are put together the points must be in sequence
103# For ease go clockwise!
104# Check the run_model.py for boundary_tags
105
106# Thinned ordering file from Hazard Map (geographic)
107# Format is index,latitude,longitude (with header)
108urs_order_filename = 'urs_order.csv'
109
110# Landward bounding points
111# Format easting,northing (no header)
112landward_boundary_filename = 'landward_boundary.csv'
113
114
115# MUX input filename.
116# If a meta-file from EventSelection is used, set 'multi-mux' to True.
117# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
118mux_input_filename = event_number # to be found in event_folder
119                                    # (ie boundaries/event_number/)
120multi_mux = False
121#mux_input_filename = 'event.list'
122#multi_mux = True
123
124#-------------------------------------------------------------------------------
125# Clipping regions for export to asc and regions for clipping data
126# Final inundation maps should only be created in regions of the finest mesh
127#-------------------------------------------------------------------------------
128
129# ASCII export grid for Busselton
130xminBusselton = 340000
131xmaxBusselton = 352000
132yminBusselton = 6271500
133ymaxBusselton = 6280000
134
135# ASCII export grid for Bunbury
136xminBunbury = 369000
137xmaxBunbury = 381000
138yminBunbury = 6308000
139ymaxBunbury = 6316500
140
141################################################################################
142################################################################################
143####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
144################################################################################
145################################################################################
146
147# Get system user and host names.
148# These values can be used to distinguish between two similar runs by two
149# different users or runs by the same user on two different machines.
150user = get_user_name()
151host = get_host_name()
152
153# Environment variable names.
154# The inundation directory, not the data directory.
155ENV_INUNDATIONHOME = 'INUNDATIONHOME'
156
157# Path to MUX data
158ENV_MUXHOME = 'MUXHOME'
159
160#-------------------------------------------------------------------------------
161# Output Elevation Data
162#-------------------------------------------------------------------------------
163
164# Output filename for elevation
165# this is a combination of all the data generated in build_elevation.py
166combined_elevation_basename = scenario_name + '_combined_elevation'
167
168#-------------------------------------------------------------------------------
169# Directory Structure
170#-------------------------------------------------------------------------------
171
172# determines time for setting up output directories
173time = strftime('%Y%m%d_%H%M%S', localtime()) 
174gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
175build_time = time + '_build'
176run_time = time + '_run_'
177
178# create paths generated from environment variables.
179home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
180muxhome = os.getenv(ENV_MUXHOME)
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# MUX data files
193# Directory containing the MUX data files to be used with EventSelection.
194mux_data_folder = join(muxhome, 'mux')
195
196#-------------------------------------------------------------------------------
197# Location of input and output data
198#-------------------------------------------------------------------------------
199
200# Convert the user output_comment to a string for run_model.py
201output_comment = ('_'.join([str(x) for x in output_comment if x != user])
202                  + '_' + user)
203
204# The absolute pathname of the all elevation, generated in build_elevation.py
205combined_elevation = join(topographies_folder, combined_elevation_basename)
206
207# The absolute pathname of the mesh, generated in run_model.py
208meshes = join(meshes_folder, scenario_name) + '.msh'
209
210# The pathname for the urs order points, used within build_urs_boundary.py
211urs_order = join(boundaries_folder, urs_order_filename)
212
213# The absolute pathname for the landward points of the bounding polygon,
214# Used within run_model.py)
215landward_boundary = join(boundaries_folder, landward_boundary_filename)
216
217# The absolute pathname for the .sts file, generated in build_boundary.py
218event_sts = join(event_folder, scenario_name)
219
220# The absolute pathname for the output folder names
221# Used for build_elevation.py
222output_build = join(output_folder, build_time) + '_' + str(user) 
223# Used for run_model.py
224output_run = join(output_folder, run_time) + output_comment
225# Used by post processing
226output_run_time = join(output_run, scenario_name) 
227
228# The absolute pathname for the gauges file
229# Used for get_timeseries.py
230gauges = join(gauges_folder, gauges_filename)       
231
232# The absolute pathname for the building file
233# Used for run_building_inundation.py
234building_exposure = join(gauges_folder, building_exposure_filename)
235
236# full path to where MUX files (or meta-files) live
237mux_input = join(event_folder, mux_input_filename)
238
Note: See TracBrowser for help on using the repository browser.