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

Last change on this file since 6958 was 6958, checked in by jgriffin, 15 years ago

added functionality to read list of point filenames

File size: 9.7 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 = [] 
64                   
65
66
67#Get long list of Lidar filenames.
68ENV_INUNDATIONHOME = 'INUNDATIONHOME'
69home = join(os.getenv(ENV_INUNDATIONHOME), 'data')
70anuga_folder = join(home, state, scenario_folder, 'anuga')
71topographies_folder = join(anuga_folder, 'topographies/original')
72file_list = join(topographies_folder, 'file_list.csv')
73fid = csv.reader(open(file_list))
74lidar_filenames = []
75for row in fid:
76    lidar_filenames.append(','.join(row))
77lidar_filenames = list(lidar_filenames)   
78
79# Format for point is x,y,elevation (with header)
80point_filenames = lidar_filenames    #
81         
82
83### Add csv header list to all files in point_filenames
84##headerlist = ['x', 'y', 'elevation']
85##for f in point_filenames:
86##    add_csv_header(join(topographies_folder, f), headerlist)
87
88    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
89# Used in build_elevation.py
90# Format for points easting,northing (no header)
91bounding_polygon_filename = 'bounding_polygon.csv'
92bounding_polygon_maxarea = 100000
93
94# INTERIOR REGIONS -  for designing the mesh
95# Used in run_model.py
96# Format for points easting,northing (no header)
97
98interior_regions_data =[]#[['area_of_interest.csv', 500],
99                        #['area_of_significance.csv', 2500],
100                        #['shallow_water.csv', 10000]]
101
102
103# LAND - used to set the initial stage/water to be offcoast only
104# Used in run_model.py.  Format for points easting,northing (no header)
105land_initial_conditions_filename = [['initial_conditions.csv', 0]]
106                                 
107
108# GAUGES - for creating timeseries at a specific point
109# Used in get_timeseries.py. 
110# Format easting,northing,name,elevation (with header)
111gauges_filename = 'gauges.csv'
112
113# BUILDINGS EXPOSURE - for identifying inundated houses
114# Used in run_building_inundation.py
115# Format latitude,longitude etc (geographic)
116##building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
117
118# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
119# NOTE: when files are put together the points must be in sequence
120# For ease go clockwise!
121# Check the run_model.py for boundary_tags
122
123# Thinned ordering file from Hazard Map (geographic)
124# Format is index,latitude,longitude (with header)
125urs_order_filename = 'thinned_boundary_ordering_extend.csv'
126
127# Landward bounding points
128# Format easting,northing (no header)
129landward_boundary_filename = 'landward_boundary_extend.csv'
130
131# MUX input filename.
132# If a meta-file from EventSelection is used, set 'multi-mux' to True.
133# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
134##mux_input_filename = event_number # to be found in event_folder
135                                    # (ie boundaries/event_number/)
136##multi_mux = False
137mux_input_filename = 'event.list'
138multi_mux = True
139
140zone = 56
141#-------------------------------------------------------------------------------
142# Clipping regions for export to asc and regions for clipping data
143# Final inundation maps should only be created in regions of the finest mesh
144#-------------------------------------------------------------------------------
145
146# ASCII export grid for Busselton
147xminBusselton = 340000
148xmaxBusselton = 352000
149yminBusselton = 6271500
150ymaxBusselton = 6280000
151
152# ASCII export grid for Bunbury
153xminBunbury = 369000
154xmaxBunbury = 381000
155yminBunbury = 6308000
156ymaxBunbury = 6316500
157
158################################################################################
159################################################################################
160####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
161################################################################################
162################################################################################
163
164# Get system user and host names.
165# These values can be used to distinguish between two similar runs by two
166# different users or runs by the same user on two different machines.
167user = get_user_name()
168host = get_host_name()
169
170# Environment variable names.
171# The inundation directory, not the data directory.
172ENV_INUNDATIONHOME = 'INUNDATIONHOME'
173
174# Path to MUX data
175ENV_MUXHOME = 'MUXHOME'
176
177#-------------------------------------------------------------------------------
178# Output Elevation Data
179#-------------------------------------------------------------------------------
180
181# Output filename for elevation
182# this is a combination of all the data generated in build_elevation.py
183combined_elevation_basename = scenario_name + '_combined_elevation'
184
185#-------------------------------------------------------------------------------
186# Directory Structure
187#-------------------------------------------------------------------------------
188
189# determines time for setting up output directories
190time = strftime('%Y%m%d_%H%M%S', localtime()) 
191gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
192build_time = time + '_build'
193run_time = time + '_run_'
194
195# create paths generated from environment variables.
196home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
197muxhome = os.getenv(ENV_MUXHOME)
198   
199# check various directories/files that must exist
200anuga_folder = join(home, state, scenario_folder, 'anuga')
201topographies_folder = join(anuga_folder, 'topographies/original')
202polygons_folder = join(anuga_folder, 'polygons')
203boundaries_folder = join(anuga_folder, 'boundaries')
204output_folder = join(anuga_folder, 'outputs')
205gauges_folder = join(anuga_folder, 'gauges')
206meshes_folder = join(anuga_folder, 'meshes')
207event_folder = join(boundaries_folder, str(event_number))
208
209# MUX data files
210# Directory containing the MUX data files to be used with EventSelection.
211mux_data_folder = join(muxhome, 'mux')
212
213#-------------------------------------------------------------------------------
214# Location of input and output data
215#-------------------------------------------------------------------------------
216
217# Convert the user output_comment to a string for run_model.py
218output_comment = ('_'.join([str(x) for x in output_comment if x != user])
219                  + '_' + user)
220
221# The absolute pathname of the all elevation, generated in build_elevation.py
222combined_elevation = join(topographies_folder, combined_elevation_basename)
223
224# The absolute pathname of the mesh, generated in run_model.py
225meshes = join(meshes_folder, scenario_name) + '.msh'
226
227# The pathname for the urs order points, used within build_urs_boundary.py
228urs_order = join(boundaries_folder, urs_order_filename)
229
230# The absolute pathname for the landward points of the bounding polygon,
231# Used within run_model.py)
232landward_boundary = join(boundaries_folder, landward_boundary_filename)
233
234# The absolute pathname for the .sts file, generated in build_boundary.py
235event_sts = join(event_folder, scenario_name)
236
237# The absolute pathname for the output folder names
238# Used for build_elevation.py
239output_build = join(output_folder, build_time) + '_' + str(user) 
240# Used for run_model.py
241output_run = join(output_folder, run_time) + output_comment
242# Used by post processing
243output_run_time = join(output_run, scenario_name) 
244
245# The absolute pathname for the gauges file
246# Used for get_timeseries.py
247gauges = join(gauges_folder, gauges_filename)       
248
249# The absolute pathname for the building file
250# Used for run_building_inundation.py
251##building_exposure = join(gauges_folder, building_exposure_filename)
252
253# full path to where MUX files (or meta-files) live
254mux_input = join(event_folder, mux_input_filename)
255
Note: See TracBrowser for help on using the repository browser.