source: anuga_work/production/patong/new_version/project.py @ 6543

Last change on this file since 6543 was 6543, checked in by ole, 15 years ago

Changed patong to 20s step for use with auto validation.

File size: 10.1 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 = 'thailand'
19scenario_name = 'patong'
20scenario_folder = 'patong_tsunami_scenario'
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.8              # difference between MSL and HAT
29zone = 47               # specify zone of model
30model = 'small'         # different size model 'small' or 'large'
31event_number = 'mux_' + model    # the event number or the mux file name
32alpha = 0.1             # smoothing parameter for mesh
33friction = 0.01         # manning's friction coefficient
34starttime = 0           # start time for simulation
35finaltime = 15000       # final time for simulation
36
37use_buildings = True
38setup = 'final'         # 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, 'final']
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# Format for point is x,y,elevation (with header)
66point_filenames = ['patong_10m_grid_msl_Project.txt',    # 10m main grid
67                   'patong_10m_small_grid_for_anuga_sub_Project.txt', # 10m saddle
68                   'patong_bay_1s_grid_Project.txt',   # 1s grid
69                   'andaman_3s_grid_Clip2_Project.txt'] #3s grid
70
71### Add csv header list to all files in point_filenames
72##headerlist = ['x', 'y', 'elevation']
73##for f in point_filenames:
74##    add_csv_header(join(topographies_folder, f), headerlist)
75
76extent_polygon_filenames = ['patong_10m.txt',
77                            'saddle_10m.txt',
78                            'patong_1s.txt']
79
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 = 'bounding_polygon_'+ model + '.csv'
85bounding_polygon_maxarea = 100000
86
87# INTERIOR REGIONS -  for designing the mesh
88# Used in run_model.py
89# Format for points easting,northing (no header)                   
90interior_regions_data = [['inundation_area.csv', 75],
91                         ['aoi.csv', 200],
92                         ['aos.csv', 900],
93                         ['sw_coast_original.csv', 7000],
94                         ['building_main.csv', 20],
95                         ['building_main_small.csv', 20],
96                         ['building_main_south.csv', 20],
97                         ['building_saddle.csv', 20]]
98
99
100# LAND - used to set the initial stage/water to be offcoast only
101# Used in run_model.py.  Format for points easting,northing (no header)
102land_initial_conditions_filename = [['initial_conditions_' + model +'.csv', 0]]
103
104# GAUGES - for creating timeseries at a specific point
105# Used in get_timeseries.py. 
106# Format easting,northing,name,elevation (with header)
107gauges_filename = 'gauges.csv'
108
109# BUILDINGS POLYOGN - for elevation of buildings
110# Used in run_model.py
111# Format easting,northing,id,floor (with header)
112building_polygon_filename = 'buildings.csv' 
113
114
115# BUILDINGS EXPOSURE - for identifying inundated houses
116# Used in run_building_inundation.py
117# Format latitude,longitude etc (geographic)
118building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
119
120# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
121# NOTE: when files are put together the points must be in sequence
122# For ease go clockwise!
123# Check the run_model.py for boundary_tags
124
125# Thinned ordering file from Hazard Map (geographic)
126# Format is index,latitude,longitude (with header)
127urs_order_filename = 'urs_order_'+ model +'.csv'
128
129# Landward bounding points
130# Format easting,northing (no header)
131landward_boundary_filename = 'landward_boundary_'+ model +'.csv'
132
133# MUX input filename.
134# If a meta-file from EventSelection is used, set 'multi-mux' to True.
135# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
136mux_input_filename = event_number # to be found in event_folder
137                                    # (ie boundaries/event_number/)
138multi_mux = False
139##mux_input_filename = 'event.list'
140##multi_mux = True
141
142#-------------------------------------------------------------------------------
143# Clipping regions for export to asc and regions for clipping data
144# Final inundation maps should only be created in regions of the finest mesh
145#-------------------------------------------------------------------------------
146
147#CBD extract ascii grid - coordinates from patong_1s extent
148xminCBD = 417445.1119
149xmaxCBD = 425601.7881
150yminCBD = 870663.4547
151ymaxCBD = 876965.3856
152
153
154################################################################################
155################################################################################
156####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
157################################################################################
158################################################################################
159
160# Get system user and host names.
161# These values can be used to distinguish between two similar runs by two
162# different users or runs by the same user on two different machines.
163user = get_user_name()
164host = get_host_name()
165
166# Environment variable names.
167# The inundation directory, not the data directory.
168ENV_INUNDATIONHOME = 'INUNDATIONHOME'
169
170# Path to MUX data
171ENV_MUXHOME = 'MUXHOME'
172
173#-------------------------------------------------------------------------------
174# Output Elevation Data
175#-------------------------------------------------------------------------------
176
177# Output filename for elevation
178# this is a combination of all the data generated in build_elevation.py
179combined_elevation_basename = scenario_name + '_combined_elevation_' + model
180
181#-------------------------------------------------------------------------------
182# Directory Structure
183#-------------------------------------------------------------------------------
184
185# determines time for setting up output directories
186time = strftime('%Y%m%d_%H%M%S', localtime()) 
187gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
188build_time = time + '_build_' + model
189run_time = time + '_run_'
190
191# create paths generated from environment variables.
192home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
193muxhome = os.getenv(ENV_MUXHOME)
194   
195# check various directories/files that must exist
196anuga_folder = join(home, state, scenario_folder, 'anuga')
197topographies_folder = join(anuga_folder, 'topographies')
198polygons_folder = join(anuga_folder, 'polygons')
199boundaries_folder = join(anuga_folder, 'boundaries')
200output_folder = join(anuga_folder, 'outputs')
201gauges_folder = join(anuga_folder, 'gauges')
202meshes_folder = join(anuga_folder, 'meshes')
203event_folder = join(boundaries_folder, str(event_number))
204
205# MUX data files
206# Directory containing the MUX data files to be used with EventSelection.
207mux_data_folder = join(muxhome, 'mux')
208
209#-------------------------------------------------------------------------------
210# Location of input and output data
211#-------------------------------------------------------------------------------
212
213# Convert the user output_comment to a string for run_model.py
214output_comment = ('_'.join([str(x) for x in output_comment if x != user])
215                  + '_' + user)
216
217# The absolute pathname of the all elevation, generated in build_elevation.py
218combined_elevation = join(topographies_folder, combined_elevation_basename)
219
220# The absolute pathname of the mesh, generated in run_model.py
221meshes = join(meshes_folder, scenario_name) + model +'.msh'
222
223# The pathname for the urs order points, used within build_urs_boundary.py
224urs_order = join(boundaries_folder, urs_order_filename)
225
226# The absolute pathname for the landward points of the bounding polygon,
227# Used within run_model.py)
228landward_boundary = join(boundaries_folder, landward_boundary_filename)
229
230# The absolute pathname for the .sts file, generated in build_boundary.py
231event_sts = join(event_folder, scenario_name)
232
233# The absolute pathname for the output folder names
234# Used for build_elevation.py
235output_build = join(output_folder, build_time) + '_' + str(user) 
236# Used for run_model.py
237output_run = join(output_folder, run_time) + output_comment
238# Used by post processing
239output_run_time = join(output_run, scenario_name) 
240
241# The absolute pathname for the gauges file
242# Used for get_timeseries.py
243gauges = join(gauges_folder, gauges_filename)
244
245# The absolute pathname for the gauges file
246# Used for run_model.py
247building_polygon = join(polygons_folder, building_polygon_filename)
248
249# The absolute pathname for the building file
250# Used for run_building_inundation.py
251building_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.