source: anuga_work/production/australia_ph2/wyndham/project.py @ 6939

Last change on this file since 6939 was 6926, checked in by myall, 16 years ago

exporting max stage for runs with internal polygons, and exporting elevation using export_results.py for this run, and the equivalent normal run

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