Changeset 6027
- Timestamp:
- Nov 28, 2008, 11:48:45 AM (16 years ago)
- Location:
- anuga_work/production/geraldton
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/geraldton/asc2raster_GDA94z50.py
r5929 r6027 2 2 # This python script is an ArcGIS script that can only be run on a computer 3 3 # with and ArcGIS licence and version 2.4.1 python. 4 # This script is designed to read in .asc files and deliever rasters with 4 # This script is designed to read in .asc files and deliever rasters with 5 5 # projection (GDA94z50) held in a file geodatabase (called raster) 6 6 # written by Kristy Van Putten and Ross Wilson … … 13 13 gp = arcgisscripting.create() 14 14 15 # Check out any necessary licenses 16 gp.CheckOutExtension("spatial") 17 15 18 # Load required toolboxes... 19 gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx") 16 20 gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx") 17 21 gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") 22 gp.overwriteoutput = 1 18 23 19 24 output_dir = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\" 20 21 ##Geraldton22 25 scenario_dir="geraldton_tsunami_scenario\\anuga\\outputs\\" 23 time_dir1 = "20081102_104418_run_final_0_27283_alpha0.1_kvanputt\\"24 time_dir2 = "20081102_104513_run_final_0.6_27283_alpha0.1_kvanputt\\"25 26 26 27 27 time_dirs = [time_dir1, time_dir2] 28 time_dir1 = '20081117_141443_run_final_0.6_27283_alpha0.1_kvanputt' 29 ##time_dir2 = '' 30 ##time_dir3 = '' 31 ##time_dir4 = '' 32 ##time_dir5 = '' 33 ##time_dir6 = '' 28 34 35 time_dirs = [time_dir1] #, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6] 36 29 37 for time_dir in time_dirs: 30 38 31 39 # Local variables... 32 folder = output_dir + scenario_dir + time_dir 33 raster_gbd = output_dir + scenario_dir + time_dir + 'raster.gdb' 34 40 folder = output_dir + scenario_dir + time_dir +'\\' 41 raster_gbd = folder + 'raster.gdb' 42 land = scenario_dir + "map_work\\\Geraldton.gdb\\outlines\\Clip_Topography" 43 35 44 # Process: Create File GDB... 36 45 gp.CreateFileGDB_management(folder, "raster") 37 46 38 47 gp.Workspace = raster_gbd 48 49 #print gp.Workspace 39 50 40 51 #replication dictionary 41 replicate = (('geraldton', ''), ('time_41700_0', 'b'), ('_', '')) 52 replicate = (('geraldton', ''),('_', ''),('max','M_'), 53 ('CBD', 'CDB'), 54 ('depth','_depth'),('speed', '_speed'), 55 ('elevation', '_ele_'), ('stage','_sta_')) 42 56 43 57 generate_filename = [] … … 54 68 generate_filename.append(output_DEM) 55 69 56 # Process: ASCII to Raster 70 print 'Output DEM ',output_DEM 71 output_extract = output_DEM + 'E' 72 ## print 'Output Extract ',output_extract 73 74 print 'Process: ASCII to Raster' 57 75 gp.ASCIIToRaster_conversion(infile, output_DEM, "FLOAT") 58 76 59 # Process: Define Projection77 print 'Process: Define Projection' 60 78 gp.DefineProjection_management(output_DEM, "PROJCS['GDA_1994_MGA_Zone_50',GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]" 61 79 ",PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',117.0],PARAMETER['Scale_Factor',0.9996]" 62 80 ",PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]") 63 81 82 ## print 'Process: Extract by Mask' 83 ## gp.ExtractByMask_sa(output_DEM, land, output_extract) 64 84 85 -
anuga_work/production/geraldton/build_boundary_27283.py
r5804 r6027 100 100 urs2sts(urs_filenames, 101 101 basename_out=os.path.join(project.boundaries_dir_event,scenario_name), 102 zone=50, 102 103 ordering_filename=order_filename, 103 104 weights=weights, -
anuga_work/production/geraldton/build_geraldton.py
r5789 r6027 92 92 G_coast = Geospatial_data(file_name = coast_in_dir_name) 93 93 print'create Geospatial data7 objects from topographies' 94 G_off = Geospatial_data(file_name = offshore_in_dir_name)94 G_off1 = Geospatial_data(file_name = offshore_in_dir_name) 95 95 print'create Geospatial data8 objects from topographies' 96 G_off 1= Geospatial_data(file_name = offshore_in_dir_name1)96 G_off2 = Geospatial_data(file_name = offshore_in_dir_name1) 97 97 print'create Geospatial data9 objects from topographies' 98 G_off 2= Geospatial_data(file_name = offshore_in_dir_name2)98 G_off3 = Geospatial_data(file_name = offshore_in_dir_name2) 99 99 print'create Geospatial data10 objects from topographies' 100 G_off 3= Geospatial_data(file_name = offshore_in_dir_name3)100 G_off4 = Geospatial_data(file_name = offshore_in_dir_name3) 101 101 102 102 #------------------------------------------------------------------------------- … … 105 105 106 106 print 'clipping port data to area of significance' 107 G_off2_clip = G_off2.clip(project.poly_ CBD_1km, verbose=True)107 G_off2_clip = G_off2.clip(project.poly_buffer_20m, verbose=True) 108 108 print 'add all bathymetry files' 109 109 G_off = G_off1 + G_off2_clip + G_off3 + G_off4 … … 113 113 114 114 print'add all geospatial objects' 115 G = G1_clip + G2 + G 3 + G_off_clip115 G = G1_clip + G2 + G_off_clip 116 116 117 117 print'clip combined geospatial object by bounding polygon' -
anuga_work/production/geraldton/project.py
r5829 r6027 43 43 # Model specific parameters. One or all can be changed each time the 44 44 # run_scenario script is executed 45 tide = 0.6 45 tide = 0.6 #0.6 46 46 #event_number = 27255 # Java 9.3 worst case for Perth 47 47 event_number = 68693 # Sumatra 9.2 … … 50 50 friction=0.01 # manning's friction coefficient 51 51 starttime=0 52 finaltime=80000 52 finaltime=80000 # final time for simulation 53 53 54 54 setup='final' # Final can be replaced with trial or basic. … … 56 56 # faster, but less accurate, simulation. 57 57 58 if setup =='coarse': 59 print'coarse' 60 res_factor=10000000 61 time_thinning=48 62 yieldstep=240 58 63 if setup =='trial': 59 64 print'trial' … … 100 105 gauge_name2 = 'thinned_MGA50.csv' 101 106 107 #buildings - used in run_building_inundation.py 108 building = 'geraldton_res_clip' 109 110 # barrier 111 barrier = 'CBD.csv' 112 barrier1 = 'wall.csv' 113 102 114 # BOUNDING POLYGON - used in build_boundary.py and run_geraldton.py respectively 103 115 # NOTE: when files are put together the points must be in sequence - for ease go clockwise! … … 156 168 # where the mesh sits (this is created during the run_geraldton.py) 157 169 meshes_dir_name = meshes_dir + scenario_name+'.msh' 170 barrier_dir_name = meshes_dir + barrier 171 barrier_dir_name1 = meshes_dir + barrier1 158 172 159 173 # where the boundary ordering files sit (this is used within build_boundary.py) … … 172 186 output_run_time_dir_name = output_run_time_dir + scenario_name #Used by post processing 173 187 174 # where the directory of the gauges sit188 # where the directory of the gauges sit 175 189 gauges_dir_name = gauges_dir + gauge_name #used for get_timeseries.py 176 190 gauges_dir_name2 = gauges_dir + gauge_name2 #used for get_timeseries.py 191 building_in_dir_name = gauges_dir + building + '.csv' #used for run_building_inundation.py 177 192 178 193 #------------------------------------------------------------------------------ … … 184 199 poly_mainland=read_polygon(polygons_dir +'land_initial_condition.csv') 185 200 poly_ocean=read_polygon(polygons_dir +'ocean_initial_condition.csv') 201 poly_buffer_20m=read_polygon(polygons_dir +'buffer_20m.csv') 186 202 187 203 # Initial bounding polygon for data clipping -
anuga_work/production/geraldton/run_geraldton.py
r5789 r6027 38 38 from anuga.shallow_water.data_manager import export_grid, create_sts_boundary 39 39 from anuga.pmesh.mesh_interface import create_mesh_from_regions 40 from anuga.pmesh.mesh import importMeshFromFile 40 41 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters 41 42 from anuga_parallel.parallel_abstraction import get_processor_name … … 44 45 from anuga.fit_interpolate.benchmark_least_squares import mem_usage 45 46 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 46 from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter 47 from anuga.geospatial_data.geospatial_data import find_optimal_smoothing_parameter,Geospatial_data 47 48 from polygon import Polygon_function 48 49 50 49 51 # Application specific imports 50 52 import project # Definition of file names and polygons … … 109 111 interior_regions=project.interior_regions, 110 112 filename=project.meshes_dir_name, 111 use_cache= True,113 use_cache=False, 112 114 verbose=True) 115 116 m = importMeshFromFile(project.meshes_dir_name) 117 # load points from a points file 118 m.add_points_and_segments(Geospatial_data(project.barrier_dir_name)) 119 m.add_points_and_segments(Geospatial_data(project.barrier_dir_name1)) 120 m.generate_mesh() 121 m.export_mesh_file(project.meshes_dir_name) 113 122 114 123 #------------------------------------------------------------------------- … … 224 233 225 234 kwargs={} 235 kwargs['file_name']=project.dir_comment 226 236 kwargs['finaltime']=project.finaltime 227 237 kwargs['output_dir']=project.output_run_time_dir -
anuga_work/production/geraldton/run_geraldton_250m.py
r5789 r6027 224 224 225 225 kwargs={} 226 kwargs['file_name']=project.dir_comment 226 227 kwargs['finaltime']=project_250m.finaltime 227 228 kwargs['output_dir']=project_250m.output_run_time_dir
Note: See TracChangeset
for help on using the changeset viewer.