"""Common filenames and locations for topographic data, meshes and outputs. Also includes origin for slump scenario. """ from os import sep, environ, getenv, getcwd from os.path import expanduser, basename from utilities.polygon import read_polygon import sys from pmesh.create_mesh import convert_points_from_latlon_to_utm from coordinate_transforms.redfearn import degminsec2decimal_degrees from time import localtime, strftime from geospatial_data import * #Making assumptions about the location of scenario data scenario_dir_name = 'pt_hedland_tsunami_scenario_2006' # onshore data from 30m DTED level 2 onshore_name = 'pt_hedland_onshore_30m_dted' # get from Neil/Ingo (DEM or topo data) # offshore data from GA digitised charts offshore_name1 = 'pt_hedland_offshore_points' # offshore data from AHO fairsheets offshore_name2 = 'pt_hedland_offshore_points_fairsheet' # coastline developed from 30m DTED coast_name = 'pt_hedland_coastline_points.xya' boundary_basename = 'SU-AU_clip' #swollen/ all data output basename = 'source' codename = 'project.py' if sys.platform == 'win32': home = getenv('INUNDATIONHOME') # python_home = getenv('PWD') # home = environ['INUNDATIONHOME'] #Sandpit's parent dir #user = basename(getenv('USERPROFILE')) #print 'USER:', user else: home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation') user = getenv('LOGNAME') print 'USER:', user #Derive subdirectories and filenames time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir #print 'home', home outputtimedir = home+sep+scenario_dir_name+sep+'output'+sep+time+sep #print 'outputtimedir', outputtimedir meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep datadir = home+sep+scenario_dir_name+sep+'topographies'+sep gaugedir = home+sep+scenario_dir_name+sep+'gauges'+sep polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep #output dir without time outputdir = home+sep+scenario_dir_name+sep+'output'+sep tidedir = home+sep+scenario_dir_name+sep+'tide_data'+sep #print'bound', boundarydir #gauge_filename = gaugedir + 'onslow_gauges.xya' #for MOST #gauge_filename = gaugedir + 'pt_hedland_gauges.xya' gauge_filename = gaugedir + 'gauge_location_port_hedland.csv' buildings_filename = gaugedir + 'pt_hedland_res.csv' community_filename = gaugedir + 'CHINS_v2.csv' community_scenario = gaugedir + 'community_pt_hedland.csv' tidal_filename = tidedir + 'pt_hedland_tide.txt' coast_filename = datadir + coast_name # boundary source data #MOST_dir = 'f:'+sep+'3'+sep+'ehn'+sep+'users'+sep+'davidb'+sep+'tsunami'+sep+'WA_project'+sep+'SU-AU_90'+sep+'most_2'+sep+'detailed'+sep #print 'name', __name__ #print 'path', __file__ #codedir = getcwd()+sep #project_code_name = __name__ #project_code_dir_name = __file__ meshname = meshdir + basename onshore_dem_name = datadir + onshore_name offshore_dem_name1 = datadir + offshore_name1 offshore_dem_name2 = datadir + offshore_name2 combined_dem_name = datadir + 'pt_hedland_combined_elevation' outputname = outputtimedir + basename #Used by post processing # clipping region to make DEM (pts file) from onshore data eastingmin = 594000 eastingmax = 715000 northingmin = 7720000 northingmax = 7880000 # for ferret2sww south = degminsec2decimal_degrees(-20,30,0) north = degminsec2decimal_degrees(-17,10,0) west = degminsec2decimal_degrees(117,00,0) east = degminsec2decimal_degrees(120,00,0) # region to export (used from export_results.py) e_min_area = 659000#633000 e_max_area = 678000#690000 n_min_area = 7746000#7740000 n_max_area = 7757000#7761000 refzone = 50 # confirm with Hamish # bounding polygon provided by Hamish #d0 = [818732.55, 8062768.27] """ old d0 = [755000.0, 8025000.0] d1 = [708940.32, 7750510.33] d2 = [656561.15, 7732615.11] d3 = [604415.81, 7733013.56] d4 = [517682.34, 7899310.22] """ d0 = [763852.0, 7934358.0] d1 = [710987.0, 7925797.0] d2 = [658264.0, 7926314.0] d3 = [552686.0, 7871580.0] #d4 = [604415.81, 7733013.56] d4 = [638000.0, 7733013.56] #d5 = [656561.15, 7732615.11] d5 = [662000.0, 7732615.11] #d6 = [708940.32, 7750510.33] d6 = [690000.0, 7740510.33] polyAll = [d0, d1, d2, d3, d4, d5, d6] #Interior region - Pt Hedland town i0 = [668000, 7757000] i1 = [659000, 7755000] i2 = [660000, 7749000] i3 = [667000, 7746000] i4 = [678000, 7751000] poly_pt_hedland = [i0, i1, i2, i3, i4] #Are there other significant features? j0 = [670000, 7760000] j1 = [633000, 7745000] j2 = [665000, 7743000] j3 = [690000, 7755000] poly_region = [j0, j1, j2, j3] coast_buffer_file = datadir+'pts2ascii_test.xya' G = Geospatial_data(file_name=coast_buffer_file,delimiter=' ') poly_coast = list(G.get_data_points()) #print 'get_data_points()',G.get_data_points() #print 'get_',poly_region