source: anuga_work/production/australia_ph2/strahan/project.py @ 6674

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

running and exporting scripts

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