source: anuga_work/production/australia_ph2/melbourne_east/single_urs/project.py @ 7023

Last change on this file since 7023 was 7023, checked in by myall, 15 years ago

exporting results;
making new folder in melbourne_east called single_urs, for scripts to run the model with both east and west boundaries from urs

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