source: anuga_work/production/australia_ph2/albany/project.py @ 6579

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

putting events in for all models, and changing run_model.py to use Bt instead of Bd on the side boundaries

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