""" This file contains all your file and directory definitions for elevation, meshes and outputs. """ import os from anuga.utilities.system_tools import get_user_name, get_host_name from time import localtime, strftime, gmtime from os.path import join, exists import anuga.utilities.log as log #------------------------------------------------------------------------------- # Directory setup #------------------------------------------------------------------------------- # this section needs to be updated to reflect the modelled community. # Note, the user needs to set up the directory system accordingly state = 'western_australia' scenario_name = 'alby_coarse' scenario_folder = 'bunbury_storm_surge_scenario_2009' #------------------------------------------------------------------------------- # Initial Conditions #------------------------------------------------------------------------------- # Model specific parameters. # One or all can be changed each time the run_model script is executed central_meridian = None # Central meridian for projection (optional) zone = 50 # UTM zone for projection event = 'alby_coarse' tide = 0 # Mean Sea Level = 0, # Highest Astronomical Tide = 0.6 m for Bunbury - CHECK THIS! alpha = 0.1 # smoothing parameter for mesh friction = 0.01 # manning's friction coefficient starttime = 86400 # start time for simulation - -equivalent to 0000h 4 April 1978 finaltime = 87840 #172800 # final time for simulation - 24 hours for TC Alby setup = 'storm_surge_final' # This can be one of four values # trial - coarsest mesh, fast # basic - coarse mesh # final - fine mesh, slowest # storm_surge_final - as 'final' but with a longer yieldstep (12 mins) #------------------------------------------------------------------------------- # Output filename # # Your output filename should be unique between different runs on different data. # The list of items below will be used to create a file in your output directory. # Your user name and time+date will be automatically added. For example, # [setup, tide, event_number] # will result in a filename like # 20090212_091046_run_final_0_27283_rwilson #------------------------------------------------------------------------------- output_comment = [setup, tide, event] # event_number will have to # change to something relevent # for storm surge #------------------------------------------------------------------------------- # Input Data #------------------------------------------------------------------------------- # ELEVATION DATA # Used in build_elevation.py # Format for ascii grids, as produced in ArcGIS + a projection file ascii_grid_filenames = ['swwa_10m_IC', # LiDAR mosaiced and resampled to 10m, clipped to IC to remove values in water 'bunbury_5m_IC'] # Bunbury LiDar grid resampled to 5 m (1m data caused memory errors) # and clipped to Initial Conditions (to remove values in water) # 'bunbury_nth_a', # 1m LiDAR from WA Dot - nothern quarter (file split as too large for dem2pts) # 'bunbury_nth_b', # 1m LiDAR from WA Dot - 2nd northmost quarter (file split as too large for dem2pts) # 'bunbury_sth_a', # 1m LiDAR from WA Dot - 2nd southmost quarter (file split as too large for dem2pts) # 'bunbury_sth_b'] # 1m LiDAR from WA Dot - southern quarter (file split as too large for dem2pts) # 'bunbury_aoi'] # 1m LiDAR from WA DoT - clipped to area_of_interest.csv # 'bunbury_nth', # 1m LiDAR from WA Dot - nothern half (file split as too large for dem2pts) # 'bunbury_sth'] # 1m LiDAR data from WA DoT - southern half # Format for point is x,y,elevation (with header) point_filenames = ['DPI.txt', # Bathymetry data from DPI 'Busselton_Chart_Clip_ss.txt', # Clipped from Busselton_Chart - see Busselton Tsunami Scenario 2009 'Busselton_NavyFinal_Clip_ss.txt', # Clipped from Busselton_NavyFinal - see Busselton Tsunami Scenario 2009 'DPI5U1A02_01a_edited.txt', # Bathymetric LiDAR from DPI - split into manageable pieces and edited so 'DPI5U1A02_01b_edited.txt', # depths below 0 m are negative, and all soundings on land (ie positive) 'DPI5U1A02_01c_edited.txt', # are removed as these are not corrected to "bare earth". 'DPI5U1A02_01d_edited.txt', 'DPI5U1A02_01e_edited.txt', 'Leschenault_TIN.txt'] # TIN created over the Leschenault Estuary and Inlet] # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh # Used in build_elevation.py & run_model.py # Format for points easting,northing (no header) bounding_polygon_filename = 'bounding_polygon_ss.csv' bounding_polygon_maxarea = 50000 # INTERIOR REGIONS - for designing the mesh # Used in run_model.py # Format for points easting,northing (no header) interior_regions_data = [['intermediate.csv', 2500], ['area_of_interest.csv', 100], ['storm_gate_area.csv', 1], ['stormgates.csv', 1]] # LAND - used to set the initial stage/water to be offcoast only # Used in run_model.py. Format for points easting,northing (no header) land_initial_conditions_filename = [['initial_conditions.csv', 0]] # GEMS order filename # Format is index,northing, easting, elevation (without header) gems_order_filename = 'gems_boundary_order_thinned.csv' # Storm gate filename # Format is as for a building file to be read by csv2building_polygons, # easting, northing, id, floors (with header) storm_gate_filename = 'storm_gates.csv' # GAUGES - for creating timeseries at a specific point # Used in get_timeseries.py. # Format easting,northing,name,elevation (with header) gauges_filename = 'gauges.csv' # BUILDINGS EXPOSURE - for identifying inundated houses # Used in run_building_inundation.py # Format latitude,longitude etc (geographic) building_exposure_filename = '' # from NEXIS # Landward bounding points # Format easting,northing (no header) landward_boundary_filename = 'landward_boundary.csv' ### MUX input filename. ### If a meta-file from EventSelection is used, set 'multi-mux' to True. ### If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False. ####mux_input_filename = event_number # to be found in event_folder ## # (ie boundaries/event_number/) ####multi_mux = False ##mux_input_filename = 'event.list' ##multi_mux = True #------------------------------------------------------------------------------- # Clipping regions for export to asc and regions for clipping data # Final inundation maps should only be created in regions of the finest mesh #------------------------------------------------------------------------------- # Elevation clip box - used when there are multiple overlapping datasets and you want to use # one over another in an area of overlap elevation_clip_box_filename = 'elevation_clip_box.csv' ################################################################################ ################################################################################ #### NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT. #### ################################################################################ ################################################################################ # Get system user and host names. # These values can be used to distinguish between two similar runs by two # different users or runs by the same user on two different machines. user = get_user_name() host = get_host_name() # Environment variable names. # The inundation directory, not the data directory. ENV_INUNDATIONHOME = 'INUNDATIONHOME' #------------------------------------------------------------------------------- # Output Elevation Data #------------------------------------------------------------------------------- # Output filename for elevation # this is a combination of all the data generated in build_elevation.py combined_elevation_basename = scenario_name + '_combined_elevation' #------------------------------------------------------------------------------- # Directory Structure #------------------------------------------------------------------------------- # determines time for setting up output directories time = strftime('%Y%m%d_%H%M%S', localtime()) gtime = strftime('%Y%m%d_%H%M%S', gmtime()) build_time = time + '_build' run_time = time + '_run_' # create paths generated from environment variables. home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder # check various directories/files that must exist anuga_folder = join(home, state, scenario_folder, 'anuga') topographies_folder = join(anuga_folder, 'topographies') polygons_folder = join(anuga_folder, 'polygons') boundaries_folder = join(anuga_folder, 'boundaries') output_folder = join(anuga_folder, 'outputs') gauges_folder = join(anuga_folder, 'gauges') event_folder = join(boundaries_folder, str(event)) #------------------------------------------------------------------------------- # Location of input and output data #------------------------------------------------------------------------------- # Convert the user output_comment to a string for run_model.py output_comment = ('_'.join([str(x) for x in output_comment if x != user]) + '_' + user) # The absolute pathname of the all elevation, generated in build_elevation.py combined_elevation = join(topographies_folder, combined_elevation_basename) # The pathname for the GEMS order points if gems_order_filename: gems_order = join(boundaries_folder, gems_order_filename) # The absolute pathname for the landward points of the bounding polygon, # Used within run_model.py) if landward_boundary_filename: landward_boundary = join(boundaries_folder, landward_boundary_filename) # The absolute pathname for the .sts file, generated in build_boundary.py event_sts = join(event_folder, scenario_name) # The absolute pathname for the output folder names # Used for build_elevation.py output_build = join(output_folder, build_time) + '_' + str(user) # Used for run_model.py output_run = join(output_folder, run_time) + output_comment # Used by post processing output_run_time = join(output_run, scenario_name) # The absolute pathname of the mesh, generated in run_model.py meshes = join(output_run, scenario_name) + '.msh' # Log file name log.log_filename = join(output_run, scenario_name) + '.log' # The absolute pathname for the storm gate file # Used for run_model.py if storm_gate_filename: storm_gate = join(polygons_folder, storm_gate_filename) # The absolute pathname for the gauges file # Used for get_timeseries.py if gauges_filename: gauges = join(gauges_folder, gauges_filename) # The absolute pathname for the building file # Used for run_building_inundation.py if building_exposure_filename: building_exposure = join(gauges_folder, building_exposure_filename) ### The absolute pathname for the image file ### Used for get_runup.py ##if images_filename: ## images = join(polygons_folder, images_filename) ### full path to where MUX files (or meta-files) live ##mux_input = join(event_folder, mux_input_filename)