source: anuga_work/production/australia_ph2/wyndham/project.py @ 6617

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

putting in the option for a internal polygon with same triangle area (to test discretisation issues) in project scripts.
adding required scripts for broome

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