source: anuga_work/production/australia_ph2/melbourne/project.py @ 6793

Last change on this file since 6793 was 6692, checked in by myall, 16 years ago

adding melbourne phase 2

running get timeseries for latest WA models

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