source: anuga_work/production/australia_ph2/darwin/project.py @ 6672

Last change on this file since 6672 was 6672, checked in by myall, 15 years ago

running and exporting scripts

File size: 9.8 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 = 'australia_ph2'
19scenario_name = 'darwin'
20scenario_folder = scenario_name
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                # difference between MSL and HAT
29central_meridian = 129.0 # for projection (necessary for nonstandard)
30event_number = 17898    # the event number or the mux file name
31# contributing events: 17898 (Flores), 64977 (Seram), 70906 (Sumba_normal),
32# 71261 (Timor_OTF)
33alpha = 0.1             # smoothing parameter for mesh
34friction=0.01           # manning's friction coefficient
35starttime=0             # start time for simulation
36finaltime=80000          # final time for simulation
37
38# index is only used when wave = Tb
39index = 1833            # index from the PTHA - 1 in 2000 wave height = 0.64m
40##index = 1860            # index from the PTHA - 1 in 2000 wave height = 1.32m - large wave from Timor
41wave = 'Bf'             # Bf (sts wave) Tb (index wave)
42
43setup = 'final'         # This can be one of three values
44                        #    trial - coarsest mesh, fast
45                        #    basic - coarse mesh
46                        #    final - fine mesh, slowest
47
48# for 1860 - point to north of Darwin, large wave from event off Timor
49# event_number 71065    #(timor - mag 7.4, prob 1e-4)
50
51internal_polygon = False
52
53#-------------------------------------------------------------------------------
54# Output filename
55#
56# Your output filename should be unique between different runs on different data.
57# The list of items below will be used to create a file in your output directory.
58# Your user name and time+date will be automatically added.  For example,
59#     [setup, tide, event_number]
60# will result in a filename like
61#     20090212_091046_run_final_0_27283_rwilson
62#-------------------------------------------------------------------------------
63
64if internal_polygon:
65    internal_poly_comment = 'internal'
66else:
67    internal_poly_comment = None
68
69output_comment = [setup, tide, event_number, index, wave, internal_poly_comment]
70
71#-------------------------------------------------------------------------------
72# Input Data
73#-------------------------------------------------------------------------------
74
75# ELEVATION DATA
76# Used in build_elevation.py
77# Format for ascii grids, as produced in ArcGIS + a projection file
78ascii_grid_filenames = [] # 250m grid 2005
79
80# Format for point is x,y,elevation (with header)
81point_filenames = ['darwin_grid250m.txt',
82                   'derby_grid250m.txt'] # 250m grid 2005
83
84### Add csv header list to all files in point_filenames
85##headerlist = ['x', 'y', 'elevation']
86##for f in point_filenames:
87##    add_csv_header(join(topographies_folder, f), headerlist)
88
89    # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
90# Used in build_elevation.py
91# Format for points easting,northing (no header)
92bounding_polygon_filename = 'bounding_polygon_darwin2.csv'
93bounding_polygon_maxarea = 125000 # 100000
94
95# INTERIOR REGIONS -  for designing the mesh
96# Used in run_model.py
97# Format for points easting,northing (no header)                   
98#interior_regions_data = []
99interior_regions_data = [['poly_island.csv',200000000]]  # large triangles on island
100
101# add an internal polygon to force different mesh generation
102# used to test for discretisation error when building elevation
103# make sure file is in same folder as interior regions and bouding polygon;
104# format is same (2 column .csv; easting, northing; no header)
105if internal_polygon:
106    interior_regions_data.append(['internal_polygon.csv',
107                                  bounding_polygon_maxarea])
108
109# LAND - used to set the initial stage/water to be offcoast only
110# Used in run_model.py.  Format for points easting,northing (no header)
111land_initial_conditions_filename = []
112
113# GAUGES - for creating timeseries at a specific point
114# Used in get_timeseries.py. 
115# Format easting,northing,name,elevation (with header)
116gauges_filename = 'gauges.csv'
117
118# BUILDINGS EXPOSURE - for identifying inundated houses
119# Used in run_building_inundation.py
120# Format latitude,longitude etc (geographic)
121building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS
122
123# BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively
124# NOTE: when files are put together the points must be in sequence
125# For ease go clockwise!
126# Check the run_model.py for boundary_tags
127
128# Thinned ordering file from Hazard Map (geographic)
129# Format is index,latitude,longitude (with header)
130urs_order_filename = 'urs_order.csv'
131
132# Landward bounding points
133# Format easting,northing (no header)
134landward_boundary_filename = 'landward_boundary_darwin.csv'
135
136# MUX input filename.
137# If a meta-file from EventSelection is used, set 'multi-mux' to True.
138# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
139##mux_input_filename = event_number # to be found in event_folder
140                                    # (ie boundaries/event_number/)
141##multi_mux = False
142mux_input_filename = 'event.list'
143multi_mux = True
144
145
146################################################################################
147################################################################################
148####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
149################################################################################
150################################################################################
151
152# Get system user and host names.
153# These values can be used to distinguish between two similar runs by two
154# different users or runs by the same user on two different machines.
155user = get_user_name()
156host = get_host_name()
157
158# Environment variable names.
159# The inundation directory, not the data directory.
160ENV_INUNDATIONHOME = 'INUNDATIONHOME'
161
162# Path to MUX data
163ENV_MUXHOME = 'MUXHOME'
164
165#-------------------------------------------------------------------------------
166# Output Elevation Data
167#-------------------------------------------------------------------------------
168
169# Output filename for elevation
170# this is a combination of all the data generated in build_elevation.py
171combined_elevation_basename = scenario_name + '_combined_elevation'
172
173#-------------------------------------------------------------------------------
174# Directory Structure
175#-------------------------------------------------------------------------------
176
177# determines time for setting up output directories
178time = strftime('%Y%m%d_%H%M%S', localtime()) 
179gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
180build_time = time + '_build'
181run_time = time + '_run_'
182
183# create paths generated from environment variables.
184home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder
185muxhome = os.getenv(ENV_MUXHOME)
186   
187# check various directories/files that must exist
188anuga_folder = join(home, state, scenario_folder, 'anuga')
189topographies_folder = join(anuga_folder, 'topographies')
190polygons_folder = join(anuga_folder, 'polygons')
191boundaries_folder = join(anuga_folder, 'boundaries')
192output_folder = join(anuga_folder, 'outputs')
193gauges_folder = join(anuga_folder, 'gauges')
194meshes_folder = join(anuga_folder, 'meshes')
195event_folder = join(boundaries_folder, str(event_number))
196
197# MUX data files
198# Directory containing the MUX data files to be used with EventSelection.
199mux_data_folder = join(muxhome, 'mux')
200
201#-------------------------------------------------------------------------------
202# Location of input and output data
203#-------------------------------------------------------------------------------
204
205# Convert the user output_comment to a string for run_model.py
206output_comment = ('_'.join([str(x) for x in output_comment if x != user])
207                  + '_' + user)
208
209# The absolute pathname of the all elevation, generated in build_elevation.py
210combined_elevation = join(topographies_folder, combined_elevation_basename)
211
212# The absolute pathname of the mesh, generated in run_model.py
213meshes = join(meshes_folder, scenario_name) + '.msh'
214
215# The pathname for the urs order points, used within build_urs_boundary.py
216urs_order = join(boundaries_folder, urs_order_filename)
217
218# The absolute pathname for the landward points of the bounding polygon,
219# Used within run_model.py)
220landward_boundary = join(boundaries_folder, landward_boundary_filename)
221
222# The absolute pathname for the .sts file, generated in build_boundary.py
223event_sts = join(event_folder, scenario_name)
224
225# The absolute pathname for the output folder names
226# Used for build_elevation.py
227output_build = join(output_folder, build_time) + '_' + str(user) 
228# Used for run_model.py
229output_run = join(output_folder, run_time) + output_comment
230# Used by post processing
231output_run_time = join(output_run, scenario_name) 
232
233# The absolute pathname for the gauges file
234# Used for get_timeseries.py
235gauges = join(gauges_folder, gauges_filename)       
236
237# The absolute pathname for the building file
238# Used for run_building_inundation.py
239building_exposure = join(gauges_folder, building_exposure_filename)
240
241# full path to where MUX files (or meta-files) live
242mux_input = join(event_folder, mux_input_filename)
243
244# sts gauge with desired index number - used for wave 'Tb'
245boundary_csv = join(event_folder, 'sts_gauge_' + str(index) +'.csv')
Note: See TracBrowser for help on using the repository browser.