source: anuga_work/production/australia_ph2/adelaide/project.py @ 6595

Last change on this file since 6595 was 6595, checked in by ole, 15 years ago

Added the nonstandard central meridian option, tested and implemented it in the Adeladie Phase II scripts.

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