# -*- 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 # file and system info #--------------------------------- codename = 'project.py' home = getenv('INUNDATIONHOME') #Sandpit's parent dir user = get_user_name() # INUNDATIONHOME is the inundation directory, not the data directory. home += sep +'data' #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 tide = 0.6 #Making assumptions about the location of scenario data state = 'western_australia' scenario_name = 'busselton' scenario = 'busselton_tsunami_scenario_2006' # 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' combined_smaller_name = 'busselton_combined_elevation_smaller' 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 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 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_time_dir_name = topographies_time_dir + combined_name combined_smaller_dir_name = topographies_dir + combined_smaller_name meshes_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'meshes'+sep meshes_dir_name = meshes_dir + scenario_name polygons_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'polygons'+sep tide_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'tide_data'+sep boundaries_source = '????' #boundaries locations boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep boundaries_in_dir_name = boundaries_in_dir + scenario_name boundaries_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep boundaries_dir_name = boundaries_dir + scenario_name #boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep #boundaries_time_dir_name = boundaries_time_dir + boundaries_name #Used by post processing #output locations output_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep output_build_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+build_time+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_nexis.csv' buildings_filename_damage_out = 'busselton_res_nexis_modified.csv' ############################### # Domain definitions ############################### # bounding box for clipping MOST/URS output (much bigger than study area) # bounding polygon for study area poly_all = read_polygon(polygons_dir+'poly_all.csv') res_poly_all = 100000 ################################################################### # Clipping regions for export to asc and regions for clipping data ################################################################### # exporting asc grid eastingmin = 406215.87 eastingmax = 440208.78 northingmin = 7983427.73 northingmax = 8032834.52 ############################### # Interior region definitions ############################### #digitized polygons poly_busselton1 = read_polygon(polygons_dir+'neg20_pos10_polygon.csv') res_busselton1 = 10000 poly_busselton2 = read_polygon(polygons_dir+'neg5_pos5_poly_.csv') res_busselton2 = 500 #plot_polygons([polyAll,poly_broome1,poly_broome2,poly_broome3],'boundingpoly2',verbose=False) interior_regions = [[poly_busselton1,res_busselton1],[poly_busselton2,res_busselton2]] trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) print 'min number triangles', trigs_min