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

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