source: anuga_work/production/australia_ph2/broome/project.py @ 6672

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

running and exporting scripts

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