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