Changeset 6032
- Timestamp:
- Nov 28, 2008, 11:54:56 AM (16 years ago)
- Location:
- anuga_work/production/perth
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/perth/asc2raster_GDA94z50.py
r5943 r6032 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") 18 22 gp.overwriteoutput = 1 19 23 20 output_dir = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\"21 scenario_dir="perth_tsunami_scenario\\anuga\\outputs\\"24 scenario_dir="\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\perth_tsunami_scenario\\" 25 output_dir = "anuga\\outputs\\" 22 26 23 27 24 28 time_dir1 = '20081031_133353_run_final_0.6_68693_alpha0.1_kvanputt' 25 time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt'26 time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt'27 time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt'28 time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt'29 time_dir6 = '20081031_133925_run_final_0.6_27283_alpha0.1_kvanputt'29 ##time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt' 30 ##time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt' 31 ##time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt' 32 ##time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt' 33 ##time_dir6 = '20081031_133925_run_final_0.6_27283_alpha0.1_kvanputt' 30 34 31 35 32 time_dirs = [time_dir1 , time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]36 time_dirs = [time_dir1]#, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6] 33 37 34 38 for time_dir in time_dirs: 35 39 36 40 # Local variables... 37 folder = output_dir + scenario_dir + time_dir + '\\'41 folder = scenario_dir + output_dir + time_dir + '\\' 38 42 raster_gbd = folder + 'raster.gdb' 43 land = scenario_dir + "map_work\\Perth.gdb\\poly_all_cut" 39 44 40 45 # Process: Create File GDB... 41 gp.CreateFileGDB_management(folder, "raster")46 #gp.CreateFileGDB_management(folder, "raster") 42 47 43 48 gp.Workspace = raster_gbd … … 47 52 #replication dictionary 48 53 replicate = (('perth', ''),('time_39900_0', 'b'), ('time_79800_0', 'c'), 49 ('_', ''),('Geordie', 'Geo'),('Sorrento', 'Sor'), 50 ('Fremantle', 'Fre'),('Rockingham', 'Roc'),('depth','_dep th'),51 ('speed', '_spe ed'), ('elevation', '_elev_'), ('stage','_stage'))54 ('_', ''),('Geordie', 'Geo'),('Sorrento', 'Sor'), ('max','M_'), 55 ('Fremantle', 'Fre'),('Rockingham', 'Roc'),('depth','_dep_'), 56 ('speed', '_spe_'), ('elevation', '_ele_'), ('stage','_sta_')) 52 57 53 58 generate_filename = [] 54 input_ascii = glob.glob(folder + '* max.asc')59 input_ascii = glob.glob(folder + '*elevation.asc') 55 60 56 61 for infile in input_ascii: … … 63 68 sys.exit(10) 64 69 generate_filename.append(output_DEM) 65 66 #print 'input %s and output %s' %(infile,output_DEM) 67 68 # Process: ASCII to Raster (4)... 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' 69 75 gp.ASCIIToRaster_conversion(infile, output_DEM, "FLOAT") 70 76 71 # Process: Define Projection (3)...77 print 'Process: Define Projection' 72 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]]" 73 79 ",PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',117.0],PARAMETER['Scale_Factor',0.9996]" 74 80 ",PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]") 75 81 82 ## print 'Process: Extract by Mask' 83 ## gp.ExtractByMask_sa(output_DEM, land, output_extract) 76 84 77 85 -
anuga_work/production/perth/export_results_max.py
r5952 r6032 13 13 import project, os 14 14 import sys 15 from anuga.lib.maxasc.maxasc import MaxAsc 15 16 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 16 17 from anuga.shallow_water.data_manager import sww2dem 17 18 from os import sep 18 import maxasc19 19 20 20 directory = project.output_dir … … 27 27 28 28 time_dir1 = '20081031_133353_run_final_0.6_68693_alpha0.1_kvanputt' 29 time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt'30 time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt'31 time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt'32 time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt'33 time_dir6 = '20081031_133925_run_final_0.6_27283_alpha0.1_kvanputt'29 ##time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt' 30 ##time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt' 31 ##time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt' 32 ##time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt' 33 ##time_dir6 = '20081031_133925_run_final_0.6_27283_alpha0.1_kvanputt' 34 34 35 time_dirs = [time_dir1 , time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]35 time_dirs = [time_dir1]#, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6] 36 36 37 37 … … 40 40 #cellsize = 250 41 41 42 timestep = None # None means no timestep!43 #timestep = 042 #timestep = None # None means no timestep! 43 timestep = 0 44 44 45 45 ###### … … 47 47 ###### 48 48 49 area = ['Rockingham', 'Sorrento', 'Fremantle','Geordie' ] # strings must match keys in var_equations below50 #area = ['All'] # 'All' means no special areas - the whole thing49 #area = ['Perth'] #Rockingham', 'Sorrento', 'Fremantle','Geordie' ] # strings must match keys in var_equations below 50 area = ['All'] # 'All' means no special areas - the whole thing 51 51 52 52 ###### … … 61 61 62 62 # one or more key strings from var_equations above 63 var = [' depth', 'speed']63 var = ['elevation'] 64 64 65 65 ###### … … 91 91 92 92 name1 = directory+time_dir+sep+project.scenario_name 93 name2 = directory+time_dir+sep+project.scenario_name+'_time_39900_0'94 name3 = directory+time_dir+sep+project.scenario_name+'_time_79800_0'93 #name2 = directory+time_dir+sep+project.scenario_name+'_time_39180_0' 94 #name3 = directory+time_dir+sep+project.scenario_name+'_time_78360_0' 95 95 96 names = [name1 , name2, name3]96 names = [name1] #, name2, name3] 97 97 98 98 asc_name = [] -
anuga_work/production/perth/get_timeseries.py
r5761 r6032 12 12 """ 13 13 14 from os import sep 14 from os import sep, rename, listdir, system 15 15 from anuga.abstract_2d_finite_volumes.util import sww2csv_gauges,csv2timeseries_graphs 16 16 import project 17 17 18 timestamp1='20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt' 19 timestamp2='20080815_103336_run_final_0.6_polyline_alpha0.1_kvanputt' 18 directory = project.output_dir 20 19 21 timestamps = [timestamp1, timestamp2] 22 for timestamp in timestamps: 20 ##time_dir1 = '20081031_133353_run_final_0.6_68693_alpha0.1_kvanputt' 21 ##time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt' 22 ##time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt' 23 ##time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt' 24 ##time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt' 25 time_dir6 = '20081117_141914_run_final_0.6_27283_Rockingham_kvanputt' 23 26 24 filename1=project.output_dir+timestamp+sep+project.scenario_name+'.sww' 25 filename2=project.output_dir+timestamp+sep+'sww2'+sep+project.scenario_name+'_time_39900_0.sww' 27 time_dirs = [time_dir6] #1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6] 26 28 27 filenames = [filename1, filename2] 28 for filename in filenames: 29 for time_dir in time_dirs: 30 31 name1 = directory+time_dir+sep+project.scenario_name 32 name2 = directory+time_dir+sep+project.scenario_name+'_time_43380_0' 33 #name3 = directory+time_dir+sep+project.scenario_name+'_time_78360_0' 29 34 30 gauges = [project.gauges_dir_name, project.gauges_dir_name2] 31 for gauge in gauges: 32 33 sww2csv_gauges(filename,gauge, 34 quantities = ['stage','speed','depth','elevation'], 35 verbose=True) 36 35 names = [name1, name2] #, name3] 37 36 38 39 40 37 for i, name in enumerate(names): 38 gauge = project.gauges_dir_name 39 out_name = 'gauge_%d_' % i 40 sww2csv_gauges(name+'.sww',gauge,out_name = out_name, 41 quantities = ['stage','speed','depth','elevation'], 42 verbose=True) 43 ## for out_name in listdir(directory+time_dir): 44 ## #total_filename = directory+time_dir+sep+'All_' + out_name 45 ## if i == 0: 46 ## 47 ## else: 48 ## system('cat %s %s > %s' %(,out_name,)) 49 ## -
anuga_work/production/perth/project.py
r5829 r6032 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 event_number = 68693 # Sumatra 9.248 #event_number = 27283 # Java 9.3 original47 #event_number = 68693 # Sumatra 9.2 48 event_number = 27283 # Java 9.3 original 49 49 alpha = 0.1 # smoothing parameter for mesh 50 50 friction=0.01 # manning's friction coefficient … … 77 77 # Important to distinguish each run - ensure str(user) is included! 78 78 # Note, the user is free to include as many parameters as desired 79 dir_comment='_'+setup+'_'+str(tide)+'_'+str(event_number)+'_'+ ' alpha' +str(alpha)+'_'+str(user)79 dir_comment='_'+setup+'_'+str(tide)+'_'+str(event_number)+'_'+ 'Rockingham_'+str(user) 80 80 81 81 #------------------------------------------------------------------------------ … … 101 101 # gauges - used in get_timeseries.py 102 102 gauge_name = 'perth.csv' 103 gauge_name2 = 'thinned_MGA50.csv' 103 104 #buildings - used in run_building_inundation.py 105 building = 'perth_res_combined' 106 104 107 105 108 # BOUNDING POLYGON - used in build_boundary.py and run_perth.py respectively … … 182 185 183 186 #w here the directory of the gauges sit 184 gauges_dir_name = gauges_dir + gauge_name 185 gauges_dir_name2 = gauges_dir + gauge_name2 #used for get_timeseries.py187 gauges_dir_name = gauges_dir + gauge_name #used for get_timeseries.py 188 building_in_dir_name = gauges_dir + building + '.csv' #used for run_building_inundation.py 186 189 187 190 #------------------------------------------------------------------------------ … … 205 208 res_poly_all = 100000*res_factor 206 209 210 ### Area of Interest 1 (Fremantle, increase to reach Perth) 211 ##poly_aoi1 = read_polygon(polygons_dir+'CBD_increase.csv') 212 ##res_aoi1 = 500*res_factor 213 207 214 # Area of Interest 1 (Fremantle) 208 215 poly_aoi1 = read_polygon(polygons_dir+'CBD_coastal.csv') … … 210 217 211 218 # Area of Interest 2 (Rockingham) 219 poly_aoi2 = read_polygon(polygons_dir+'rockingham_penguin_increase.csv') 220 res_aoi2 = 500*res_factor 221 222 # Area of Interest 2 (Rockingham) 212 223 poly_aoi2 = read_polygon(polygons_dir+'rockingham_penguin.csv') 213 224 res_aoi2 = 500*res_factor … … 226 237 227 238 # Area of Significance 1 (Garden Island and sand bank infront of Rockingham) 228 poly_aos1 = read_polygon(polygons_dir+'garden_rockingham .csv')239 poly_aos1 = read_polygon(polygons_dir+'garden_rockingham_increase.csv') 229 240 res_aos1 = 1000*res_factor 230 241 … … 248 259 249 260 # Combined all regions, must check that all are included! 261 ##interior_regions = [[poly_aoi2,res_aoi2], [poly_aos1,res_aos1] 262 ## ,[poly_aos2,res_aos2],[poly_aos3,res_aos3] 263 ## ,[poly_sw1,res_sw1], [poly_dw1,res_dw1]] 264 250 265 interior_regions = [[poly_aoi1,res_aoi1],[poly_aoi2,res_aoi2] 251 266 ,[poly_aoi2a,res_aoi2a],[poly_aoi3,res_aoi3] … … 287 302 ymaxRockingham = 6433000 288 303 304 #Fremantle and Perth extract ascii grid 305 xminPerth = 376000 306 xmaxPerth = 396000 307 yminPerth = 6449000 308 ymaxPerth = 6467000 309 -
anuga_work/production/perth/run_perth.py
r5817 r6032 226 226 227 227 kwargs={} 228 kwargs['file_name']=project.dir_comment 228 229 kwargs['finaltime']=project.finaltime 229 230 kwargs['output_dir']=project.output_run_time_dir -
anuga_work/production/perth/run_perth_250m.py
r5787 r6032 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.