source: DVD_images/extra_files/GoldCoast/project/project.py @ 7256

Last change on this file since 7256 was 7205, checked in by rwilson, 15 years ago

Commit the DVD image generation stuff. This will be archived later.

  • Property svn:executable set to *
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 = 'queensland'
19scenario_name = 'gold_coast'
20scenario_folder = 'gold_coast_tsunami_scenario_2009'
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
28
29               # difference between MSL and HAT in metres
30central_meridian = None # Central meridian for projection (optional)
31zone = 56
32import sys
33if len(sys.argv) > 1:
34    event_number = int(sys.argv[1])
35else:   
36    event_number = 51469    # the event number or the mux file name
37
38event_number_list = [51469, 50863, 51392] # To piggy back multiple events
39
40tide = 0
41alpha = 0.1             # smoothing parameter for mesh
42friction=0.01           # manning's friction coefficient
43starttime=0             # start time for simulation
44finaltime=80000         # final time for simulation
45
46setup = 'final'         # This can be one of three values
47                        #    trial - coarsest mesh, fast
48                        #    basic - coarse mesh
49                        #    final - fine mesh, slowest
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
62output_comment = [setup, tide, '250m', event_number]
63
64#-------------------------------------------------------------------------------
65# Input Datayieldstep
66#-------------------------------------------------------------------------------
67
68# ELEVATION DATA
69# Used in build_elevation.py
70# Format for ascii grids, as produced in ArcGIS + a projection file
71ascii_grid_filenames = ['grid250m_all_pro'] # 2005 250m grid
72##                      ['GC_DTM_30m']] # supplied DEM
73
74# Format for point is x,y,elevation (with header)
75point_filenames = []
76
77### Add csv header list to all files in point_filenames
78##headerlist = ['x', 'y', 'elevation']
79##for f in point_filenames:
80##    add_csv_header(join(topographies_folder, f), headerlist)
81
82# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
83# Used in build_elevation.py
84# Format for points easting,northing (no header)
85bounding_polygon_filename = 'bounding_polygon_sml.csv'
86bounding_polygon_maxarea = 125000
87
88# INTERIOR REGIONS -  for designing the mesh
89# Used in run_model.py
90# Format for points easting,northing (no header)                   
91interior_regions_data = []
92
93# LAND - used to set the initial stage/water to be offcoast only
94# Used in run_model.py.  Format for points easting,northing (no header)
95land_initial_conditions_filename = [['initial_conditions_sml.csv', 0]]
96
97# GAUGES - for creating timeseries at a specific point
98# Used in get_timeseries.py. 
99# Format easting,northing,name,elevation (with header)
100gauges_filename = 'gauges.csv'
101
102# BUILDINGS EXPOSURE - for identifying inundated houses
103# Used in run_building_inundation.py
104# Format latitude,longitude etc (geographic)
105building_exposure_filename = 'gold_coast_res_clip.csv' # from NEXIS
106
107# AREA OF IMAGES - Extent of each image to find out highest runup
108# Headerr: easting, northing, id, value
109# Used in get_runup.py
110images_filename = 'images.csv'
111
112# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
113# NOTE: when files are put together the points must be in sequence
114# For ease go clockwise!
115# Check the run_model.py for boundary_tags
116
117
118# Thinned ordering file from Hazard Map (geographic)
119# Format is index,latitude,longitude (with header)
120urs_order_filename = 'urs_order_sml.csv'
121
122# Landward bounding points
123# Format easting,northing (no header)
124landward_boundary_filename = 'landward_boundary_sml.csv'
125
126# MUX input filename.
127# If a meta-file from EventSelection is used, set 'multi-mux' to True.
128# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
129##mux_input_filename = event_number # to be found in event_folder
130                                    # (ie boundaries/event_number/)
131##multi_mux = False
132mux_input_filename = 'event.list'
133multi_mux = True
134
135#-------------------------------------------------------------------------------
136# Clipping regions for export to asc and regions for clipping data
137# Final inundation maps should only be created in regions of the finest mesh
138#-------------------------------------------------------------------------------
139
140# ASCII export grid for Gold Coast
141xminGold_Coast = 541500
142xmaxGold_Coast = 546000
143yminGold_Coast = 6893500
144ymaxGold_Coast = 6898500
145
146# ASCII export grid for dune study
147xminDune = 536710
148xmaxDune = 556150
149yminDune = 6881125
150ymaxDune = 6926860
151
152################################################################################
153################################################################################
154####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
155################################################################################
156################################################################################
157
158# Get system user and host names.
159# These values can be used to distinguish between two similar runs by two
160# different users or runs by the same user on two different machines.
161user = get_user_name()
162host = get_host_name()
163
164# Environment variable names.
165# The inundation directory, not the data directory.
166ENV_INUNDATIONHOME = 'ANUGADATA'
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_250m'
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
188   
189# check various directories/files that must exist
190anuga_folder = join(home, state, scenario_folder, 'anuga')
191topographies_folder = join(anuga_folder, 'topographies')
192polygons_folder = join(anuga_folder, 'polygons')
193boundaries_folder = join(anuga_folder, 'boundaries')
194output_folder = join(anuga_folder, 'outputs')
195gauges_folder = join(anuga_folder, 'gauges')
196event_folder = join(boundaries_folder, str(event_number))
197
198#-------------------------------------------------------------------------------
199# Location of input and output data
200#-------------------------------------------------------------------------------
201
202# Convert the user output_comment to a string for run_model.py
203output_comment = ('_'.join([str(x) for x in output_comment if x != user])
204                  + '_' + user)
205
206# The absolute pathname of the all elevation, generated in build_elevation.py
207combined_elevation = join(topographies_folder, combined_elevation_basename)
208
209
210# The pathname for the urs order points, used within build_urs_boundary.py
211if urs_order_filename:
212    urs_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)
216if landward_boundary_filename:
217    landward_boundary = join(boundaries_folder, landward_boundary_filename)
218
219# The absolute pathname for the .sts file, generated in build_boundary.py
220event_sts = join(event_folder, scenario_name)
221
222# The absolute pathname for the output folder names
223# Used for build_elevation.py
224output_build = join(output_folder, build_time) + '_' + str(user) 
225# Used for run_model.py
226output_run = join(output_folder, run_time) + output_comment
227# Used by post processing
228output_run_time = join(output_run, scenario_name) 
229
230# The absolute pathname of the mesh, generated in run_model.py
231meshes = join(output_run, scenario_name) + '.msh'
232
233# The absolute pathname for the gauges file
234# Used for get_timeseries.py
235if gauges_filename:
236    gauges = join(gauges_folder, gauges_filename)       
237
238# The absolute pathname for the building file
239# Used for run_building_inundation.py
240if building_exposure_filename:
241    building_exposure = join(gauges_folder, building_exposure_filename)
242
243# The absolute pathname for the image file
244# Used for get_runup.py
245if images_filename:
246    images = join(polygons_folder, images_filename)
247
248# full path to where MUX files (or meta-files) live
249mux_input = join(event_folder, mux_input_filename)
250
Note: See TracBrowser for help on using the repository browser.