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

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

Patong Simulation: Commented Hotel refinements out and changed name to 'reference'

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