source: DVD_images/extra_files/Hobart/project/project.py @ 7463

Last change on this file since 7463 was 7333, checked in by kristy, 16 years ago

to reflect scripts in sandpit

  • Property svn:executable set to *
File size: 8.4 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# Directory setup
13#-------------------------------------------------------------------------------
14
15# this section needs to be updated to reflect the modelled community.
16# Note, the user needs to set up the directory system accordingly
17state = 'tasmania'
18scenario_name = 'hobart'
19scenario_folder = 'hobart_tsunami_scenario_2009'
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
27tide = 0                # difference between MSL and HAT in metres
28                        # Highest Astronomical Tide = 0.8 m for Hobart
29zone = 55               # specify UTM zone of model
30event_number = 58260    # 58280, 64477 the event number - See event_chosen.xls
31                        # in anuga/boundaries for more details
32alpha = 0.1             # smoothing parameter for mesh
33friction=0.01           # manning's friction coefficient
34starttime=0             # start time for simulation
35finaltime=65000         # final time for simulation
36
37setup = 'final'         # This can be one of three values
38                        #    trial - coarsest mesh, fast
39                        #    basic - coarse mesh
40                        #    final - fine mesh, slowest
41
42#-------------------------------------------------------------------------------
43# Output filename
44#
45# Your output filename should be unique between different runs on different data.
46# The list of items below will be used to create a file in your output directory.
47# Your user name and time+date will be automatically added.  For example,
48#     [setup, tide, event_number]
49# will result in a filename like
50#     20090212_091046_run_final_0_27283_rwilson
51#-------------------------------------------------------------------------------
52
53output_comment = [setup, tide, event_number]
54
55#-------------------------------------------------------------------------------
56# Input Data
57#-------------------------------------------------------------------------------
58
59# ELEVATION DATA
60# Used in build_elevation.py
61ascii_grid_filenames = []
62## Add csv header list to all files in point_filenames
63##headerlist = ['x', 'y', 'elevation']
64point_filenames = []
65
66
67# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
68# Used in build_elevation.py
69# Format for points easting,northing (no header)
70bounding_polygon_filename = 'bounding_polygon.csv'
71bounding_polygon_maxarea = 1000000
72
73# INTERIOR REGIONS -  for designing the mesh
74# Used in run_model.py
75# Format for points easting,northing (no header)                   
76interior_regions_data = [['aos1.csv', 1500],
77                         ['aos2.csv', 1500],
78                         ['sw.csv', 30000]]
79PriorityArea_filename = 'PriorityAreas.csv'
80   
81# LAND - used to set the initial stage/water to be offcoast only
82# Used in run_model.py.  Format for points easting,northing (no header)
83land_initial_conditions_filename = 'initial_conditions.csv'
84
85# FINAL BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
86# NOTE: when files are put together the points must be in sequence
87# For ease go clockwise!
88# Check the run_model.py for boundary_tags
89
90# Thinned ordering file from Hazard Map (geographic)
91# Format is index,latitude,longitude (with header)
92urs_order_filename = 'urs_order.csv'
93
94# Landward bounding points
95# Format easting,northing (no header)
96landward_boundary_filename = 'landward_boundary.csv'
97
98# GAUGES - for creating timeseries at a specific point
99# Used in get_timeseries.py. 
100# Format easting,northing,name,elevation (with header)
101gauges_filename = 'time_of_arrival_all.csv' #'TideGaugesPoints.csv'
102                                            #'tsunamipointsMGA.csv'
103
104#-------------------------------------------------------------------------------
105# Clipping regions for export to asc and regions for clipping data
106# Final inundation maps should only be created in regions of the finest mesh
107#-------------------------------------------------------------------------------
108
109# ASCII export grid for Hobart Communities
110xminHobart = 520000
111xmaxHobart = 545000
112yminHobart = 5230000
113ymaxHobart = 5260000
114
115# ASCII export grid for North West Communities
116xminNW = 548000
117xmaxNW = 561000
118yminNW = 5250000
119ymaxNW = 5258000
120
121# ASCII export grid for South Communities
122xminSouth = 523000
123xmaxSouth = 533300
124yminSouth = 5197000
125ymaxSouth = 5214000
126
127
128################################################################################
129################################################################################
130####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
131################################################################################
132################################################################################
133
134# Get system user and host names.
135# These values can be used to distinguish between two similar runs by two
136# different users or runs by the same user on two different machines.
137user = get_user_name()
138host = get_host_name()
139
140# Environment variable names.
141# The inundation directory, not the data directory.
142ENV_INUNDATIONHOME = 'ANUGADATA'
143
144#-------------------------------------------------------------------------------
145# Output Elevation Data
146#-------------------------------------------------------------------------------
147
148# Output filename for elevation
149# this is a combination of all the data generated in build_elevation.py
150combined_elevation_basename = scenario_name + '_combined_elevation'
151
152#-------------------------------------------------------------------------------
153# Directory Structure
154#-------------------------------------------------------------------------------
155
156# determines time for setting up output directories
157time = strftime('%Y%m%d_%H%M%S', localtime()) 
158gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
159build_time = time + '_build'
160run_time = time + '_run_'
161
162# create paths generated from environment variables.
163home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
164   
165# check various directories/files that must exist
166anuga_folder = join(home, state, scenario_folder, 'anuga')
167topographies_folder = join(anuga_folder, 'topographies')
168polygons_folder = join(anuga_folder, 'polygons')
169boundaries_folder = join(anuga_folder, 'boundaries')
170output_folder = join(anuga_folder, 'outputs')
171gauges_folder = join(anuga_folder, 'gauges')
172event_folder = join(boundaries_folder, str(event_number))
173
174#-------------------------------------------------------------------------------
175# Location of input and output data
176#-------------------------------------------------------------------------------
177
178# Convert the user output_comment to a string for run_model.py
179output_comment = ('_'.join([str(x) for x in output_comment if x != user])
180                  + '_' + user)
181
182# The absolute pathname of the all elevation, generated in build_elevation.py
183combined_elevation = join(topographies_folder, combined_elevation_basename)
184
185# The pathname for the urs order points, used within build_urs_boundary.py
186if urs_order_filename:
187    urs_order = join(boundaries_folder, urs_order_filename)
188
189# The absolute pathname for the landward points of the bounding polygon,
190# Used within run_model.py)
191if landward_boundary_filename:
192    landward_boundary = join(boundaries_folder, landward_boundary_filename)
193
194# The absolute pathname for the .sts file, generated in build_boundary.py
195event_sts = join(event_folder, scenario_name)
196
197# The absolute pathname for the output folder names
198# Used for build_elevation.py
199output_build = join(output_folder, build_time) + '_' + str(user) 
200# Used for run_model.py
201output_run = join(output_folder, run_time) + output_comment
202# Used by post processing
203output_run_time = join(output_run, scenario_name) 
204
205# The absolute pathname of the mesh, generated in run_model.py
206meshes = join(output_run, scenario_name) + '.msh'
207
208# The absolute pathname for the gauges file
209# Used for get_timeseries.py
210if gauges_filename:
211    gauges = join(gauges_folder, gauges_filename)       
212
213#Multiple polygons in one CSV file to make internal polygons
214PriorityAreas = join(polygons_folder, PriorityArea_filename)
215
216
Note: See TracBrowser for help on using the repository browser.