source: trunk/anuga_work/development/Busselton/BP7/project.py @ 8452

Last change on this file since 8452 was 8449, checked in by martins, 13 years ago

Checking in Busselton NCI code

  • Property svn:executable set to *
File size: 17.3 KB
Line 
1"""
2This file contains all your file and directory definitions
3for elevation, meshes and outputs.
4"""
5
6import os
7import sys
8import glob
9import anuga
10from os.path import join, exists
11from time import localtime, strftime, gmtime
12from anuga.utilities.system_tools import get_user_name, get_host_name
13
14event = 'BP7'
15
16SLR = 0.9
17ARI = 25 
18
19stsName = "CutDownWorst.sts"
20scenario_name = 'Busselton'
21
22setup = 'final'                 # This can be one of three values (defined in setup.py)
23                                #    trial - coarsest mesh, fast
24                                #    basic - coarse mesh
25                                #    final - fine mesh, slowest
26                               
27UseCheckRestore = True
28UseFlooding = True
29
30np = [8]
31home = '/home/547/sfm547/Busselton'  # Absolute path for data folder
32ParScript = join(home,event,'run_model_parallel.py')
33outFolder = r'/short/w85/Shane/Output'
34
35if UseCheckRestore:
36    restoreFolderName = 'RestorePts_' + setup + "_" + event
37 
38#------------------------------------------------------------------------------
39# Initial Conditions and Internal Variables
40#------------------------------------------------------------------------------
41
42bounding_polygon_maxarea = 10   # Mesh size (m2) within the hydraulic boundary i.e. model domain
43minimum_storable_height = 0.10  # Minimum water depth (m) which is stored for visualisation
44tide = SLR                                      # Mean Sea Level = 0. GEMS model includes tide.  # Busselton Chart Datum is 0.786m below AHD (Section 3.3 "Locke Estate Busselton Investigation of Beach Stabilisation - Department for Planning and Infrastructure 2004.pdf" in the original reference/reports folder)
45friction = 0.03                 # 0.01: Very Low    0.025-0.04: "Standard" natural channel    0.04-0.06: Pretty rough
46alpha = 0.1                                             # Smoothing of mesh; 1 is smoothest
47zone = 50                       # Specify UTM zone of model
48
49starttime= 0                     # Start time for simulation           
50yieldstep = 720                 # 12 minute timesteps
51finaltime =  140400             # Final time for simulation
52
53if UseCheckRestore:
54    restPtInt = 5*yieldstep     # Save a restore point every x timesteps, must be an even number
55
56#starttime=0                     # Start time for simulation           
57#yieldstep = 60                 # 12 minute timesteps
58#finaltime =  300             # Final time for simulation
59#
60#if UseCheckRestore:
61#    restPtInt = 2*yieldstep
62                                               
63#-------------------------------------------------------------------------------
64# Input Filenames
65#-------------------------------------------------------------------------------
66
67# ELEVATION DATA
68# Used in build_elevation.py
69# Format for points: easting,northing, elevation (AHD) Header: x,y
70ascii_grid_filenames = []
71
72point_filenames = ['busselton25mpoints.csv',"Busselton1mDEM_VDD_Pts.csv"]
73#point_filenames = ['busselton25mpoints.csv',"Busselton1mDEM_VDD_Pts.csv",\
74#                   "Busselton1mDEM_Sab_Pts.csv","Busselton1mDEM_Abb_Pts.csv"]
75#point_filenames = ['busselton25mpoints.csv']#,"Busselton1mDEM_Sab_Pts.csv"]
76
77# Output filename for elevation
78# this is a combination of all the data generated in build_elevation.py
79combined_elevation_basename = scenario_name + '_combined_elevation'
80
81# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
82# Used in build_elevation.py
83# Format for points: easting,northing (no header)
84bounding_polygon_filename = 'ANUGA_Domain2.xyz' # Maximum size of area modelled
85bounding_polygon_maxarea = 10000 # Max area (m2) in any one triangle
86
87# INTERIOR REGIONS - for designing the mesh
88# Used in run_model.py
89# Format for points: easting,northing (no header)       
90
91interior_regions_data = [['CoastPoly.xyz', 100],   # Areas (polygons) which have been refined, max area of triangles inside polygon)                         ['Vasse_River_1.xyz', 2],
92                         ['Vasse_River.xyz', 2],                   
93                         ['Sabina_River.xyz', 50],
94                         ['Abba_River.xyz', 50]] 
95
96# LAND - used to set the initial stage/water to be offcoast only
97# Used in run_model.py.  Format for points easting,northing (no header)
98Land = 'ANUGA_Land.xyz'
99
100InitialStages = [[Land, 0.0],
101                 ['The_Broadwater.csv', 0.4],    #Values from JDA's Busselton Regional Flood Study Review Volume 2 Appendices
102                 ['New_River.csv', 0.2],
103                 ['Vasse_Estuary.csv', 0.4],
104                 ['Wonnerup_Estuary.csv', 0.4]]
105
106VasseDDLine = [[347893.7127, 6271596.0586], [347901.9453, 6271603.7542]]
107SabinaLine = [[353132.7757,6274869.5972], [353137.009,6274871.2906]]
108AbbaLine =  [[354860.7323,6276575.6181], [354864.4365,6276577.4172]]
109
110if ARI == 25:
111    VasseDD = 'VasseDD25-2.tms' #From Vasse July 97 prelim report
112    #VasseDD = 151.0 #From Busselton Regional Flood Study Review 1998 DA
113#    VasseDD =  128.0 #rom Vasse July 97 prelim report
114    Sab = 29.0  #From Busselton Regional Flood Study Review 1998 DA
115    Abb = 67.0  #From Busselton Regional Flood Study Review 1998 DA
116
117if ARI == 100:       
118    #VasseDD = 188.0 #From Busselton Regional Flood Study Review 1998 DA
119    VasseDD = 190.0 #From Vasse July 97 prelim report
120    Sab = 35.0 #From Busselton Regional Flood Study Review 1998 DA
121    Abb = 86.0 #From Busselton Regional Flood Study Review 1998 DA
122
123if UseFlooding:
124   
125    if ARI == 100:
126        riversHydro = []
127        riversPeak = [[VasseDD,VasseDDLine],[Sab,SabinaLine],[Abb,AbbaLine]]
128    else:
129        riversHydro = [[VasseDD,VasseDDLine]] 
130        riversPeak = [[Sab,SabinaLine],[Abb,AbbaLine]]
131       
132else:
133    riversHydro = []
134    riversPeak = []
135
136       
137PriorityArea_filename = None
138
139# GEMS order filename - should be in same direction as landward boundary points ie clockwise or anti-clockwise
140# Format is northing, easting (without header)
141gems_order_filename = 'GEMS_Boundary_pts.xyz'
142
143# GAUGES - for creating timeseries at a specific point
144# Used in get_timeseries.py. 
145# Format easting,northing,name,elevation (with header)
146gauges_filename = 'gauges.csv' #'tsunamipointsMGA.csv'
147
148#-------------------------------------------------------------------------------
149# Locations for extracting time series (for outputs)
150#-------------------------------------------------------------------------------
151#gauges=["Marina,351040,6277403", 'Jetty,345960,6277593', "Hospital,344131,6274965"]
152# Order of gauges is Marina, Jetty, Hospital
153
154# BUILDINGS EXPOSURE - for identifying inundated houses
155# Used in run_building_inundation.py
156# Format latitude,longitude etc (geographic)
157building_exposure_filename = '' # from NEXIS
158
159# AREA OF IMAGES - Extent of each image to find out highest runup
160# Header - easting,northing,id,value
161# Used in get_runup.py
162images_filename = ''
163
164# Landward bounding points
165# Format easting,northing (no header)
166landward_boundary_filename = 'ANUGA_Land_pts.xyz'
167
168#------------------------------------------------------------------------------
169#  ADD ROUGHNESS INFORMATION HERE
170#------------------------------------------------------------------------------
171
172# mannings value for different landuses, defined by polygons. Have replicated order of materials applied in TUFLOW.
173# Set the default materials value to 208 (sugarcane).
174    # i.e. the area of the whole hydraulic model is sugarcane unless stated otherwise below.
175    # Does not make sense though why TUFLOW model still defined some areas as 208!
176    # NEED TO CHECK THAT THIS ACTUALLY WORKS IN ANUGA
177    # i.e. THAT ROUHGNESS IN LATER SMALLER POLYGONS OVERRIDES THE DEFAULT ROUGHNESS APPLIED HERE TO THE WHOLE HYDRAULIC MODEL
178    # IF NOT, THEN THIS WON'T WORK PROPERLY!!!!!!
179#ManningDictionary = {join(polygons_folder, 'mannings', 'historical', 'bounding_polygon.csv'): 0.150,
180#                     # Read materials values taken from 2d_mat_tw_422.mif
181#    join(polygons_folder, 'mannings', 'historical', '201_0.csv'):  0.03, #2D river/waterways
182#    join(polygons_folder, 'mannings', 'historical', '202_1.csv'):  0.026,  # 2D tidal waterways
183#    join(polygons_folder, 'mannings', 'historical', '203_0.csv'):     0.090, # 2D river banks
184#    join(polygon:xs_folder, 'mannings', 'historical', '204_1.csv'):     0.100, # 2D dense forest
185#    join(polygons_folder, 'mannings', 'historical', '205_0.csv'):  0.080, # 2D vegetated islands in river
186#    join(polygons_folder, 'mannings', 'historical', '206_25.csv'):  0.060, # 2D cleared / grazing / bare land     
187#    join(polygons_folder, 'mannings', 'historical', '207_0.csv'):     0.040, # 2D parks
188#    join(polygons_folder, 'mannings', 'historical', '208_0a.csv'):  0.150, # 2D sugarcane
189#    join(polygons_folder, 'mannings', 'historical', '209_0.csv'):     1.000, # 2D urban
190#    join(polygons_folder, 'mannings', 'historical', '210_0a.csv'):  0.025} # 2D highway/roads
191
192
193################################################################################
194################################################################################
195####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
196################################################################################
197################################################################################
198
199# Get system user and host names.
200# These values can be used to distinguish between two similar runs by two
201# different users or runs by the same user on two different machines.
202user = anuga.get_user_name()
203host = anuga.get_host_name()
204
205# Environment variable names.
206# The inundation directory, not the data directory.
207#ENV_INUNDATIONHOME = 'INUNDATIONHOME'
208
209#-------------------------------------------------------------------------------
210# Output Elevation Data
211#-------------------------------------------------------------------------------
212
213## Output filename for elevation
214## this is a combination of all the data generated in build_elevation.py
215#combined_elevation_basename = scenario_name_init + '_combined_elevation'
216
217# Output filename for elevation
218# this is a combination of all the data generated in build_elevation.py
219combined_elevation_basename = scenario_name + '_combined_elevation'
220
221#-------------------------------------------------------------------------------
222# Directory Structure
223#-------------------------------------------------------------------------------
224
225# determines time for setting up output directories
226time = strftime('%Y%m%d_%H%M%S', localtime()) 
227gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
228build_time = time + '_build'
229run_time = time + '_run_'
230
231# check various directories/files that must exist
232anuga_folder = join(home, 'anuga')
233topographies_folder = join(anuga_folder, 'topographies')
234polygons_folder = join(anuga_folder, 'polygons')
235boundaries_folder = join(anuga_folder, 'boundaries')
236gauges_folder = join(anuga_folder, 'gauges')
237event_folder = join(boundaries_folder, str(event))
238hydrographs_folder = join(anuga_folder, 'hydrographs') 
239meshes_folder = join(anuga_folder, 'meshes')
240
241output_folder = join(outFolder,event)
242
243if UseCheckRestore:
244    restore_folder = join(output_folder,restoreFolderName)
245
246#if not os.path.exists(output_folder):
247#    os.makedirs(output_folder)
248   
249#-------------------------------------------------------------------------------
250# Location of input and output data
251#-------------------------------------------------------------------------------
252
253# OCEAN INPUT
254# The absolute pathname for the .sts file.
255event_sts = join(boundaries_folder, stsName)
256
257#-------------------------------------------------------------------------------
258# Output filename
259#
260# Your output filename should be unique between different runs on different data.
261# The list of items below will be used to create a file in your output directory.
262# Your user name and time+date will be automatically added.  For example,20101017_090339_run_storm_surge_final_worse_case_0408_current20m_gate_0.0_sextoj
263
264#     [setup, event, which_elevation, gate, SLR]
265# will result in a filename like
266#     20090212_091046_run_final_20100527_gcom_12min_current_gate_0_jsexton
267#-------------------------------------------------------------------------------
268
269output_comment = [setup, event] 
270
271# Convert the user output_comment to a string for run_model.py
272output_comment = ('_'.join([str(x) for x in output_comment if x != user])
273                  + '_' + user)
274 
275# The absolute pathname of the all elevation, generated in build_elevation.py
276combined_elevation = join(topographies_folder, combined_elevation_basename)
277
278# The pathname for the GEMS order points
279if gems_order_filename:
280    gems_order = join(boundaries_folder, gems_order_filename)
281
282# The absolute pathname for the landward points of the bounding polygon,
283# Used within run_model.py)
284if landward_boundary_filename:
285    landward_boundary = join(boundaries_folder, landward_boundary_filename)
286
287# The absolute pathname for the output folder names
288# Used for build_elevation.py
289output_build = join(output_folder, build_time) + '_' + str(user) 
290# Used for run_model.py
291output_run = join(output_folder, output_comment) 
292# Used by post processing
293output_run_time = join(output_run, scenario_name) 
294 
295# The absolute pathname of the mesh, generated in run_model.py
296#meshes = join(output_run, scenario_name + "_" + setup) + '.msh'
297meshes = join(output_run, scenario_name) + '.msh'
298
299# Log file name
300#log.log_filename = join(output_run, scenario_name) + '.log'
301
302## The absolute pathname for the storm gate file
303## Used for run_model.py
304#if storm_gate_filename:
305#    storm_gate = join(polygons_folder, storm_gate_filename) 
306
307# The absolute pathname for the gauges file
308# Used for get_timeseries.py
309if gauges_filename:
310    gauges = join(gauges_folder, gauges_filename)       
311
312# The absolute pathname for the building file
313# Used for run_building_inundation.py
314if building_exposure_filename:
315    building_exposure = join(gauges_folder, building_exposure_filename)
316
317## Areas for export of results
318## Used in export_results_max.py
319#xminBunbury = 371838
320#xmaxBunbury = 379640
321#yminBunbury = 6309741
322#ymaxBunbury = 6316293
323#
324## Storm gate area:
325#xminStorm_gate=373515
326#xmaxStorm_gate=373582
327#yminStorm_gate=6312314
328#ymaxStorm_gate=6312358
329
330#
331##-------------------------------------------------------------------------------
332## Absolute Path Definitions. (This should not change)
333##-------------------------------------------------------------------------------
334#
335## determines time for setting up output directories
336#time = strftime('%Y%m%d_%H%M%S', localtime())
337#gtime = strftime('%Y%m%d_%H%M%S', gmtime())
338#build_time = time + '_build'
339#run_time = time + '_run_'
340#
341##-------------------------------------------------------------------------------
342## Output filename
343##
344## Your output filename should be unique between different runs on different data.
345## The list of items below will be used to create a file in your output directory.
346## Your user name and time+date will be automatically added.  For example,
347##     [setup, tide, event_number]
348## will result in a filename like
349##     20090212_091046_run_final_0_27283_rwilson
350##-------------------------------------------------------------------------------
351#
352#output_comment = [setup, tide, radius, event]
353#output_comment = ('_'.join([str(x) for x in output_comment if x != user])
354#                  + '_' + user)
355#
356## The absolute pathname for the output folder names
357## Used for build_elevation.py
358#output_build = join(output_folder, build_time) + '_' + str(user)
359## Used for run_model.py
360#output_run = join(output_folder, run_time) + output_comment
361## Used by post processing
362#output_run_time = join(output_run, scenario_name)
363#
364#
365## The absolute pathname of the mesh, generated in run_model.py
366##meshes = join(output_run, scenario_name) + '.msh'
367#meshes = join(os.getcwd(), scenario_name) + '.msh'
368#
369## The absolute pathname for the gauges file
370## Used for get_timeseries.py
371#if gauges_filename:
372#    gauges = join(gauges_folder, gauges_filename)       
373#
374## The absolute pathname for the building file
375## Used for run_building_inundation.py
376#if building_exposure_filename:
377#    building_exposure = join(gauges_folder, building_exposure_filename)
378#
379## The absolute pathname for the image file
380## Used for get_runup.py
381#if images_filename:
382#    images = join(polygons_folder, images_filename)
383#
384#
385## full path to where MUX files (or meta-files) live
386##mux_input = join(event_folder, mux_input_filename)
387#
388##Multiple polygons in one CSV file to make internal polygons
389#if not PriorityArea_filename == None:
390#    PriorityAreas = join(polygons_folder, PriorityArea_filename) 
391#
392##friction_list = read_polygon_dir(ManningDictionary, join(polygons_folder,'mannings','historical'))
393#
394##interior_regions = read_polygon_dir(CatchmentDictionary, join(polygons_folder,'bdy'))
395#
396## The absolute pathname of the all elevation, generated in build_elevation.py
397#combined_elevation = join(topographies_folder, combined_elevation_basename)
398#
399## The pathname for the urs order points, used within build_urs_boundary.py
400##if urs_order_filename:
401##    urs_order = join(boundaries_folder, urs_order_filename)
402#
403## The absolute pathname for the landward points of the bounding polygon,
404## Used within run_model.py)
405##if landward_boundary_filename:
406##    landward_boundary = join(boundaries_folder, landward_boundary_filename)
407#
408## The absolute pathname for the .sts file, generated in build_boundary.py
409##event_sts = join(event_folder, scenario_name)
410#
411##elevation_name = join(topographies_folder, elevation_filename)      # directory location and DEM name. This has been triangulated using 2d_zpts_tw_803.mid as the base.
412#meshname = join(output_run, scenario_name) + '.msh'
413#
414##ocean_hydrograph_filename=join(ocean_folder, ocean_hydrograph_basename)
Note: See TracBrowser for help on using the repository browser.