""" 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 #------------------------------------------------------------------------------- # Fitting Scenario #------------------------------------------------------------------------------- extent = None #'small' #None #'sw' # 'aos1' ##'aos1' extent_maxarea = 30000 #------------------------------------------------------------------------------- # 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 = 'tasmania' scenario_name = 'hobart' scenario_folder = 'hobart_tsunami_scenario_2009' #------------------------------------------------------------------------------- # Initial Conditions #------------------------------------------------------------------------------- # Model specific parameters. # One or all can be changed each time the run_model script is executed tide = 0.8 # difference between MSL and HAT in metres zone = 55 # specify UTM zone of model event_number = 58292 # 58280, 64477 the event number or the mux file name alpha = 0.1 # smoothing parameter for mesh friction=0.01 # manning's friction coefficient starttime=0 # start time for simulation finaltime=65000 # final time for simulation setup = 'final' # This can be one of three values # trial - coarsest mesh, fast # basic - coarse mesh # final - fine mesh, slowest #------------------------------------------------------------------------------- # 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_number, extent] #------------------------------------------------------------------------------- # Input Data #------------------------------------------------------------------------------- # ELEVATION DATA # Used in build_elevation.py if extent == None: ascii_grid_filenames = ['topo_grid_notsw', 'fitting_problem_sw_elevation'] point_filenames = [] elif extent == 'sw': # Format for ascii grids, as produced in ArcGIS + a projection file ascii_grid_filenames = ['hob3_pro_extract', 'grid_250m_project', 'ldr_bbay', 'ldr_bellerive', 'ldr_brunyislandneck', 'ldr_calvertsbeach', 'ldr_carltonbeach', 'ldr_connelly', 'ldr_cremorne', 'ldr_dodge1', 'ldr_dodge2', 'ldr_kingston', 'ldr_lauderdale', 'ldr_linersfarne', 'ldr_oppossumbay', 'ldr_primrose', 'ldr_rosny', 'ldr_sandybay', 'ldr_selfspoint', 'ldr_sevenmile', 'ldr_southarm1', 'ldr_southarm2', 'ldr_sullivanscove', 'ldr_tranmere', 'tasdem_mask'] # Format for point is x,y,elevation (with header) point_filenames = ['Topo_1.txt','Topo_2.txt','Topo_3.txt', 'tasmania_data.txt', # The data from Tasmania 'hydro_data.txt'] # Data from Hydro ### Add csv header list to all files in point_filenames ##headerlist = ['x', 'y', 'elevation'] ##for f in point_filenames: ## add_csv_header(join(topographies_folder, f), headerlist) # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh # Used in build_elevation.py # Format for points easting,northing (no header) bounding_polygon_filename = 'bounding_polygon.csv' bounding_polygon_maxarea = 1000000 # INTERIOR REGIONS - for designing the mesh # Used in run_model.py # Format for points easting,northing (no header) if extent == 'sw': interior_regions_data = [['aos1.csv', 1500], ['aos2.csv', 1500]] PriorityArea_filename = 'PriorityAreas.csv' elif extent == 'aos1': interior_regions_data = [] PriorityArea_filename = 'PriorityAreas_aos1.csv' elif extent == 'aos2': interior_regions_data = [] PriorityArea_filename = 'PriorityAreas_aos2.csv' elif extent == 'small': interior_regions_data = [['aoi_bruny.csv', 500], ['aoi_S_arms.csv', 500], ['aos1_small.csv', 1500], ['aos2.csv', 1500], ['sw.csv', 30000]] PriorityArea_filename = None elif extent == None: interior_regions_data = [['aos1.csv', 1500], ['aos2.csv', 1500], ['sw.csv', 30000]] PriorityArea_filename = 'PriorityAreas.csv' # 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.txt' # GAUGES - for creating timeseries at a specific point # Used in get_timeseries.py. # Format easting,northing,name,elevation (with header) gauges_filename = 'time_of_arrival_hobart.csv' #'TideGaugesPoints.csv' #'tsunamipointsMGA.csv' # BUILDINGS EXPOSURE - for identifying inundated houses # Used in run_building_inundation.py # Format latitude,longitude etc (geographic) building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS # AREA OF IMAGES - Extent of each image to find out highest runup # Header - easting,northing,id,value # Used in get_runup.py images_filename = 'images.csv' # BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively # NOTE: when files are put together the points must be in sequence # For ease go clockwise! # Check the run_model.py for boundary_tags # Thinned ordering file from Hazard Map (geographic) # Format is index,latitude,longitude (with header) urs_order_filename = 'urs_order.csv' # 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 #------------------------------------------------------------------------------- # ASCII export grid for Bruny xminBruny = 523900 xmaxBruny = 533200 yminBruny = 5204300 ymaxBruny = 5213100 # ASCII export grid for South Arms xminSArms = 532497 xmaxSArms = 534326 yminSArms = 5237028 ymaxSArms = 5238465 # ASCII export grid for Hobart Large xminHobart = 520000 xmaxHobart = 545000 yminHobart = 5230000 ymaxHobart = 5260000 # ASCII export grid for North West Communities xminNW = 548000 xmaxNW = 561000 yminNW = 5250000 ymaxNW = 5258000 # ASCII export grid for South Communities xminSouth = 523000 xmaxSouth = 533300 yminSouth = 5197000 ymaxSouth = 5214000 ################################################################################ ################################################################################ #### 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' # Path to MUX data ENV_MUXHOME = 'MUXHOME' #------------------------------------------------------------------------------- # 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 muxhome = os.getenv(ENV_MUXHOME) # 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_number)) # MUX data files # Directory containing the MUX data files to be used with EventSelection. mux_data_folder = join(muxhome, 'mux') #------------------------------------------------------------------------------- # 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 urs order points, used within build_urs_boundary.py if urs_order_filename: urs_order = join(boundaries_folder, urs_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' # 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) #Multiple polygons in one CSV file to make internal polygons if not PriorityArea_filename == None: PriorityAreas = join(polygons_folder, PriorityArea_filename)