source: anuga_work/production/australia_ph2/eucla_motel/new_version/project.py @ 6379

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