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

Last change on this file since 6382 was 6382, checked in by kristy, 15 years ago

working new script

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