# -*- 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 #--------------------------------- 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. #needed when running using mpirun, mpirun doesn't inherit umask from .bashrc umask(002) #time stuff time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir build_time = time+'_build' run_time = time+'_run' tide = 0.6 #Making assumptions about the location of scenario data state = 'western_australia' scenario_name = 'busselton' scenario = 'busselton_tsunami_scenario_2006' #Maybe will try to make project a class to allow these parameters to be passed in. alpha = 0.1 friction=0.01 starttime=10000 midtime=21600 finaltime=25000 export_cellsize=50 setup='final' source='other' 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)+'_'+str(user) # onshore data provided by WA DLI onshore_name = 'DLI_orthophoto_DEM' # original #islands # AHO + DPI data coast_name = '100k_coastline' offshore_name = 'Bathymetry' #final topo name combined_name ='busselton_combined_elevation.pts' combined_smaller_name = 'busselton_combined_elevation_smaller' anuga_dir = home+state+sep+scenario+sep+'anuga'+sep topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+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 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 #final topo files combined_dir_name = topographies_dir + combined_name combined_smaller_dir_name = topographies_dir + combined_smaller_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 if source =='dampier': boundaries_name = 'broome_3854_17042007' #Dampier gun boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep if source=='onslow': boundaries_name = 'broome_3859_16052007' #onslow_hedland_broome gun boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'onslow_hedland_broome'+sep+'1_10000'+sep if source=='exmouth': boundaries_name = 'broome_3103_18052007' #exmouth gun boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep if source=='other': boundaries_name = 'other' #exmouth gun boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+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+build_time+'_'+source+sep #output_run_time_dir = output_dir +run_time+dir_comment+sep output_run_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+run_time+sep output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing #gauges gauge_name = '???.csv' gauges_dir = home+sep+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 ################################################################### # Clipping regions for export to asc and regions for clipping data ################################################################### # exporting asc grid eastingmin = 340000 eastingmax = 350000 northingmin = 6273400 northingmax = 6277700 ############################### # Interior region definitions ############################### #digitized polygons poly_busselton1 = read_polygon(polygons_dir+'neg20_pos10_polygon.csv') res_busselton1 = 10000*res_factor poly_busselton2 = read_polygon(polygons_dir+'neg5_pos5_poly_.csv') res_busselton2 = 500*res_factor #plot_polygons([polyAll,poly_broome1,poly_broome2,poly_broome3],figname='boundingpoly2',verbose=False) interior_regions = [[poly_busselton1,res_busselton1],[poly_busselton2,res_busselton2]] boundary_tags={'back': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14], 'side': [10,13], 'ocean': [11, 12]} trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) poly_mainland=read_polygon(polygons_dir+'initial_condition_south.csv') print 'min number triangles', trigs_min