# -*- 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 = 'perth' scenario = 'perth_tsunami_scenario_2006' # onshore data provided by WA DLI onshore_name = 'perth_dli_ext' # original #island island_name = 'rott_dli_ext' # original island_name1 = 'gard_dli_ext' island_name2 = 'carnac_island_dted' island_name3 = 'penguin_dted' # AHO + DPI data + colin French coastline coast_name = 'waterline' offshore_name = 'perth_bathymetry' offshore1_name = 'missing_fairsheets' #final topo name combined_name ='perth_combined_elevation' combined_smaller_name = 'perth_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 island_in_dir_name1 = topographies_in_dir + island_name1 island_in_dir_name2 = topographies_in_dir + island_name2 island_in_dir_name3 = topographies_in_dir + island_name3 coast_in_dir_name = topographies_in_dir + coast_name offshore_in_dir_name = topographies_in_dir + offshore_name offshore1_in_dir_name = topographies_in_dir + offshore1_name onshore_dir_name = topographies_dir + onshore_name island_dir_name = topographies_dir + island_name island_dir_name1 = topographies_dir + island_name1 island_dir_name2 = topographies_dir + island_name2 island_dir_name3 = topographies_dir + island_name3 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_name_dir = topographies_dir + combined_smaller_name #combined_time_dir_final_name = topographies_time_dir + combined_final_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 = 'perth.csv' gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep gauges_dir_name = gauges_dir + gauge_name ############################### # Domain definitions ############################### from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon poly_all = read_polygon(polygons_dir+'bounding_poly.csv') res_poly_all = 100000 refzone = 50 ############################### # Interior region definitions ############################### #poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20pts.csv') poly_pos20_neg20 = read_polygon(polygons_dir+'pos20_neg20_new_pts.csv') res_pos20_neg20 = 20000 #poly_cbd = read_polygon(polygons_dir+'cbd_pts.csv') poly_cbd = read_polygon(polygons_dir+'cbd_new_pts.csv') res_cbd = 1000 poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv') res_penguin = 1000 #assert zone == refzone interior_regions = [[poly_pos20_neg20,res_pos20_neg20],[poly_cbd,res_cbd] ,[poly_penguin,res_penguin]] trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) print 'min number triangles', trigs_min ################################################################### # 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