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

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