source: anuga_work/production/new_south_wales/batemans_bay/project.py @ 7045

Last change on this file since 7045 was 7045, checked in by jgriffin, 16 years ago
File size: 11.0 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
10import csv
11
12
13#-------------------------------------------------------------------------------
14# Directory setup
15#-------------------------------------------------------------------------------
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 = 'new_south_wales'
20scenario_name = 'gosford'
21scenario_folder = 'gosford_tsunami_scenario_2009'
22
23#-------------------------------------------------------------------------------
24# Initial Conditions
25#-------------------------------------------------------------------------------
26
27
28# Model specific parameters.
29# One or all can be changed each time the run_model script is executed
30tide = 0                # difference between MSL and HAT in metres
31zone = 56               # specify zone of model
32#event_number = 58242    # Puysegur 1 in 10 000 # the event number or the mux file name
33event_number = 51436    # New Hebrides 1 in 10 000
34#event_number = 58349    # Puysegur 1 in 5000
35#event_number = 58284    # Puysegur 1 in 2000
36#event_number = 58187    # Puysegur 1 in 1000
37#event_number = 58113    # Puysegur 1 in 500
38#event_number = 58025    # Puysegur 1 in 200
39
40alpha = 0.1             # smoothing parameter for mesh
41friction=0.01           # manning's friction coefficient
42starttime=0             # start time for simulation
43finaltime=1000         # final time for simulation
44
45setup = 'final'         # This can be one of three values
46                        #    trial - coarsest mesh, fast
47                        #    basic - coarse mesh
48                        #    final - fine mesh, slowest
49
50#-------------------------------------------------------------------------------
51# Output filename
52#
53# Your output filename should be unique between different runs on different data.
54# The list of items below will be used to create a file in your output directory.
55# Your user name and time+date will be automatically added.  For example,
56#     [setup, tide, event_number]
57# will result in a filename like
58#     20090212_091046_run_final_0_27283_rwilson
59#-------------------------------------------------------------------------------
60
61output_comment = [setup, tide, event_number]
62
63#-------------------------------------------------------------------------------
64# Input Data
65#-------------------------------------------------------------------------------
66
67# ELEVATION DATA
68# Used in build_elevation.py
69# Format for ascii grids, as produced in ArcGIS + a projection file
70ascii_grid_filenames = ['e151_s34_clip2',
71                        'aus197_topo2raster_clip',
72                        'hydro_topo2raster_clip']
73                        #'aus197_topo2raster_terrigal']   #GA data??
74                   
75
76
77#Get long list of Lidar filenames.
78ENV_INUNDATIONHOME = 'INUNDATIONHOME'
79home = join(os.getenv(ENV_INUNDATIONHOME), 'data')
80anuga_folder = join(home, state, scenario_folder, 'anuga')
81topographies_folder = join(anuga_folder, 'topographies/original')
82
83file_list = join(topographies_folder, 'file_list.csv')
84###file_list2 = join(topographies_folder, 'file_list2.csv')
85fid = csv.reader(open(file_list))
86###fid2 = csv.reader(open(file_list2))
87lidar_filenames = []
88for row in fid:
89    lidar_filenames.append(','.join(row))
90##for row in fid2:
91##    lidar_filenames.append(','.join(row))
92###print lidar_filenames
93#lidar_filenames = list(lidar_filenames)
94#print lidar_filenames
95
96# Format for point is x,y,elevation (with header)
97point_filenames = ['estuaries.txt',
98##                   'XYHI341_HSDB_SD100035103',
99##                   'XYAHD',
100##                   'XYSCHOOL_11_99_HSDB_SD100021002_MGA',
101                   'ENT5C1S08_03_AHD_prepared.txt',
102                   'ENT5C1S09_03_AHD_prepared.txt',
103                   'ENT5C1S10_03_AHD_prepared.txt',
104##                   'XYAHD',
105##                   'XYHI341_HSDB_SD100035103_MGA',
106##                   'XYHI339_F_HSDB_SD100031669_MGA',
107##                   'AUS197_MGA_AHD_1972.txt',
108                   'hydro_neg.txt'
109                   ]
110point_filenames.extend(lidar_filenames)
111#print point_filenames
112         
113
114### Add csv header list to all files in point_filenames
115##headerlist = ['x', 'y', 'elevation']
116##for f in point_filenames:
117##    add_csv_header(join(topographies_folder, f), headerlist)
118
119    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
120# Used in build_elevation.py
121# Format for points easting,northing (no header)
122bounding_polygon_filename = 'bounding_polygon.csv'
123bounding_polygon_maxarea = 100000
124
125# INTERIOR REGIONS -  for designing the mesh
126# Used in run_model.py
127# Format for points easting,northing (no header)
128
129interior_regions_data =[['aoi_umina.csv', 500],
130                        ['aoi_terrigal.csv', 500],
131                        ['aos_umina.csv', 2500],
132                        ['aos_terrigal.csv', 2500]]
133
134
135# LAND - used to set the initial stage/water to be offcoast only
136# Used in run_model.py.  Format for points easting,northing (no header)
137land_initial_conditions_filename = [['initial_conditions.csv', 0]]
138                                 
139
140# GAUGES - for creating timeseries at a specific point
141# Used in get_timeseries.py. 
142# Format easting,northing,name,elevation (with header)
143gauges_filename = 'gauges.csv'
144
145# BUILDINGS EXPOSURE - for identifying inundated houses
146# Used in run_building_inundation.py
147# Format latitude,longitude etc (geographic)
148##building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
149
150# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
151# NOTE: when files are put together the points must be in sequence
152# For ease go clockwise!
153# Check the run_model.py for boundary_tags
154
155# Thinned ordering file from Hazard Map (geographic)
156# Format is index,latitude,longitude (with header)
157urs_order_filename = 'urs_order.csv'
158
159# Landward bounding points
160# Format easting,northing (no header)
161landward_boundary_filename = 'landward_boundary.csv'
162
163# MUX input filename.
164# If a meta-file from EventSelection is used, set 'multi-mux' to True.
165# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
166##mux_input_filename = event_number # to be found in event_folder
167                                    # (ie boundaries/event_number/)
168##multi_mux = False
169mux_input_filename = 'event.list'
170multi_mux = True
171
172zone = 56
173#-------------------------------------------------------------------------------
174# Clipping regions for export to asc and regions for clipping data
175# Final inundation maps should only be created in regions of the finest mesh
176#-------------------------------------------------------------------------------
177
178# ASCII export grid for Busselton
179xminBusselton = 340000
180xmaxBusselton = 352000
181yminBusselton = 6271500
182ymaxBusselton = 6280000
183
184# ASCII export grid for Bunbury
185xminBunbury = 369000
186xmaxBunbury = 381000
187yminBunbury = 6308000
188ymaxBunbury = 6316500
189
190################################################################################
191################################################################################
192####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
193################################################################################
194################################################################################
195
196# Get system user and host names.
197# These values can be used to distinguish between two similar runs by two
198# different users or runs by the same user on two different machines.
199user = get_user_name()
200host = get_host_name()
201
202# Environment variable names.
203# The inundation directory, not the data directory.
204ENV_INUNDATIONHOME = 'INUNDATIONHOME'
205
206# Path to MUX data
207ENV_MUXHOME = 'MUXHOME'
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
215combined_elevation_basename = scenario_name + '_combined_elevation'
216
217#-------------------------------------------------------------------------------
218# Directory Structure
219#-------------------------------------------------------------------------------
220
221# determines time for setting up output directories
222time = strftime('%Y%m%d_%H%M%S', localtime()) 
223gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
224build_time = time + '_build'
225run_time = time + '_run_'
226
227# create paths generated from environment variables.
228home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
229muxhome = os.getenv(ENV_MUXHOME)
230   
231# check various directories/files that must exist
232anuga_folder = join(home, state, scenario_folder, 'anuga')
233topographies_folder = join(anuga_folder, 'topographies/original')
234polygons_folder = join(anuga_folder, 'polygons')
235boundaries_folder = join(anuga_folder, 'boundaries')
236output_folder = join(anuga_folder, 'outputs')
237gauges_folder = join(anuga_folder, 'gauges')
238meshes_folder = join(anuga_folder, 'meshes')
239event_folder = join(boundaries_folder, str(event_number))
240
241# MUX data files
242# Directory containing the MUX data files to be used with EventSelection.
243mux_data_folder = join(muxhome, 'mux')
244
245#-------------------------------------------------------------------------------
246# Location of input and output data
247#-------------------------------------------------------------------------------
248
249# Convert the user output_comment to a string for run_model.py
250output_comment = ('_'.join([str(x) for x in output_comment if x != user])
251                  + '_' + user)
252
253# The absolute pathname of the all elevation, generated in build_elevation.py
254combined_elevation = join(topographies_folder, combined_elevation_basename)
255
256# The absolute pathname of the mesh, generated in run_model.py
257meshes = join(meshes_folder, scenario_name) + '.msh'
258
259# The pathname for the urs order points, used within build_urs_boundary.py
260urs_order = join(boundaries_folder, urs_order_filename)
261
262# The absolute pathname for the landward points of the bounding polygon,
263# Used within run_model.py)
264landward_boundary = join(boundaries_folder, landward_boundary_filename)
265
266# The absolute pathname for the .sts file, generated in build_boundary.py
267event_sts = join(event_folder, scenario_name)
268
269# The absolute pathname for the output folder names
270# Used for build_elevation.py
271output_build = join(output_folder, build_time) + '_' + str(user) 
272# Used for run_model.py
273output_run = join(output_folder, run_time) + output_comment
274# Used by post processing
275output_run_time = join(output_run, scenario_name) 
276
277# The absolute pathname for the gauges file
278# Used for get_timeseries.py
279gauges = join(gauges_folder, gauges_filename)       
280
281# The absolute pathname for the building file
282# Used for run_building_inundation.py
283##building_exposure = join(gauges_folder, building_exposure_filename)
284
285# full path to where MUX files (or meta-files) live
286mux_input = join(event_folder, mux_input_filename)
287
Note: See TracBrowser for help on using the repository browser.