# -*- 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, polygon_area from anuga.utilities.system_tools import get_user_name # file and system info #--------------------------------- codename = 'project.py' #used in copy_code_files home = getenv('INUNDATIONHOME') #Sandpit's parent dir user = get_user_name() #needed when running using mpirun, mpirun doesn't inherit umask from .bashrc umask(002) print home # INUNDATIONHOME is the inundation directory, not the data directory. home =home + sep +'data' time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir build_time = time+'_build' run_time = time+'_run' print 'time: ', time tide = 0.0 #Making assumptions about the location of scenario data state = 'sri_lanka' scenario_name = 'galle' scenario = 'scenario_galle' ''' # onshore data provided by WA DLI onshore_name = 'DLI_DTED_raster_clipped' # original # AHO + DPI data + colin French coastline coast_name = 'coastline_edited_w_DEM' offshore_name = 'clipped_bathy' offshore1_name = 'elev_501' offshore2_name = 'inferrec_e' #final topo name combined_name ='dampier_combined_elevation' combined_smaller_name = 'dampier_combined_elevation_small' combined_smallest_name = 'dampier_combined_elevation_smallest' ''' anuga_dir = home+sep+state+sep+scenario+sep+'anuga'+sep #topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+ topographies_dir = anuga_dir+'topographies'+sep # Filenames #data_dir = 'deliverables' + sep + 'points' + sep galle_dem_name = topographies_dir + 'galle' hikka_dem_name = topographies_dir + 'hikka' coast_name = topographies_dir + 'Coast' topo_dem_name = topographies_dir + 'topo' bathycoa_dem_name = topographies_dir + 'bathycoa' bathyfine_dem_name = topographies_dir + 'bathyfine' canal_dem_name = topographies_dir + 'canal' fort_dem_name = topographies_dir + 'gallefort' combined_dem_name = topographies_dir + 'combined' combined_canal_dem_name = topographies_dir + 'combined_canal' combined_small_dem_name = topographies_dir + 'combined_small' combined_canal_fort_dem_name = topographies_dir + 'combined_canal_fort' polygons_dir = anuga_dir+'polygons'+sep meshes_dir = anuga_dir+'meshes'+sep meshes_dir_name = meshes_dir + scenario_name #boundaries locations boundaries_name = 'Sumatra2004_crop' boundaries_in_dir = anuga_dir+'boundaries'+sep+'most'+sep boundaries_in_dir_name = boundaries_in_dir + boundaries_name boundaries_dir = anuga_dir+'boundaries'+sep boundaries_dir_name = boundaries_dir + boundaries_name #output locations output_dir = anuga_dir+'outputs'+sep output_build_time_dir = output_dir+build_time+sep output_run_time_dir = output_dir +run_time+sep output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing ############################### # Domain definitions ############################### # poly_clip is used to remove small part from the large coarse 100m data set, # this hole is then filled with the high res 5m data print 'poly dir',polygons_dir poly_clip = read_polygon(polygons_dir+ 'poly.csv') # bounding polygon for study area bounding_polygon = read_polygon(polygons_dir+'regional.csv') res_factor=1 regional_res = 100000*res_factor print 'Area of bounding polygon', polygon_area(bounding_polygon)/1000000.0 ############################### # Interior region definitions ############################### # interior polygons #poly_shallow1 = read_polygon(polygons_dir+'hikkaduwa.csv') #poly_shallow2 = read_polygon(polygons_dir+'galle.csv') poly_intermediate = read_polygon(polygons_dir+'intermediate.csv') poly_shallow = read_polygon(polygons_dir+'shallow.csv') poly_coast = read_polygon(polygons_dir+'coastmesh.csv') poly_canal = read_polygon(polygons_dir+'canalmesh.csv') intermediate_res = 20000*res_factor shallow_res = 2000*res_factor coast_res = 250*res_factor canal_res = 10*res_factor interior_regions = [[poly_intermediate, intermediate_res], [poly_shallow, shallow_res], [poly_coast, coast_res], [poly_canal, canal_res]] #plot_polygons([bounding_polygon,poly_intermediate,\ # poly_shallow,poly_coast,poly_canal],\ # figname='boundingpoly',verbose=False) trigs_min = number_mesh_triangles(interior_regions, bounding_polygon, regional_res) print 'min number triangles', trigs_min poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv') ################################################################### # Clipping regions for export to asc and regions for clipping data ################################################################### # exporting asc grid #eastingmin = 363000 #eastingmax = 418000 #northingmin = 8026600 #northingmax = 8145700 #for clipping (most) boundary file #south_source = #north_source = #west_source = #east_source = #gauge_filename = 'gauges.csv'