source: anuga_work/production/australia_ph2/sydney/project.py @ 6511

Last change on this file since 6511 was 6511, checked in by jgriffin, 15 years ago

Fized default boundary in Field_boundary

File size: 8.7 KB
RevLine 
[6285]1"""
[6460]2This file contains all your file and directory definitions
3for elevation, meshes and outputs.
4"""
[6285]5
6import os
[6460]7from anuga.utilities.system_tools import get_user_name, get_host_name
[6285]8from time import localtime, strftime, gmtime
[6460]9from os.path import join, exists
10from os import sep
[6285]11
[6460]12
13#-------------------------------------------------------------------------------
[6285]14# Directory setup
[6460]15#-------------------------------------------------------------------------------
[6285]16
17# this section needs to be updated to reflect the modelled community.
18# Note, the user needs to set up the directory system accordingly
19state = 'australia_ph2'
20scenario_name = 'sydney'
[6460]21scenario_folder = scenario_name
[6285]22
[6460]23#-------------------------------------------------------------------------------
[6285]24# Initial Conditions
[6460]25#-------------------------------------------------------------------------------
26
27# Model specific parameters.
28# One or all can be changed each time the run_model script is executed
29tide = 0                # difference between MSL and HAT
[6511]30zone = 56              # specify zone of model
31event_number = 58222    # the event number or the mux file name
[6285]32alpha = 0.1             # smoothing parameter for mesh
33friction=0.01           # manning's friction coefficient
[6460]34starttime=0             # start time for simulation
35finaltime=80000          # final time for simulation
[6285]36
[6460]37# index is only used when wave = Tb
[6498]38index = 2956            # index from the PTHA
39wave = 'Bf'             # Bf (sts wave) Tb (index wave)
[6285]40
[6511]41setup = 'trial'         # This can be one of three values
[6460]42                        #    trial - coarsest mesh, fast
43                        #    basic - coarse mesh
44                        #    final - fine mesh, slowest
[6285]45
[6460]46#-------------------------------------------------------------------------------
47# Output filename
48#
49# Your output filename should be unique between different runs on different data.
50# The list of items below will be used to create a file in your output directory.
51# Your user name and time+date will be automatically added.  For example,
52#     [setup, tide, event_number]
53# will result in a filename like
54#     20090212_091046_run_final_0_27283_rwilson
55#-------------------------------------------------------------------------------
[6285]56
[6460]57output_comment = [setup, tide, event_number, index, wave]
[6285]58
[6460]59#-------------------------------------------------------------------------------
[6285]60# Input Data
[6460]61#-------------------------------------------------------------------------------
62
[6285]63# ELEVATION DATA
[6460]64# Used in build_elevation.py
[6285]65# Format for ascii grids, as produced in ArcGIS + a projection file
[6460]66ascii_grid_filenames = [] # 250m grid 2005
[6285]67
68# Format for point is x,y,elevation (with header)
69point_filenames = ['sydney_elevation.txt',
[6460]70                   'melbourne_elevation.txt'] # 250m grid 2005
[6285]71
[6460]72### Add csv header list to all files in point_filenames
73##headerlist = ['x', 'y', 'elevation']
74##for f in point_filenames:
75##    add_csv_header(join(topographies_folder, f), headerlist)
[6285]76
[6460]77    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
78# Used in build_elevation.py
79# Format for points easting,northing (no header)
80bounding_polygon_filename = 'bounding_polygon.csv'
81bounding_polygon_maxarea = 100000
82
83# INTERIOR REGIONS -  for designing the mesh
84# Used in run_model.py
85# Format for points easting,northing (no header)                   
86interior_regions_data = []
87
[6285]88# LAND - used to set the initial stage/water to be offcoast only
[6460]89# Used in run_model.py.  Format for points easting,northing (no header)
[6511]90land_initial_conditions_filename = []
[6285]91
[6460]92# GAUGES - for creating timeseries at a specific point
93# Used in get_timeseries.py. 
94# Format easting,northing,name,elevation (with header)
95gauges_filename = 'gauges.csv'
[6285]96
[6460]97# BUILDINGS EXPOSURE - for identifying inundated houses
98# Used in run_building_inundation.py
99# Format latitude,longitude etc (geographic)
[6511]100building_exposure_filename = 'sydney_res_clip.csv' # from NEXIS
[6285]101
[6460]102# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
[6285]103# NOTE: when files are put together the points must be in sequence
104# For ease go clockwise!
[6460]105# Check the run_model.py for boundary_tags
[6285]106
107# Thinned ordering file from Hazard Map (geographic)
108# Format is index,latitude,longitude (with header)
[6460]109urs_order_filename = 'urs_order.csv'
[6285]110
111# Landward bounding points
112# Format easting,northing (no header)
[6460]113landward_boundary_filename = 'landward_boundary.csv'
[6285]114
[6460]115# MUX input filename.
116# If a meta-file from EventSelection is used, set 'multi-mux' to True.
117# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
118##mux_input_filename = event_number # to be found in event_folder
119                                    # (ie boundaries/event_number/)
120##multi_mux = False
121mux_input_filename = 'event.list'
122multi_mux = True
[6285]123
124
[6298]125
126
[6460]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#-------------------------------------------------------------------------------
[6285]147# Output Elevation Data
[6460]148#-------------------------------------------------------------------------------
149
[6285]150# Output filename for elevation
[6460]151# this is a combination of all the data generated in build_elevation.py
[6285]152combined_elevation_basename = scenario_name + '_combined_elevation'
153
[6460]154#-------------------------------------------------------------------------------
[6285]155# Directory Structure
[6460]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
[6285]169anuga_folder = join(home, state, scenario_folder, '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')
[6460]174gauges_folder = join(anuga_folder, 'gauges')
[6285]175meshes_folder = join(anuga_folder, 'meshes')
[6460]176event_folder = join(boundaries_folder, str(event_number))
[6285]177
[6460]178# MUX data files
179# Directory containing the MUX data files to be used with EventSelection.
180mux_data_folder = join(muxhome, 'mux')
181
182#-------------------------------------------------------------------------------
[6285]183# Location of input and output data
[6460]184#-------------------------------------------------------------------------------
[6285]185
[6460]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
[6285]191combined_elevation = join(topographies_folder, combined_elevation_basename)
192
[6460]193# The absolute pathname of the mesh, generated in run_model.py
194meshes = join(meshes_folder, scenario_name) + '.msh'
[6285]195
[6460]196# The pathname for the urs order points, used within build_urs_boundary.py
[6285]197urs_order = join(boundaries_folder, urs_order_filename)
198
199# The absolute pathname for the landward points of the bounding polygon,
[6460]200# Used within run_model.py)
[6285]201landward_boundary = join(boundaries_folder, landward_boundary_filename)
202
203# The absolute pathname for the .sts file, generated in build_boundary.py
[6460]204event_sts = join(event_folder, scenario_name)
[6285]205
206# The absolute pathname for the output folder names
[6460]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
[6285]211# Used by post processing
212output_run_time = join(output_run, scenario_name) 
213
[6460]214# The absolute pathname for the gauges file
215# Used for get_timeseries.py
216gauges = join(gauges_folder, gauges_filename)       
[6285]217
[6460]218# The absolute pathname for the building file
219# Used for run_building_inundation.py
220building_exposure = join(gauges_folder, building_exposure_filename)
[6285]221
[6460]222# full path to where MUX files (or meta-files) live
223mux_input = join(event_folder, mux_input_filename)
[6285]224
[6460]225boundary_csv = event_folder + sep + 'sts_gauge_' + str(index) +'.csv'
Note: See TracBrowser for help on using the repository browser.