source: anuga_work/production/australia_ph2/adelaide/project.py @ 6387

Last change on this file since 6387 was 6387, checked in by Leharne, 14 years ago

Adelaide area model for Ph2 hazard map

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