source: anuga_work/production/wa/carnarvon/carnarvon_rerun/project.py @ 7411

Last change on this file since 7411 was 6762, checked in by kristy, 16 years ago

To run Nick urs model

File size: 9.6 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 = 'western_australia'
19scenario_name = 'carnarvon'
20scenario_folder = 'carnarvon_tsunami_scenario'
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 = 1                # difference between MSL and HAT in metres
29zone = 49               # specify zone of model
30#event_number = 27255    # the event number or the mux file name
31event_number = 'wa04_val'
32alpha = 0.1             # smoothing parameter for mesh
33friction=0.01           # manning's friction coefficient
34starttime=0             # start time for simulation
35finaltime=80000         # 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, 'Bt', 'yieldstep_5']
54
55#-------------------------------------------------------------------------------
56# Input Data
57#-------------------------------------------------------------------------------
58
59# ELEVATION DATA
60# Used in build_elevation.py
61# Format for ascii grids, as produced in ArcGIS + a projection file
62ascii_grid_filenames = ['dem_onshore',   #
63                        'topo_20m_aoi',
64                        'topo_50m_aos'] #
65
66# Format for point is x,y,elevation (with header)
67point_filenames = ['carnarvon_data.txt',    #
68                   'makeup.txt']            #
69
70extent_polygon_filenames = ['extract_aos.csv',
71                            'Carnarvon5m.csv']
72
73### Add csv header list to all files in point_filenames
74##headerlist = ['x', 'y', 'elevation']
75##for f in point_filenames:
76##    add_csv_header(join(topographies_folder, f), headerlist)
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 = 'poly_all.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 = [['Carnarvon5m.csv', 500],
88                         ['Carnarvon10m.csv', 1500],
89                         ['Carnarvon20m.csv', 25000],
90                         ['Island20m.csv', 50000]]
91
92# LAND - used to set the initial stage/water to be offcoast only
93# Used in run_model.py.  Format for points easting,northing (no header)
94land_initial_conditions_filename = [['land_initial_condition.csv', 0],
95                                    ['land_initial_condition_bernier.csv', 0],
96                                    ['land_initial_condition_dorne.csv', 0]]
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 = 'MH_gauges.csv' #'carnarvon.csv'
102gauges_filename2 = 'thinned_MGA50.csv'
103
104
105# BUILDINGS EXPOSURE - for identifying inundated houses
106# Used in run_building_inundation.py
107# Format latitude,longitude etc (geographic)
108building_exposure_filename = 'carnarvon_res.csv' # from NEXIS
109
110# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
111# NOTE: when files are put together the points must be in sequence
112# For ease go clockwise!
113# Check the run_model.py for boundary_tags
114
115# Thinned ordering file from Hazard Map (geographic)
116# Format is index,latitude,longitude (with header)
117urs_order_filename = 'thinned_boundary_ordering.csv'
118
119# Landward bounding points
120# Format easting,northing (no header)
121landward_boundary_filename = 'landward_bounding_polygon.csv'
122
123# MUX input filename.
124# If a meta-file from EventSelection is used, set 'multi-mux' to True.
125# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
126mux_input_filename = event_number # to be found in event_folder
127                                    # (ie boundaries/event_number/)
128multi_mux = False
129##mux_input_filename = 'event.list'
130##multi_mux = True
131
132#-------------------------------------------------------------------------------
133# Clipping regions for export to asc and regions for clipping data
134# Final inundation maps should only be created in regions of the finest mesh
135#-------------------------------------------------------------------------------
136
137# carnarvon CBD extract ascii grid
138xminCBD = 763000
139xmaxCBD = 775000
140yminCBD = 7239000
141ymaxCBD = 7251000
142
143################################################################################
144################################################################################
145####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
146################################################################################
147################################################################################
148
149# Get system user and host names.
150# These values can be used to distinguish between two similar runs by two
151# different users or runs by the same user on two different machines.
152user = get_user_name()
153host = get_host_name()
154
155# Environment variable names.
156# The inundation directory, not the data directory.
157ENV_INUNDATIONHOME = 'INUNDATIONHOME'
158
159# Path to MUX data
160ENV_MUXHOME = 'MUXHOME'
161
162#-------------------------------------------------------------------------------
163# Output Elevation Data
164#-------------------------------------------------------------------------------
165
166# Output filename for elevation
167# this is a combination of all the data generated in build_elevation.py
168combined_elevation_basename = scenario_name + '_combined_elevation'
169
170#-------------------------------------------------------------------------------
171# Directory Structure
172#-------------------------------------------------------------------------------
173
174# determines time for setting up output directories
175time = strftime('%Y%m%d_%H%M%S', localtime()) 
176gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
177build_time = time + '_build'
178run_time = time + '_run_'
179
180# create paths generated from environment variables.
181home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
182muxhome = os.getenv(ENV_MUXHOME)
183   
184# check various directories/files that must exist
185anuga_folder = join(home, state, scenario_folder, 'anuga')
186topographies_folder = join(anuga_folder, 'topographies')
187polygons_folder = join(anuga_folder, 'polygons')
188boundaries_folder = join(anuga_folder, 'boundaries')
189output_folder = join(anuga_folder, 'outputs')
190gauges_folder = join(anuga_folder, 'gauges')
191event_folder = join(boundaries_folder, str(event_number))
192
193# MUX data files
194# Directory containing the MUX data files to be used with EventSelection.
195mux_data_folder = join(muxhome, 'mux')
196
197#-------------------------------------------------------------------------------
198# Location of input and output data
199#-------------------------------------------------------------------------------
200
201# Convert the user output_comment to a string for run_model.py
202output_comment = ('_'.join([str(x) for x in output_comment if x != user])
203                  + '_' + user)
204
205# The absolute pathname of the all elevation, generated in build_elevation.py
206combined_elevation = join(topographies_folder, combined_elevation_basename)
207
208# The pathname for the urs order points, used within build_urs_boundary.py
209if urs_order_filename:
210    urs_order = join(boundaries_folder, urs_order_filename)
211
212# The absolute pathname for the landward points of the bounding polygon,
213# Used within run_model.py)
214if landward_boundary_filename:
215    landward_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 of the mesh, generated in run_model.py
229meshes = join(output_run, scenario_name) + '.msh'
230
231# The absolute pathname for the gauges file
232# Used for get_timeseries.py
233if gauges_filename:
234    gauges = join(gauges_folder, gauges_filename)       
235
236# The absolute pathname for the building file
237# Used for run_building_inundation.py
238if building_exposure_filename:
239    building_exposure = join(gauges_folder, building_exposure_filename)
240
241# full path to where MUX files (or meta-files) live
242mux_input = join(event_folder, mux_input_filename)
243
Note: See TracBrowser for help on using the repository browser.