""" Designed from run_perth 08/08/2008 """ # -*- coding: cp1252 -*- """Common filenames and locations for topographic data, meshes and outputs. """ from os import sep, environ, getenv, getcwd from os.path import expanduser import sys from time import localtime, strftime, gmtime from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles #from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm from anuga.utilities.system_tools import get_user_name, get_host_name from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon # file and system info #--------------------------------- #codename = 'project.py' home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name() muxhome = getenv('MUXHOME') user = get_user_name() host = get_host_name() # INUNDATIONHOME is the inundation directory, not the data directory. #time stuff time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir build_time = time+'_build' run_time = time+'_run' print 'gtime: ', gtime #Making assumptions about the location of scenario data state = 'western_australia' #scenario_name = 'perth_44unitsources' scenario_name = 'onslow_2008' scenario = 'onslow_tsunami_scenario_2008' tide = 1.5 alpha = 0.1 friction=0.01 starttime=5000 finaltime=80000 export_cellsize=25 setup='trial' source='polyline' if setup =='trial': print'trial' res_factor=10 time_thinning=48 yieldstep=240 if setup =='basic': print'basic' res_factor=4 time_thinning=12 yieldstep=120 if setup =='final': print'final' res_factor=1 time_thinning=4 yieldstep=60 dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+ 'alpha' +str(alpha)+'_'+str(user) # onshore data provided by WA DLI onshore_name = 'revised_onshore_20m_dli' #revised #island island_name = 'onslow_islands_dted2' # revised # AHO + DPI data + colin French coastline coast_name = 'revised_coastline' offshore_name = 'onslow_offshore_points' offshore_name1 = 'beach_survey' offshore_name2 = 'ONS16FINAL' offshore_name3 = 'ONS17FINAL' offshore_name4 = 'ONS18FINAL' #final topo name combined_name ='onslow_combined_elevation' combined_smaller_name = 'onslow_combined_elevation_smaller' anuga_dir = home+state+sep+scenario+sep+'anuga'+sep topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep topographies_dir = anuga_dir+'topographies'+sep #topographies_time_dir = topographies_dir+build_time+sep # input topo file location onshore_in_dir_name = topographies_in_dir + onshore_name island_in_dir_name = topographies_in_dir + island_name coast_in_dir_name = topographies_in_dir + coast_name offshore_in_dir_name = topographies_in_dir + offshore_name offshore_in_dir_name1 = topographies_in_dir + offshore_name1 offshore_in_dir_name2 = topographies_in_dir + offshore_name2 offshore_in_dir_name3 = topographies_in_dir + offshore_name3 offshore_in_dir_name4 = topographies_in_dir + offshore_name4 onshore_dir_name = topographies_dir + onshore_name island_dir_name = topographies_dir + island_name coast_dir_name = topographies_dir + coast_name offshore_dir_name = topographies_dir + offshore_name offshore_dir_name1 = topographies_dir + offshore_name1 offshore_dir_name2 = topographies_dir + offshore_name2 offshore_dir_name3 = topographies_dir + offshore_name3 offshore_dir_name4 = topographies_dir + offshore_name4 #final topo files combined_dir_name = topographies_dir + combined_name #combined_time_dir_name = topographies_time_dir + combined_name combined_smaller_name_dir = topographies_dir + combined_smaller_name #combined_time_dir_final_name = topographies_time_dir + combined_final_name meshes_dir = anuga_dir+'meshes'+sep meshes_dir_name = meshes_dir + scenario_name polygons_dir = anuga_dir+'polygons'+sep tide_dir = anuga_dir+'tide_data'+sep #boundaries_source = '1' if source=='polyline': boundaries_name = 'perth_3103_28052008' #polyline gun boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'polyline'+sep+'1_10000'+sep if source=='test': boundaries_name = 'other' #polyline boundaries_in_dir = anuga_dir+'boundaries'+sep #boundaries locations boundaries_in_dir_name = boundaries_in_dir + boundaries_name boundaries_dir = anuga_dir+'boundaries'+sep boundaries_dir_name = boundaries_dir + scenario_name # what it creates??? boundaries_dir_mux = muxhome #output locations output_dir = anuga_dir+'outputs'+sep output_build_time_dir = anuga_dir+'outputs'+sep+build_time+dir_comment+sep output_run_time_dir = anuga_dir+'outputs'+sep+run_time+dir_comment+sep output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing vertex_filename = output_run_time_dir + 'mesh_vertex.csv' #gauges gauge_name = 'gauge_location_onslow.csv' gauge_name2 = 'thinned_MGA50+1.csv' gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep beach_gauges = gauges_dir + 'beach_gauges.csv' gauges_dir_name = gauges_dir + gauge_name gauges_dir_name2 = gauges_dir + gauge_name2 #buildings_filename = gauges_dir + 'Onslow_res_Project.csv' #buildings_filename_out = 'Onslow_res_Project_modified.csv' ############################### # Interior region definitions ############################### #Initial bounding polygon for data clipping poly_all = read_polygon(polygons_dir+'domain.csv') res_poly_all = 100000*res_factor #Polygon designed by 20m contours, or 3km from the coastline poly_inner_region = read_polygon(polygons_dir+'inner_region.csv') res_inner_region = 5000*res_factor #Polygon designed to cut out the rottnest island land. poly_region_50m = read_polygon(polygons_dir+'region_50m.csv') res_region_50m = 50000*res_factor #Polygon designed to incorporate Garden Island and sand bank infront of Rockingham poly_onslow_v2 = read_polygon(polygons_dir+'onslow_v2.csv') res_onslow_v2 = 500*res_factor #Polygon designed to incorporate coastline of rottnest poly_beach_left = read_polygon(polygons_dir+'beach_left.csv') res_beach_left = 200*res_factor #Polygon designed to incorporate perth and Fremantle CBD poly_beach_right = read_polygon(polygons_dir+'beach_right.csv') res_beach_right = 200*res_factor #assert zone == refzone interior_regions = [[poly_inner_region,res_inner_region],[poly_region_50m,res_region_50m] ,[poly_onslow_v2,res_onslow_v2],[poly_beach_left,res_beach_left] ,[poly_beach_right,res_beach_right]] trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) print 'min number triangles', trigs_min poly_mainland = read_polygon(topographies_in_dir+'InitialCondition_points.csv') ################################################################### # Clipping regions for export to asc and regions for clipping data ################################################################### # region to export (used from export_results.py) e_min_area = 300000 # Eastings min e_max_area = 310000 n_min_area = 7600000 n_max_area = 7610000 # for old onslow town ##e_min_area = 300000 # Eastings min ##e_max_area = 310000 ##n_min_area = 7600000 ##n_max_area = 7610000