Changeset 5761
- Timestamp:
- Sep 12, 2008, 12:26:50 PM (15 years ago)
- Location:
- anuga_work/production/perth
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/perth/build_boundary_27255.py
r5759 r5761 1 1 """ 2 build_boundary script creates a sts file and csv files. 3 The sts files is necessary for run_perth.py 4 The csv files are timeseries of the sts file determining the wave input 2 Script for building boundary to run tsunami inundation scenario for Perth, 3 WA, Australia. The boundary is based on the National Hazard Map. 5 4 6 This script is determined by an inidividual event generated through 7 the Hazard map, refer to David Burbidge for details of inidivdual events 5 Input: order_filename from project.py 6 Output: creates a sts file and csv files stored in project.boundaries_dir_event. 7 The run_perth.py is reliant on the output of this script. 8 8 """ 9 9 import os … … 102 102 s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], max(stage)) 103 103 fid_max.write(s) 104 105 #------------------------------------------------------------------------------ 106 # Get Minium wave height throughout timeseries at each index point 107 #------------------------------------------------------------------------------ 108 109 minname = 'min_sts_stage.csv' 110 fid_min = open(project.boundaries_dir_event+sep+maxname,'w') 111 s = 'index, x, y, max_stage \n' 112 fid_min.write(s) 113 for j in range(len(x)): 114 index= permutation[j] 115 stage = quantities['stage'][:,j] 116 xmomentum = quantities['xmomentum'][:,j] 117 ymomentum = quantities['ymomentum'][:,j] 118 119 s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], min(stage)) 120 fid_min.write(s) 104 121 122 123 105 124 fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w') 106 125 s = 'time, stage, xmomentum, ymomentum \n' 107 126 fid_sts.write(s) 108 127 128 #------------------------------------------------------------------------------ 129 # End of the get gauges 130 #------------------------------------------------------------------------------ 109 131 for k in range(len(time)-1): 110 132 s = '%.6f, %.6f, %.6f, %.6f\n' %(time[k], stage[k], xmomentum[k], ymomentum[k]) … … 114 136 115 137 fid.close() 116 138 139 117 140 return quantities,elevation,time 118 141 -
anuga_work/production/perth/build_boundary_27283.py
r5759 r5761 1 1 """ 2 build_boundary script creates a sts file and csv files. 3 The sts files is necessary for run_perth.py 4 The csv files are timeseries of the sts file determining the wave input 2 Script for building boundary to run tsunami inundation scenario for Perth, 3 WA, Australia. The boundary is based on the National Hazard Map. 5 4 6 This script is determined by an inidividual event generated through 7 the Hazard map, refer to David Burbidge for details of inidivdual events 5 Input: order_filename from project.py 6 Output: creates a sts file and csv files stored in project.boundaries_dir_event. 7 The run_perth.py is reliant on the output of this script. 8 8 """ 9 9 import os … … 141 141 s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], max(stage)) 142 142 fid_max.write(s) 143 144 #------------------------------------------------------------------------------ 145 # Get Minium wave height throughout timeseries at each index point 146 #------------------------------------------------------------------------------ 147 148 minname = 'min_sts_stage.csv' 149 fid_min = open(project.boundaries_dir_event+sep+maxname,'w') 150 s = 'index, x, y, max_stage \n' 151 fid_min.write(s) 152 for j in range(len(x)): 153 index= permutation[j] 154 stage = quantities['stage'][:,j] 155 xmomentum = quantities['xmomentum'][:,j] 156 ymomentum = quantities['ymomentum'][:,j] 157 158 s = '%d, %.6f, %.6f, %.6f\n' %(index, x[j], y[j], min(stage)) 159 fid_min.write(s) 143 160 161 162 144 163 fid_sts = open(project.boundaries_dir_event+sep+basename+'_'+ str(index)+'.csv', 'w') 145 164 s = 'time, stage, xmomentum, ymomentum \n' 146 165 fid_sts.write(s) 147 166 167 #------------------------------------------------------------------------------ 168 # End of the get gauges 169 #------------------------------------------------------------------------------ 148 170 for k in range(len(time)-1): 149 171 s = '%.6f, %.6f, %.6f, %.6f\n' %(time[k], stage[k], xmomentum[k], ymomentum[k]) … … 153 175 154 176 fid.close() 155 177 178 156 179 return quantities,elevation,time 157 180 -
anuga_work/production/perth/build_perth.py
r5759 r5761 1 """Script for running tsunami inundation scenario for Perth, WA, Australia. 1 """ 2 Script for building the elevation data to run tsunami inundation scenario 3 for Perth, WA, Australia. 2 4 3 Source data such as elevation and boundary data is assumed to be available in 4 directories specified by project.py 5 The output sww file is stored in project.output_time_dir 6 7 The scenario is defined by a triangular mesh created from project.polygon, 8 the elevation data and a simulated submarine landslide. 9 5 Input: elevation data from project.py 6 Output: pts file stored in project.topographies_dir 10 7 The run_perth.py is reliant on the output of this script. 11 8 -
anuga_work/production/perth/export_results_all.py
r5759 r5761 1 1 """ 2 Generates ascii grids of nominated areas - need sww file created in run_perth.py 2 Generates ascii grids of nominated areas - 3 Input: sww file from run_perth.py 4 boundaries for grids from project.py 5 Outputs: ascii grids of specified variables 6 Stored in the 'outputs_dir' folder for respective .sww file 7 8 Note: 3 9 If producing a grid for the enitre extent cellsize should be greater than 30m 4 10 If producing grids for inundation area resolution should be greater than mesh (ie ~22m) … … 12 18 from os import sep 13 19 20 directory = project.output_dir 21 14 22 #time_dir = '20080526_104946_run_final_0.6_test_kvanputt' 15 23 #time_dir = '20080530_170833_run_final_0.6_exmouth_kvanputt' 16 #time_dir= '20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt'17 time_dir = '20080909_151438_run_final_0.0_polyline_alpha0.1_kvanputt'24 time_dir1 = '20080815_103442_run_final_0.0_polyline_alpha0.1_kvanputt' 25 time_dir2 = '20080909_151438_run_final_0.0_polyline_alpha0.1_kvanputt' 18 26 19 27 #cellsize = 20 … … 26 34 var = [0,4] #stage and elevation 27 35 36 time_dir = [time_dir1, time_dir2] 37 for time_dir in time_dirs: 28 38 29 directory = project.output_dir 30 name1 = directory+time_dir+sep+project.scenario_name 31 name2 = directory+time_dir+sep+'sww2'+sep+project.scenario_name+'_time_39900_0' 39 name1 = directory+time_dir+sep+project.scenario_name 40 name2 = directory+time_dir+sep+'sww2'+sep+project.scenario_name+'_time_39900_0' #need to get assistance on how to make this into anything 32 41 33 names = [name1, name2]34 for name in names:42 names = [name1, name2] 43 for name in names: 35 44 36 for which_area in area:37 if which_area == 'All':38 39 if which_area == 'Geordie':40 easting_min = project.xminGeordie41 easting_max = project.xmaxGeordie42 northing_min = project.yminGeordie43 northing_max = project.ymaxGeordie45 for which_area in area: 46 if which_area == 'All': 47 48 if which_area == 'Geordie': 49 easting_min = project.xminGeordie 50 easting_max = project.xmaxGeordie 51 northing_min = project.yminGeordie 52 northing_max = project.ymaxGeordie 44 53 45 if which_area == 'Sorrento':46 easting_min = project.xminSorrento47 easting_max = project.xmaxSorrento48 northing_min = project.yminSorrento49 northing_max = project.ymaxSorrento54 if which_area == 'Sorrento': 55 easting_min = project.xminSorrento 56 easting_max = project.xmaxSorrento 57 northing_min = project.yminSorrento 58 northing_max = project.ymaxSorrento 50 59 51 if which_area == 'Fremantle':52 easting_min = project.xminFremantle53 easting_max = project.xmaxFremantle54 northing_min = project.yminFremantle55 northing_max = project.ymaxFremantle60 if which_area == 'Fremantle': 61 easting_min = project.xminFremantle 62 easting_max = project.xmaxFremantle 63 northing_min = project.yminFremantle 64 northing_max = project.ymaxFremantle 56 65 57 if which_area == 'Rockingham':58 easting_min = project.xminRockingham59 easting_max = project.xmaxRockingham60 northing_min = project.yminRockingham61 northing_max = project.ymaxRockingham66 if which_area == 'Rockingham': 67 easting_min = project.xminRockingham 68 easting_max = project.xmaxRockingham 69 northing_min = project.yminRockingham 70 northing_max = project.ymaxRockingham 62 71 63 64 for which_var in var:65 if which_var == 0: # Stage66 outname = name + which_area + '_stage'67 quantityname = 'stage'72 73 for which_var in var: 74 if which_var == 0: # Stage 75 outname = name + which_area + '_stage' 76 quantityname = 'stage' 68 77 69 if which_var == 1: # Absolute Momentum70 outname = name + which_area + '_momentum'71 quantityname = '(xmomentum**2 + ymomentum**2)**0.5'78 if which_var == 1: # Absolute Momentum 79 outname = name + which_area + '_momentum' 80 quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 72 81 73 if which_var == 2: # Depth74 outname = name + which_area + '_depth'75 quantityname = 'stage-elevation'82 if which_var == 2: # Depth 83 outname = name + which_area + '_depth' 84 quantityname = 'stage-elevation' 76 85 77 if which_var == 3: # Speed78 outname = name + which_area + '_speed'79 #quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed80 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)' #Speed81 82 if which_var == 4: # Elevation83 outname = name + which_area + '_elevation'84 quantityname = 'elevation' #Elevation86 if which_var == 3: # Speed 87 outname = name + which_area + '_speed' 88 #quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed 89 quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6)' #Speed 90 91 if which_var == 4: # Elevation 92 outname = name + which_area + '_elevation' 93 quantityname = 'elevation' #Elevation 85 94 86 if which_area == 'All'87 print 'start sww2dem',which_area88 sww2dem(name, basename_out = outname,89 quantity = quantityname,90 #timestep = timestep,91 cellsize = cellsize,92 reduction = max,93 verbose = True,94 format = 'asc')95 if which_area == 'All' 96 print 'start sww2dem',which_area 97 sww2dem(name, basename_out = outname, 98 quantity = quantityname, 99 #timestep = timestep, 100 cellsize = cellsize, 101 reduction = max, 102 verbose = True, 103 format = 'asc') 95 104 96 else:97 print 'start sww2dem',which_area, easting_min98 sww2dem(name, basename_out = outname,99 quantity = quantityname,100 #timestep = timestep,101 cellsize = cellsize,102 easting_min = easting_min,103 easting_max = easting_max,104 northing_min = northing_min,105 northing_max = northing_max,106 reduction = max,107 verbose = True,108 format = 'asc')105 else: 106 print 'start sww2dem',which_area, easting_min 107 sww2dem(name, basename_out = outname, 108 quantity = quantityname, 109 #timestep = timestep, 110 cellsize = cellsize, 111 easting_min = easting_min, 112 easting_max = easting_max, 113 northing_min = northing_min, 114 northing_max = northing_max, 115 reduction = max, 116 verbose = True, 117 format = 'asc') 109 118 -
anuga_work/production/perth/get_timeseries.py
r5759 r5761 1 1 """ 2 Generate time series of nominated "gauges" read from project.gauge_filename. This 3 is done by running sww2csv_gauges to make 'csv' files in the 'output_dir' containing 4 the details at the gauges for both these sww files. 2 Generate time series of nominated "gauges". 3 Input: sww file from run_perth.py 4 gauges project.gauge_filename 5 Output: csv files stage,speed,depth,elevation over time 6 Stored in the 'outputs_dir' folder for respective .sww file 7 8 Note: 5 9 Can run different sww files at the same time 6 10 make sure if there is a second sww file that it is placed into a folder called sww2 -
anuga_work/production/perth/project.py
r5759 r5761 1 """Common filenames and locations for topographic data, meshes and outputs.2 Simplified and Commented by Kristy Van Putten 1 """Common filenames and locations for elevation, meshes and outputs. 2 This script is the heart of all scripts in folder 3 3 """ 4 4 #------------------------------------------------------------------------------ -
anuga_work/production/perth/run_perth.py
r5759 r5761 1 1 """Script for running tsunami inundation scenario for Perth, WA, Australia. 2 3 Source data such as elevation and boundary data is assumed to be available in4 directories specified by project.py5 The output sww file is stored in project.output_run_time_dir6 2 7 3 The scenario is defined by a triangular mesh created from project.polygon, 8 4 the elevation data is combiled into a pts file through build_perth.py 9 5 and a simulated tsunami is generated through an sts file from build_boundary.py 6 7 Input: sts file (build_boundary.py for resepective event) 8 pts file (build_perth.py) 9 information from project file 10 Outputs: sww file stored in project.output_run_time_dir 11 The export_results_all.py and get_timeseries.py is reliant 12 on the outputs of this script 10 13 11 14 Ole Nielsen and Duncan Gray, GA - 2005, Jane Sexton, Nick Bartzis, GA - 2006
Note: See TracChangeset
for help on using the changeset viewer.