source: DVD_images/extra_files/BatemansBay/project/project.py @ 7205

Last change on this file since 7205 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: 10.8 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 = 'new_south_wales'
19scenario_name = 'batemans_bay'
20scenario_folder = 'batemans_bay_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
28tide = 0.0                # difference between MSL and HAT (1.0)
29
30# the event number or the mux file name
31##event_number = 58129  #1 in 200 yr Puyesgur
32##event_number = 58115    #1 in 500 yr Puysegur
33##event_number = 58226    #1 in 1000 yr Puysegur
34##event_number = 58284    #1 in 2000 yr Puysegur
35##event_number = 58286    #1 in 5000 yr Puysegur
36##event_number = 58346      #1 in 10000 yr Puysegur
37
38##event_number = 51077  #1 in 200 yr New Hebrides
39##event_number = 51378    #1 in 500 yr New Hebrides
40##event_number = 51347    #1 in 1000 yr New Hebrides
41##event_number = 51292    #1 in 2000 yr New Hebrides
42event_number = 51424    #1 in 5000 yr New Hebrides
43##event_number = 51204     #1 in 10000 yr New Hebrides
44
45######event_number = 58368    #1 in 100 000 yr Puysegur!!!
46######event_number = 51436    #1 in 100 000 yr New Hebrides!!!
47######event_number = 58272      #1 in 10000 yr Puysegur????
48######event_number = 51445     #1 in 10000 yr New Hebrides????
49
50alpha = 0.1             # smoothing parameter for mesh
51friction=0.01           # manning's friction coefficient
52starttime=0             # start time for simulation
53finaltime=60000         # final time for simulation
54
55setup = 'final'         # This can be one of three values
56                        #    trial - coarsest mesh, fast
57                        #    basic - coarse mesh
58                        #    final - fine mesh, slowest
59
60#-------------------------------------------------------------------------------
61# Output filename
62#
63# Your output filename should be unique between different runs on different data.
64# The list of items below will be used to create a file in your output directory.
65# Your user name and time+date will be automatically added.  For example,
66#     [setup, tide, event_number]
67# will result in a filename like
68#     20090212_091046_run_final_0_27283_rwilson
69#-------------------------------------------------------------------------------
70
71output_comment = [setup, tide, event_number]
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 = ['1a',# Topographic data
81                        '1b',
82                        '2b',
83                        '2a_3',
84                        '3b',
85                        '3a',
86                        '4a_2',
87                        '4b',
88                        'off1',
89                        'off2',
90                        'off3',
91                        'bbhd',
92                        'sd100031996_p',
93                        'sd100031996_p2',
94                        'sd100031996_p3',
95                        'sd100031996_p4']
96                   
97# Format for point is x,y,elevation (with header)
98point_filenames = ['SD100031996_jgriffin_clip.csv',
99                   'tomaga_offshore_AHD_MGA_1997.csv',
100                   'Batemans_BBHD_MGA_1995.csv',
101                   'moruya_AHD_MGA_2000.csv']
102         
103
104### Add csv header list to all files in point_filenames
105##headerlist = ['x', 'y', 'elevation']
106##for f in point_filenames:
107##    add_csv_header(join(topographies_folder, f), headerlist)
108
109    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
110# Used in build_elevation.py
111# Format for points easting,northing (no header)
112bounding_polygon_filename = 'bounding_polygon.csv'
113bounding_polygon_maxarea = 100000
114
115# INTERIOR REGIONS -  for designing the mesh
116# Used in run_model.py
117# Format for points easting,northing (no header)
118
119interior_regions_data = [['area_of_interest.csv', 500],
120                        ['area_of_significance.csv', 2500],
121                        ['shallow_water.csv', 10000]]
122
123
124# LAND - used to set the initial stage/water to be offcoast only
125# Used in run_model.py.  Format for points easting,northing (no header)
126land_initial_conditions_filename = [['initial_conditions.csv', 0]]
127                                 
128
129# GAUGES - for creating timeseries at a specific point
130# Used in get_timeseries.py. 
131# Format easting,northing,name,elevation (with header)
132gauges_filename = 'gauges.csv'
133
134# BUILDINGS EXPOSURE - for identifying inundated houses
135# Used in run_building_inundation.py
136# Format latitude,longitude etc (geographic)
137##building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
138
139# AREA OF IMAGES - Extent of each image to find out highest runup
140# Header - easting,northing,id,value
141# Used in get_runup.py
142images_filename = 'images.csv'
143
144# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
145# NOTE: when files are put together the points must be in sequence
146# For ease go clockwise!
147# Check the run_model.py for boundary_tags
148
149# Thinned ordering file from Hazard Map (geographic)
150# Format is index,latitude,longitude (with header)
151urs_order_filename = 'thinned_boundary_ordering_extend.csv'
152
153# Landward bounding points
154# Format easting,northing (no header)
155landward_boundary_filename = 'landward_boundary_extend.csv'
156
157# MUX input filename.
158# If a meta-file from EventSelection is used, set 'multi-mux' to True.
159# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
160##mux_input_filename = event_number # to be found in event_folder
161                                    # (ie boundaries/event_number/)
162##multi_mux = False
163mux_input_filename = 'event.list'
164multi_mux = True
165
166zone = 56
167#-------------------------------------------------------------------------------
168# Clipping regions for export to asc and regions for clipping data
169# Final inundation maps should only be created in regions of the finest mesh
170#-------------------------------------------------------------------------------
171
172# ASCII export grid for Busselton
173xminBusselton = 340000
174xmaxBusselton = 352000
175yminBusselton = 6271500
176ymaxBusselton = 6280000
177
178# ASCII export grid for Bunbury
179xminBunbury = 369000
180xmaxBunbury = 381000
181yminBunbury = 6308000
182ymaxBunbury = 6316500
183
184################################################################################
185################################################################################
186####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
187################################################################################
188################################################################################
189
190# Get system user and host names.
191# These values can be used to distinguish between two similar runs by two
192# different users or runs by the same user on two different machines.
193user = get_user_name()
194host = get_host_name()
195
196# Environment variable names.
197# The inundation directory, not the data directory.
198ENV_INUNDATIONHOME = 'ANUGADATA'
199
200#-------------------------------------------------------------------------------
201# Output Elevation Data
202#-------------------------------------------------------------------------------
203
204# Output filename for elevation
205# this is a combination of all the data generated in build_elevation.py
206combined_elevation_basename = scenario_name + '_combined_elevation'
207
208#-------------------------------------------------------------------------------
209# Directory Structure
210#-------------------------------------------------------------------------------
211
212# determines time for setting up output directories
213time = strftime('%Y%m%d_%H%M%S', localtime()) 
214gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
215build_time = time + '_build'
216run_time = time + '_run_'
217
218# create paths generated from environment variables.
219home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
220
221# check various directories/files that must exist
222anuga_folder = join(home, state, scenario_folder, 'anuga')
223topographies_folder = join(anuga_folder, 'topographies')
224polygons_folder = join(anuga_folder, 'polygons')
225boundaries_folder = join(anuga_folder, 'boundaries')
226output_folder = join(anuga_folder, 'outputs')
227gauges_folder = join(anuga_folder, 'gauges')
228meshes_folder = join(anuga_folder, 'meshes')
229event_folder = join(boundaries_folder, str(event_number))
230
231#-------------------------------------------------------------------------------
232# Location of input and output data
233#-------------------------------------------------------------------------------
234
235# Convert the user output_comment to a string for run_model.py
236output_comment = ('_'.join([str(x) for x in output_comment if x != user])
237                  + '_' + user)
238
239# The absolute pathname of the all elevation, generated in build_elevation.py
240combined_elevation = join(topographies_folder, combined_elevation_basename)
241
242# The absolute pathname of the mesh, generated in run_model.py
243meshes = join(meshes_folder, scenario_name) + '.msh'
244
245# The pathname for the urs order points, used within build_urs_boundary.py
246urs_order = join(boundaries_folder, urs_order_filename)
247
248# The absolute pathname for the landward points of the bounding polygon,
249# Used within run_model.py)
250landward_boundary = join(boundaries_folder, landward_boundary_filename)
251
252# The absolute pathname for the .sts file, generated in build_boundary.py
253event_sts = join(event_folder, scenario_name)
254
255# The absolute pathname for the output folder names
256# Used for build_elevation.py
257output_build = join(output_folder, build_time) + '_' + str(user) 
258# Used for run_model.py
259output_run = join(output_folder, run_time) + output_comment
260# Used by post processing
261output_run_time = join(output_run, scenario_name) 
262
263# The absolute pathname for the gauges file
264# Used for get_timeseries.py
265gauges = join(gauges_folder, gauges_filename)       
266
267# The absolute pathname for the building file
268# Used for run_building_inundation.py
269##building_exposure = join(gauges_folder, building_exposure_filename)
270
271# The absolute pathname for the image file
272# Used for get_runup.py
273if images_filename:
274    images = join(polygons_folder, images_filename)
275
276# full path to where MUX files (or meta-files) live
277mux_input = join(event_folder, mux_input_filename)
278
Note: See TracBrowser for help on using the repository browser.