# -*- 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 # file and system info #--------------------------------- #codename = 'project.py' home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent diruser = get_user_name() 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 = 'sw_pacific' scenario_name = 'Kolonia_fixed_wave' scenario = 'FSM' tide =0 alpha = 0.1 friction=0.01 starttime=10000 midtime=21600 finaltime=10000 export_cellsize=50 setup='final' source='test' 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(scenario_name)+'_'+str(user) # onshore data 5m countour onshore_name = 'lidar_data_5m' # original' onshore_name1 = 'topo_25m' # AHO + DPI data + colin French coastline #coast_name = 'waterline' Multibeam_name = 'multibeam' added_data_name='sandedge' #final topo name combined_name ='Kolonia_combined_elevation' combined_smaller_name = 'Kolonia_combined_elevation_smaller' combined_name1 ='Kolonia_combined_elevation1' 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 = 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 onshore_in_dir_name1 = topographies_in_dir + onshore_name1 Multibeam_in_dir_name = topographies_in_dir + Multibeam_name added_data_in_dir_name = topographies_in_dir + added_data_name onshore_dir_name = topographies_dir + onshore_name onshore_dir_name1 = topographies_dir + onshore_name1 Multibeam_dir_name = topographies_dir + Multibeam_name added_data_dir_name = topographies_dir + added_data_name #final topo files combined_dir_name = topographies_dir + combined_name combined_dir_name1 = topographies_dir + combined_name1 #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 =='dampier': boundaries_name = 'broome_3854_17042007' #Dampier gun boundaries_in_dir = anuga_dir+'boundaries'+sep+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+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+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 + scenario_name boundaries_dir = anuga_dir+'boundaries'+sep boundaries_dir_name = boundaries_dir + scenario_name #boundaries_time_dir = anuga_dir+'boundaries'+sep+build_time+sep #boundaries_time_dir_name = boundaries_time_dir + boundaries_name #Used by post processing #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 #gauges #gauge_name = 'perth.csv' #gauges_dir = anuga_dir+'gauges'+sep #gauges_dir_name = gauges_dir + gauge_name #buildings_filename = gauges_dir + 'Perth_res_Project.csv' #buildings_filename_out = 'Perth_res_Project_modified.csv' ############################### # Domain definitions ############################### from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon poly_all = read_polygon(polygons_dir+'extent.txt') res_poly_all = 5000*res_factor #refzone = 50 ############################### # Interior region definitions ############################### poly_west_reef = read_polygon(polygons_dir+'poly_lidar1.txt') poly_west = read_polygon(polygons_dir+'poly_lidar4.txt') poly_centerKolonia = read_polygon(polygons_dir+'poly_lidar2.txt') poly_east = read_polygon(polygons_dir+'poly_lidar3.txt') kolonia_res = 5000 fine_res = 100 interior_regions = [[poly_west_reef, kolonia_res], [poly_west,kolonia_res], [poly_centerKolonia,fine_res], [poly_east,kolonia_res]] boundary_tags={'lagoon_west':[0], 'Reef_edge':[1,2,3,4,5,6,7,8,9,10,11,12,13,14], 'East&land':[15,16,17], 'Land':[18,19]} 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 = 403481 eastingmax = 415706 northingmin = 766423 northingmax = 776418