source: anuga_work/production/australia_ph2/dampier/project.py @ 6798

Last change on this file since 6798 was 6797, checked in by kristy, 16 years ago
File size: 9.4 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
10from os import sep
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 = 'australia_ph2'
20scenario_name = 'dampier'
21scenario_folder = scenario_name
22
23#-------------------------------------------------------------------------------
24# Initial Conditions
25#-------------------------------------------------------------------------------
26
27# Model specific parameters.
28# One or all can be changed each time the run_model script is executed
29tide = 0                # difference between MSL and HAT
30zone = 50               # specify zone of model
31central_meridian = None
32
33import sys
34if len(sys.argv) > 1:
35    event_number = int(sys.argv[1])
36else:   
37    event_number = 70844    # the event number or the mux file name
38
39event_number_list = [70844, 27338, 70337] # To piggy back multiple events
40
41alpha = 0.1             # smoothing parameter for mesh
42friction=0.01           # manning's friction coefficient
43starttime=0             # start time for simulation
44finaltime=1000          # final time for simulation
45
46# for sensetivity study
47model = 'simple' #60km 90km 120km all
48
49# index is only used when wave = Tb
50index = 1307            # index from the PTHA
51wave = 'Tb'             # Bf (sts wave) Tb (index wave)
52
53setup = 'trial'         # This can be one of three values
54                        #    trial - coarsest mesh, fast
55                        #    basic - coarse mesh
56                        #    final - fine mesh, slowest
57
58#-------------------------------------------------------------------------------
59# Output filename
60#
61# Your output filename should be unique between different runs on different data.
62# The list of items below will be used to create a file in your output directory.
63# Your user name and time+date will be automatically added.  For example,
64#     [setup, tide, event_number]
65# will result in a filename like
66#     20090212_091046_run_final_0_27283_rwilson
67#-------------------------------------------------------------------------------
68
69output_comment = [setup, tide, event_number, wave, model]
70
71#-------------------------------------------------------------------------------
72# Input Data
73#-------------------------------------------------------------------------------
74
75# ELEVATION DATA
76# Used in build_elevation.py
77# Format for ascii grids, as produced in ArcGIS + a projection file
78ascii_grid_filenames = ['grid250m_simple'] # 250m grid 2005
79
80# Format for point is x,y,elevation (with header)
81point_filenames = [] # 250m grid 2005
82
83### Add csv header list to all files in point_filenames
84##headerlist = ['x', 'y', 'elevation']
85##for f in point_filenames:
86##    add_csv_header(join(topographies_folder, f), headerlist)
87
88    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
89# Used in build_elevation.py
90# Format for points easting,northing (no header)
91bounding_polygon_filename = 'poly_all_' + model + '.csv'
92bounding_polygon_maxarea = 100000
93
94# INTERIOR REGIONS -  for designing the mesh
95# Used in run_model.py
96# Format for points easting,northing (no header)                   
97interior_regions_data = []
98
99# LAND - used to set the initial stage/water to be offcoast only
100# Used in run_model.py.  Format for points easting,northing (no header)
101land_initial_conditions_filename = []
102
103# GAUGES - for creating timeseries at a specific point
104# Used in get_timeseries.py. 
105# Format easting,northing,name,elevation (with header)
106gauges_filename = 'gauges.csv'
107
108# BUILDINGS EXPOSURE - for identifying inundated houses
109# Used in run_building_inundation.py
110# Format latitude,longitude etc (geographic)
111building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
112
113# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
114# NOTE: when files are put together the points must be in sequence
115# For ease go clockwise!
116# Check the run_model.py for boundary_tags
117
118# Thinned ordering file from Hazard Map (geographic)
119# Format is index,latitude,longitude (with header)
120urs_order_filename = 'urs_order_' + model + '.csv'
121
122# Landward bounding points
123# Format easting,northing (no header)
124landward_boundary_filename = 'landward_boundary_' + model + '.csv'
125
126# MUX input filename.
127# If a meta-file from EventSelection is used, set 'multi-mux' to True.
128# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
129##mux_input_filename = event_number # to be found in event_folder
130                                    # (ie boundaries/event_number/)
131##multi_mux = False
132mux_input_filename = 'event.list'
133multi_mux = True
134
135# Specify if share cache is to be used
136# Whatever is specified here will be relative to INUNDATION_HOME/.cache
137# If nothing is specified, local cache will be used.
138cachedir = '.python_cache_phII'
139
140################################################################################
141################################################################################
142####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
143################################################################################
144################################################################################
145
146# Get system user and host names.
147# These values can be used to distinguish between two similar runs by two
148# different users or runs by the same user on two different machines.
149user = get_user_name()
150host = get_host_name()
151
152# Environment variable names.
153# The inundation directory, not the data directory.
154ENV_INUNDATIONHOME = 'INUNDATIONHOME'
155
156# Path to MUX data
157ENV_MUXHOME = 'MUXHOME'
158
159#-------------------------------------------------------------------------------
160# Output Elevation Data
161#-------------------------------------------------------------------------------
162
163# Output filename for elevation
164# this is a combination of all the data generated in build_elevation.py
165combined_elevation_basename = scenario_name + '_combined_elevation'
166
167#-------------------------------------------------------------------------------
168# Directory Structure
169#-------------------------------------------------------------------------------
170
171# determines time for setting up output directories
172time = strftime('%Y%m%d_%H%M%S', localtime()) 
173gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
174build_time = time + '_build'
175run_time = time + '_run_'
176
177# create paths generated from environment variables.
178home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
179muxhome = os.getenv(ENV_MUXHOME)
180
181# Create absolute pathname for cache directory
182# and change caching to use it
183if 'cachedir' in dir():
184    cachedir = join(os.getenv(ENV_INUNDATIONHOME), '.cache', cachedir)
185    from anuga.caching import caching
186    caching.set_option('cachedir', cachedir) 
187 
188# check various directories/files that must exist
189anuga_folder = join(home, state, scenario_folder, 'anuga')
190topographies_folder = join(anuga_folder, 'topographies')
191polygons_folder = join(anuga_folder, 'polygons')
192boundaries_folder = join(anuga_folder, 'boundaries')
193output_folder = join(anuga_folder, 'outputs')
194gauges_folder = join(anuga_folder, 'gauges')
195meshes_folder = join(anuga_folder, 'meshes')
196event_folder = join(boundaries_folder, str(event_number))
197
198# MUX data files
199# Directory containing the MUX data files to be used with EventSelection.
200mux_data_folder = join(muxhome, 'mux')
201
202#-------------------------------------------------------------------------------
203# Location of input and output data
204#-------------------------------------------------------------------------------
205
206# Convert the user output_comment to a string for run_model.py
207output_comment = ('_'.join([str(x) for x in output_comment if x != user])
208                  + '_' + user)
209
210# The absolute pathname of the all elevation, generated in build_elevation.py
211combined_elevation = join(topographies_folder, combined_elevation_basename)
212
213# The absolute pathname of the mesh, generated in run_model.py
214meshes = join(meshes_folder, scenario_name) + '.msh'
215
216# The pathname for the urs order points, used within build_urs_boundary.py
217urs_order = join(boundaries_folder, urs_order_filename)
218
219# The absolute pathname for the landward points of the bounding polygon,
220# Used within run_model.py)
221landward_boundary = join(boundaries_folder, landward_boundary_filename)
222
223# The absolute pathname for the .sts file, generated in build_boundary.py
224event_sts = join(event_folder, scenario_name)+ '_' +model
225
226# The absolute pathname for the output folder names
227# Used for build_elevation.py
228output_build = join(output_folder, build_time) + '_' + str(user) 
229# Used for run_model.py
230output_run = join(output_folder, run_time) + output_comment
231# Used by post processing
232output_run_time = join(output_run, scenario_name) 
233
234# The absolute pathname for the gauges file
235# Used for get_timeseries.py
236gauges = join(gauges_folder, gauges_filename)       
237
238# The absolute pathname for the building file
239# Used for run_building_inundation.py
240building_exposure = join(gauges_folder, building_exposure_filename)
241
242# full path to where MUX files (or meta-files) live
243mux_input = join(event_folder, mux_input_filename)
244
245boundary_csv = event_folder + sep + 'sts_gauge_' + str(index) +'.csv'
Note: See TracBrowser for help on using the repository browser.