Changeset 7680
- Timestamp:
- Apr 12, 2010, 4:18:53 PM (15 years ago)
- Location:
- branches/anuga_1_1/anuga_work/production/mandurah_storm_surge_2009
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/anuga_1_1/anuga_work/production/mandurah_storm_surge_2009/gems_comparison/project_GEMS.py
r7677 r7680 99 99 # Format for points easting,northing (no header) 100 100 interior_regions_data = [['intermediate.csv', 2500], 101 ['area_of_interest.csv', 100],102 ['canals_nth_2.csv', 100], # Canal regions used to force mesh to fit canals103 ['canals_nth_3.csv', 100],104 ['canals_nth_4.csv', 100],105 ['canals_nth_5.csv', 100],106 ['canals_nth_6.csv', 100],107 ['canals_nth_7.csv', 100],108 ['canals_nth_8.csv', 100],109 ['canals_nth_9.csv', 100],110 ['canals_nth_10.csv', 100],111 ['canals_nth_11.csv', 100],112 ['canals_nth_12.csv', 100],113 ['canals_sth_1.csv', 100],114 ['canals_sth_2.csv', 100],115 ['canals_sth_3.csv', 100],116 ['canals_sth_4.csv', 100],117 ['canals_sth_5.csv', 100],118 ['canals_sth_6.csv', 100]]101 ['area_of_interest.csv', 200], 102 ['canals_nth_2.csv', 200], # Canal regions used to force mesh to fit canals 103 ['canals_nth_3.csv', 200], 104 ['canals_nth_4.csv', 200], 105 ['canals_nth_5.csv', 200], 106 ['canals_nth_6.csv', 200], 107 ['canals_nth_7.csv', 200], 108 ['canals_nth_8.csv', 200], 109 ['canals_nth_9.csv', 200], 110 ['canals_nth_10.csv', 200], 111 ['canals_nth_11.csv', 200], 112 ['canals_nth_12.csv', 200], 113 ['canals_sth_1.csv', 200], 114 ['canals_sth_2.csv', 200], 115 ['canals_sth_3.csv', 200], 116 ['canals_sth_4.csv', 200], 117 ['canals_sth_5.csv', 200], 118 ['canals_sth_6.csv', 200]] 119 119 120 120 # LAND - used to set the initial stage/water to be offcoast only -
branches/anuga_1_1/anuga_work/production/mandurah_storm_surge_2009/process_gems_grids.py
r7677 r7680 22 22 state = 'western_australia' 23 23 scenario_folder = 'mandurah_storm_surge_scenario_2009' 24 event = 'Man_1_TCAlby' 24 event = 'Man1_TC_Alby' 25 26 print "Processing event: ", event 25 27 26 28 ENV_INUNDATIONHOME = 'INUNDATIONHOME' … … 37 39 #----------------------- 38 40 elevation_file_name = os.path.join(event_folder, 'topog_flip.asc') # Name of the vertically flipped elevation grid 41 42 print "Elevation file name: ", elevation_file_name 43 39 44 grid_file_names = glob.glob(os.path.join(event_folder, '*.gz')) 40 45 grid_file_names.sort() 41 46 number_of_timesteps = len(grid_file_names) 42 grid_size = 0.0005# cellsize from the GEMSURGE output grids47 grid_size = 20 # cellsize from the GEMSURGE output grids 43 48 start_time = 0 # all times in seconds 44 end_time = 88200 #all times in seconds45 timestep = 1800 # all times in seconds49 end_time = 61200 # end_time = start_time + timestep*number of grid_file_names. all times in seconds 50 timestep = 720 # all times in seconds 46 51 refzone = 50 # UTM zone of model 47 x_origin = 115.550 #364221.03 # xllcorner from GEMSURGE output grids48 y_origin = -32.790 #6371062.71 # yllcorner from GEMSURGE output grids52 x_origin = 368600 #364221.03 # xllcorner from GEMSURGE output grids 53 y_origin = 6304600 #6371062.71 # yllcorner from GEMSURGE output grids 49 54 event_sts = os.path.join(event_folder, event) 50 55 … … 120 125 assert stage.size == number_of_timesteps * elevation.size 121 126 127 d = numpy.empty(elevation.size, dtype='d') 122 128 depth = numpy.empty(stage.size, dtype='d') 123 129 number_of_points = ncols * nrows … … 126 132 j = number_of_points * i 127 133 k = j + number_of_points 128 depth[j:k] = stage[j:k] - elevation # Check GEMS elevations below sea level are negative 129 134 d = stage[j:k] - elevation # Check GEMS elevations below sea level are negative 135 depth[j:k] = [0 if x<-9900 else x for x in d] 136 137 # depth[j:k] = [x if x>=0 and elevation>0 else 0 for x in d] # This is to correcto for GEMS data which assumes stage=0 onshore when dry but should = elevation 138 # for q in xrange(number_of_points): 139 # if elevation[q] >= 0 and stage[j+q]==0: 140 # depth[j+q] = 0 141 130 142 momentum = depth * speed 131 143 … … 142 154 assert mx > 0 and my > 0 143 155 if t > 90.0 and t < 180.0: 144 mx = momentum[i]*math.sin(math.radians( 180 -t))145 my = momentum[i]*math.cos(math.radians( 180 -t))156 mx = momentum[i]*math.sin(math.radians(t)) 157 my = momentum[i]*math.cos(math.radians(t)) 146 158 assert mx > 0 and my < 0 147 159 if t > 180.0 and t < 270.0: 148 mx = momentum[i]*math.cos(math.radians( 270 -t))149 my = momentum[i]*math.sin(math.radians( 270 -t))160 mx = momentum[i]*math.cos(math.radians(t)) 161 my = momentum[i]*math.sin(math.radians(t)) 150 162 assert mx < 0 and my < 0 151 163 if t > 270.0 and t < 360.0: 152 mx = momentum[i]*math.sin(math.radians( 360 -t))153 my = momentum[i]*math.cos(math.radians( 360 -t))164 mx = momentum[i]*math.sin(math.radians(t)) 165 my = momentum[i]*math.cos(math.radians(t)) 154 166 assert mx < 0 and my > 0 155 167 if t == 0.0 or t == 360.0: 156 168 mx = 0 157 169 my = momentum[i] 158 assert my > 0170 assert my >= 0 159 171 if t == 90.0: 160 172 mx = momentum[i] 161 173 my = 0 162 assert mx > 0174 assert mx >= 0 163 175 if t == 180.0: 164 176 mx = 0 165 my = momentum[i]166 assert my < 0177 my = -momentum[i] 178 assert my <= 0 167 179 if t == 270.0: 168 mx = momentum[i]180 mx = -momentum[i] 169 181 my = 0 170 assert mx < 0182 assert mx <= 0 171 183 172 184 xmomentum[i] = mx 173 185 ymomentum[i] = my 174 186 175 assert m x[i]^2 + my[i]^2 == momentum[i]187 assert math.sqrt(mx**2 + my**2) - momentum[i] < 1.e-06 176 188 177 189 x_origin_int = int(10000*x_origin) -
branches/anuga_1_1/anuga_work/production/mandurah_storm_surge_2009/project.py
r7677 r7680 104 104 # Format for points easting,northing (no header) 105 105 interior_regions_data = [['intermediate.csv', 2500], 106 ['area_of_interest.csv', 100],107 ['canals_nth_2.csv', 100], # Canal regions used to force mesh to fit canals108 ['canals_nth_3.csv', 100],109 ['canals_nth_4.csv', 100],110 ['canals_nth_5.csv', 100],111 ['canals_nth_6.csv', 100],112 ['canals_nth_7.csv', 100],113 ['canals_nth_8.csv', 100],114 ['canals_nth_9.csv', 100],115 ['canals_nth_10.csv', 100],116 ['canals_nth_11.csv', 100],117 ['canals_nth_12.csv', 100],118 ['canals_sth_1.csv', 100],119 ['canals_sth_2.csv', 100],120 ['canals_sth_3.csv', 100],121 ['canals_sth_4.csv', 100],122 ['canals_sth_5.csv', 100],123 ['canals_sth_6.csv', 100]]106 ['area_of_interest.csv', 200], 107 ['canals_nth_2.csv', 200], # Canal regions used to force mesh to fit canals 108 ['canals_nth_3.csv', 200], 109 ['canals_nth_4.csv', 200], 110 ['canals_nth_5.csv', 200], 111 ['canals_nth_6.csv', 200], 112 ['canals_nth_7.csv', 200], 113 ['canals_nth_8.csv', 200], 114 ['canals_nth_9.csv', 200], 115 ['canals_nth_10.csv', 200], 116 ['canals_nth_11.csv', 200], 117 ['canals_nth_12.csv', 200], 118 ['canals_sth_1.csv', 200], 119 ['canals_sth_2.csv', 200], 120 ['canals_sth_3.csv', 200], 121 ['canals_sth_4.csv', 200], 122 ['canals_sth_5.csv', 200], 123 ['canals_sth_6.csv', 200]] 124 124 125 125 # LAND - used to set the initial stage/water to be offcoast only
Note: See TracChangeset
for help on using the changeset viewer.