source: anuga_work/production/australia_ph2/ceduna/project.py @ 6726

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

update event list

File size: 9.7 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 = 'ceduna'
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
29##zone = 53               # specify zone of model
30central_meridian = 133.0 # nonstandard projection
31
32import sys
33if len(sys.argv) > 1:
34    event_number = int(sys.argv[1])
35else:   
36    event_number = 27347    # the event number or the mux file name
37
38event_number_list = [27347, 64448, 58331] # To piggy back multiple events
39                                          # using run_multiple_events.py
40# ceduna: 27347 (Java), 64448 (sandwich), 58331 (Puysegur)
41# other possible sources:
42# 7877 (altiplano, south america),  46503 (mid america),
43# 57483 (peru), 65304 (shetland), 68792 (sumatra)
44
45alpha = 0.1             # smoothing parameter for mesh
46friction=0.01           # manning's friction coefficient
47starttime=0             # start time for simulation
48finaltime=1000          # final time for simulation
49
50# index is only used when wave = Tb
51index = 1889            # index from the PTHA
52wave = 'Bf'             # Bf (sts wave) Tb (index wave)
53
54setup = 'trial'         # This can be one of three values
55                        #    trial - coarsest mesh, fast
56                        #    basic - coarse mesh
57                        #    final - fine mesh, slowest
58
59internal_polygon = False
60
61#-------------------------------------------------------------------------------
62# Output filename
63#
64# Your output filename should be unique between different runs on different data.
65# The list of items below will be used to create a file in your output directory.
66# Your user name and time+date will be automatically added.  For example,
67#     [setup, tide, event_number]
68# will result in a filename like
69#     20090212_091046_run_final_0_27283_rwilson
70#-------------------------------------------------------------------------------
71
72if internal_polygon:
73    internal_poly_comment = 'internal'
74else:
75    internal_poly_comment = None
76
77output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
78
79#-------------------------------------------------------------------------------
80# Input Data
81#-------------------------------------------------------------------------------
82
83# ELEVATION DATA
84# Used in build_elevation.py
85# Format for ascii grids, as produced in ArcGIS + a projection file
86ascii_grid_filenames = [] # 250m grid 2005
87
88# Format for point is x,y,elevation (with header)
89point_filenames = ['grid_250m.txt'] # 250m grid 2005
90
91### Add csv header list to all files in point_filenames
92##headerlist = ['x', 'y', 'elevation']
93##for f in point_filenames:
94##    add_csv_header(join(topographies_folder, f), headerlist)
95
96    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
97# Used in build_elevation.py
98# Format for points easting,northing (no header)
99bounding_polygon_filename = 'bounding_polygon.csv'
100bounding_polygon_maxarea = 100000
101
102# INTERIOR REGIONS -  for designing the mesh
103# Used in run_model.py
104# Format for points easting,northing (no header)                   
105interior_regions_data = []
106
107# add an internal polygon to force different mesh generation
108# used to test for discretisation error when building elevation
109# make sure file is in same folder as interior regions and bouding polygon;
110# format is same (2 column .csv; easting, northing; no header)
111if internal_polygon:
112    interior_regions_data.append(['internal_polygon.csv',
113                                  bounding_polygon_maxarea])
114
115# LAND - used to set the initial stage/water to be offcoast only
116# Used in run_model.py.  Format for points easting,northing (no header)
117land_initial_conditions_filename = []
118
119# GAUGES - for creating timeseries at a specific point
120# Used in get_timeseries.py. 
121# Format easting,northing,name,elevation (with header)
122gauges_filename = 'gauges.csv'
123
124# BUILDINGS EXPOSURE - for identifying inundated houses
125# Used in run_building_inundation.py
126# Format latitude,longitude etc (geographic)
127building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
128
129# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
130# NOTE: when files are put together the points must be in sequence
131# For ease go clockwise!
132# Check the run_model.py for boundary_tags
133
134# Thinned ordering file from Hazard Map (geographic)
135# Format is index,latitude,longitude (with header)
136urs_order_filename = 'urs_order.csv'
137
138# Landward bounding points
139# Format easting,northing (no header)
140landward_boundary_filename = 'landward_boundary.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 = event_number # to be found in event_folder
146                                    # (ie boundaries/event_number/)
147##multi_mux = False
148mux_input_filename = 'event.list'
149multi_mux = True
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# check various directories/files that must exist
194anuga_folder = join(home, state, scenario_folder, 'anuga')
195topographies_folder = join(anuga_folder, 'topographies')
196polygons_folder = join(anuga_folder, 'polygons')
197boundaries_folder = join(anuga_folder, 'boundaries')
198output_folder = join(anuga_folder, 'outputs')
199gauges_folder = join(anuga_folder, 'gauges')
200meshes_folder = join(anuga_folder, 'meshes')
201event_folder = join(boundaries_folder, str(event_number))
202
203# MUX data files
204# Directory containing the MUX data files to be used with EventSelection.
205mux_data_folder = join(muxhome, 'mux')
206
207#-------------------------------------------------------------------------------
208# Location of input and output data
209#-------------------------------------------------------------------------------
210
211# Convert the user output_comment to a string for run_model.py
212output_comment = ('_'.join([str(x) for x in output_comment if x != user])
213                  + '_' + user)
214
215# The absolute pathname of the all elevation, generated in build_elevation.py
216combined_elevation = join(topographies_folder, combined_elevation_basename)
217
218# The absolute pathname of the mesh, generated in run_model.py
219meshes = join(meshes_folder, scenario_name) + '.msh'
220
221# The pathname for the urs order points, used within build_urs_boundary.py
222urs_order = join(boundaries_folder, urs_order_filename)
223
224# The absolute pathname for the landward points of the bounding polygon,
225# Used within run_model.py)
226landward_boundary = join(boundaries_folder, landward_boundary_filename)
227
228# The absolute pathname for the .sts file, generated in build_boundary.py
229event_sts = join(event_folder, scenario_name)
230
231
232
233# The absolute pathname for the output folder names
234# Used for build_elevation.py
235output_build = join(output_folder, build_time) + '_' + str(user) 
236# Used for run_model.py
237output_run = join(output_folder, run_time) + output_comment
238# Used by post processing
239output_run_time = join(output_run, scenario_name) 
240
241# The absolute pathname for the gauges file
242# Used for get_timeseries.py
243gauges = join(gauges_folder, gauges_filename)       
244
245# The absolute pathname for the building file
246# Used for run_building_inundation.py
247building_exposure = join(gauges_folder, building_exposure_filename)
248
249# full path to where MUX files (or meta-files) live
250mux_input = join(event_folder, mux_input_filename)
251
252# sts gauge with desired index number - used for wave 'Tb'
253boundary_csv = join(event_folder, 'sts_gauge_' + str(index) + '.csv')
254
255
Note: See TracBrowser for help on using the repository browser.