source: anuga_work/production/geraldton/NewScripts/project.py @ 6374

Last change on this file since 6374 was 6374, checked in by nick2009, 16 years ago

Updated multimux false steps

File size: 9.4 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 = 'geraldton'
20scenario_folder = 'geraldton_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 = 0                # difference between MSL and HAT
29event_number = 'wa04_val'    # the event number
30alpha = 0.1             # smoothing parameter for mesh
31friction=0.01           # manning's friction coefficient
32starttime=0             # start time for simulation
33finaltime=1000         # final time for simulation
34
35setup = 'trial'         # This can be one of three values
36                        #    trial - coarsest mesh, fast
37                        #    basic - coarse mesh
38                        #    final - fine mesh, slowest
39
40#-------------------------------------------------------------------------------
41# Output filename
42#
43# Your output filename should be unique between different runs on different data.
44# The list of items below will be used to create a file in your output directory.
45# Your user name and time+date will be automatically added.  For example,
46#     [setup, tide, event_number]
47# will result in a filename like
48#     20090212_091046_run_final_0_27283_rwilson
49#-------------------------------------------------------------------------------
50
51output_comment = [setup, tide, event_number]
52
53#-------------------------------------------------------------------------------
54# Input Data
55#-------------------------------------------------------------------------------
56
57# ELEVATION DATA
58# Used in build_elevation.py
59# Format for ascii grids, as produced in ArcGIS + a projection file
60ascii_grid_filenames = ['landgate_dem_clip',   # Topo
61                        'dted_srtm_islands'] # Geraldton Island Topo
62
63# Format for point is x,y,elevation (with header)
64point_filenames = ['XYcoastline_KVP.txt',      # Coastline
65                   'DPI_Data.txt',             # DPI Bathymetry
66                   'Geraldton_bathymetry.txt', # Original Bathymetry
67                   'Top_bathymetry.txt',       # Top bathymetry
68                   'grid250.txt']              # Grid 250m
69
70# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
71# Used in build_elevation.py
72# Format for points easting,northing (no header)
73bounding_polygon_filename = 'poly_all.csv'
74bounding_polygon_maxarea = 100000
75
76# INTERIOR REGIONS -  for designing the mesh
77# Used in run_model.py
78# Format for points easting,northing (no header)                   
79interior_regions_data = [['CBD_500m.csv', 500],
80                         ['CBD_1km.csv', 800],
81                         ['island_wallabi_poly.csv', 5000],
82                         ['island_dingiville_poly.csv', 5000],
83                         ['island_pelsaert_poly.csv', 5000],
84                         ['neg20_pos20.csv', 25000]]
85
86# LAND - used to set the initial stage/water to be offcoast only
87# Used in run_model.py.  Format for points easting,northing (no header)
88land_initial_conditions_filename = [['land_initial_condition.csv', 0]]
89
90# GAUGES - for creating timeseries at a specific point
91# Used in get_timeseries.py. 
92# Format easting,northing,name,elevation (with header)
93gauges_filename = 'gauges.csv'
94
95# BUILDINGS EXPOSURE - for identifying inundated houses
96# Used in run_building_inundation.py
97# Format latitude,longitude etc (geographic)
98building_exposure_filename = 'geraldton_res_clip.csv' # from NEXIS
99
100# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
101# NOTE: when files are put together the points must be in sequence
102# For ease go clockwise!
103# Check the run_model.py for boundary_tags
104
105# Thinned ordering file from Hazard Map (geographic)
106# Format is index,latitude,longitude (with header)
107urs_order_filename = 'thinned_boundary_ordering.csv'
108
109# Landward bounding points
110# Format easting,northing (no header)
111landward_boundary_filename = 'landward_bounding_polygon.csv'
112
113# MUX input filename.
114# If a meta-file from EventSelection is used, set 'multi-mux' to True.
115# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
116mux_input_filename = event_number
117multi_mux = False
118##mux_input_filename = join(event_folder, 'event.list')
119##multi_mux = True
120
121#-------------------------------------------------------------------------------
122# Clipping regions for export to asc and regions for clipping data
123# Final inundation maps should only be created in regions of the finest mesh
124#-------------------------------------------------------------------------------
125
126# ASCII export grid for Busselton
127xminBusselton = 340000
128xmaxBusselton = 352000
129yminBusselton = 6271500
130ymaxBusselton = 6280000
131
132# ASCII export grid for Bunbury
133xminBunbury = 369000
134xmaxBunbury = 381000
135yminBunbury = 6308000
136ymaxBunbury = 6316500
137
138################################################################################
139################################################################################
140####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
141################################################################################
142################################################################################
143
144# Get system user and host names.
145# These values can be used to distinguish between two similar runs by two
146# different users or runs by the same user on two different machines.
147user = get_user_name()
148host = get_host_name()
149
150# Environment variable names.
151# The inundation directory, not the data directory.
152ENV_INUNDATIONHOME = 'INUNDATIONHOME'
153
154# Path to MUX data
155ENV_MUXHOME = 'MUXHOME'
156
157#-------------------------------------------------------------------------------
158# Output Elevation Data
159#-------------------------------------------------------------------------------
160
161# Output filename for elevation
162# this is a combination of all the data generated in build_elevation.py
163combined_elevation_basename = scenario_name + '_combined_elevation'
164
165#-------------------------------------------------------------------------------
166# Directory Structure
167#-------------------------------------------------------------------------------
168
169# determines time for setting up output directories
170time = strftime('%Y%m%d_%H%M%S', localtime()) 
171gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
172build_time = time + '_build'
173run_time = time + '_run_'
174
175# create paths generated from environment variables.
176home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
177muxhome = os.getenv(ENV_MUXHOME)
178   
179# check various directories/files that must exist
180anuga_folder = join(home, state, scenario_folder, 'anuga')
181topographies_folder = join(anuga_folder, 'topographies')
182polygons_folder = join(anuga_folder, 'polygons')
183boundaries_folder = join(anuga_folder, 'boundaries')
184output_folder = join(anuga_folder, 'outputs')
185gauges_folder = join(anuga_folder, 'gauges')
186meshes_folder = join(anuga_folder, 'meshes')
187event_folder = join(boundaries_folder, str(event_number))
188
189# MUX data files
190# Directory containing the MUX data files to be used with EventSelection.
191mux_data_folder = join(muxhome, 'mux')
192
193#-------------------------------------------------------------------------------
194# Location of input and output data
195#-------------------------------------------------------------------------------
196
197# Convert the user output_comment to a string for run_model.py
198output_comment = ('_'.join([str(x) for x in output_comment if x != user])
199                  + '_' + user)
200
201# The absolute pathname of the all elevation, generated in build_elevation.py
202combined_elevation = join(topographies_folder, combined_elevation_basename)
203
204# The absolute pathname of the mesh, generated in run_model.py
205meshes = join(meshes_folder, scenario_name) + '.msh'
206
207# The pathname for the urs order points, used within build_urs_boundary.py
208urs_order = join(boundaries_folder, urs_order_filename)
209
210# The absolute pathname for the landward points of the bounding polygon,
211# Used within run_model.py)
212landward_boundary = join(boundaries_folder, landward_boundary_filename)
213
214# The absolute pathname for the .sts file, generated in build_boundary.py
215event_sts = join(event_folder, scenario_name)
216
217# The absolute pathname for the output folder names
218# Used for build_elevation.py
219output_build = join(output_folder, build_time) + '_' + str(user) 
220# Used for run_model.py
221output_run = join(output_folder, run_time) + output_comment
222# Used by post processing
223output_run_time = join(output_run, scenario_name) 
224
225# The absolute pathname for the gauges file
226# Used for get_timeseries.py
227gauges = join(gauges_folder, gauges_filename)       
228
229# The absolute pathname for the building file
230# Used for run_building_inundation.py
231building_exposure = join(gauges_folder, building_exposure_filename)
232
233# full path to where MUX files (or meta-files) live
234mux_input = join(event_folder, mux_input_filename)
235
Note: See TracBrowser for help on using the repository browser.