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

Last change on this file since 6971 was 6864, checked in by myall, 16 years ago

running with internal polygons

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