# -*- coding: cp1252 -*- """Common filenames and locations for topographic data, meshes and outputs. """ from os import sep, environ, getenv, getcwd ,umask 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 # file and system info #--------------------------------- #codename = 'project.py' home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir 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 = 'busselton' scenario = 'busselton_tsunami_scenario' tide = 0.6 alpha = 0.1 #changed for testing purposes friction=0.01 starttime=0 finaltime=50000 # changed for rev_number trial export_cellsize=25 setup='trial' source='exmouth' 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 rev_num = '5447' #rev_num = '4695' # 2nd Sept 2007 #rev_num = '4743' # 3nd Oct 2007 #rev_num = '4777' # 1st Nov 2007 #rev_num = '4874' # 3rd Dec 2007 #rev_num = '4901' # 3rd Jan 2007 #rev_num = '4990' # 5th Feb 2007 #rev_num = '5103' # 3rd March 2007 #rev_num = '5185' # 1st April 2007 #rev_num = '5273' # 2nd May 2007 dir_comment='_'+setup+'_'+str(tide)+'_'+str(source)+'_'+str(rev_num)+'_'+str(user) # onshore data provided by WA DLI - provided by Hamish on the 17th June 2008 onshore_name = 'busselton_v2_gda94_mga50' # original # AHO + DPI data coast_name = 'Contour_0' # provided by hamish, represent better coastline than the 100km as compared to charts coast_name1 = 'beach_survey_final' offshore_name = 'Bathymetry_final' offshore_name1 = 'Busselton_Chart' offshore_name2 = 'Busselton_Digitised' #final topo name combined_name ='busselton_combined_elevation' combined_name_small = 'busselton_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 # input topo file location onshore_in_dir_name = topographies_in_dir + onshore_name #topo coast_in_dir_name = topographies_in_dir + coast_name #coastline coast_in_dir_name1 = topographies_in_dir + coast_name1 #beach survey offshore_in_dir_name = topographies_in_dir + offshore_name #bathymetry offshore_in_dir_name1 = topographies_in_dir + offshore_name1 #bathymetry Charts offshore_in_dir_name2 = topographies_in_dir + offshore_name2 #Digitised Fairsheet #output to anuga from build file onshore_dir_name = topographies_dir + onshore_name coast_dir_name = topographies_dir + coast_name coast_dir_name1 = topographies_dir + coast_name1 offshore_dir_name = topographies_dir + offshore_name offshore_dir_name1 = topographies_dir + offshore_name1 offshore_dir_name2 = topographies_dir + offshore_name2 #final topo files combined_dir_name = topographies_dir + combined_name combined_dir_name_small = topographies_dir + combined_name_small 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=='exmouth': boundaries_name = 'busselton_3103_30052008' #exmouth gun boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep if source=='test': boundaries_name = 'other' #exmouth gun 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 #output locations output_dir = anuga_dir+'outputs'+sep output_build_time_dir = output_dir +'test'+sep + build_time + dir_comment + sep #output_run_time_dir = output_dir +run_time+dir_comment+sep output_run_time_dir = output_dir +'test'+sep + run_time + dir_comment +sep # take test out output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing #gauges gauge_name = 'busselton.csv' gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep gauges_dir_name = gauges_dir + gauge_name buildings_filename = gauges_dir + 'Busselton_res_Project.csv' buildings_filename_out = 'Busselton_res_Project_modified.csv' community_filename = gauges_dir +'' community_broome = gauges_dir + '' ############################### # Domain definitions ############################### from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon # bounding polygon for study area poly_all = read_polygon(polygons_dir+'poly_all.csv') res_poly_all = 100000*res_factor ############################### # Interior region definitions ############################### #digitized polygons poly_large = read_polygon(polygons_dir+'coast_5km_d20m.csv') res_large = 40000*res_factor poly_busselton = read_polygon(polygons_dir+'busselton_1km.csv') res_busselton = 500*res_factor poly_bunbury = read_polygon(polygons_dir+'bunbury_1km.csv') res_bunbury = 500*res_factor poly_dunsborough = read_polygon(polygons_dir+'dunsborough_1km.csv') res_dunsborough = 500*res_factor poly_busselton2 = read_polygon(polygons_dir+'busselton_2km.csv') res_busselton2 = 10000*res_factor poly_bunbury2 = read_polygon(polygons_dir+'bunbury_2km.csv') res_bunbury2 = 10000*res_factor interior_regions = [[poly_large,res_large],[poly_busselton,res_busselton],[poly_bunbury,res_bunbury] ,[poly_dunsborough,res_dunsborough],[poly_busselton2,res_busselton2] ,[poly_bunbury2,res_bunbury2]] boundary_tags={'back': [0, 1, 2, 3, 4, 9], 'side': [5], 'ocean': [6, 7, 8]} trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) poly_mainland=read_polygon(polygons_dir+'initial_condition.csv') print 'min number triangles', trigs_min ################################################################### # Clipping regions for export to asc and regions for clipping data ################################################################### # exporting asc grid for Busselton xminBusselton = 340000 xmaxBusselton = 352000 yminBusselton = 6271500 ymaxBusselton = 6280000 # exporting asc grid for Bunbury xminBunbury = 369000 xmaxBunbury = 381000 yminBunbury = 6308000 ymaxBunbury = 6308000 # exporting asc grid for Dunsborough xminDunsborough = 321000 xmaxDunsborough = 327500 yminDunsborough = 6277000 ymaxDunsborough = 6282000