Changeset 7684
 Timestamp:
 Apr 13, 2010, 4:31:20 PM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/anuga_1_1/anuga_work/production/bunbury_storm_surge_2009/process_gems_grids.py
r7683 r7684 139 139 number_of_points = ncols * nrows 140 140 141 # insert nodata test here 142 141 143 for i in xrange(number_of_timesteps): 142 144 j = number_of_points * i 143 145 k = j + number_of_points 144 146 d = stage[j:k]  elevation # Assumes elevations below sea level are negative 145 depth[j:k] = [0 if x< 500 else x for x in d] # sets stage to zero for nodata values of stage147 depth[j:k] = [0 if x<9000 else x for x in d] # sets stage to zero for nodata values of stage 146 148 147 149 # depth[j:k] = [x if x>=0 and elevation>0 else 0 for x in d] # This is to correct for GEMS data which assumes stage=0 onshore when dry but should = elevation … … 162 164 mx = momentum[i]*math.sin(math.radians(t)) #Assuming t is in the "to" direction and 0 degrees is north 163 165 my = momentum[i]*math.cos(math.radians(t)) 164 assert mx > = 0 and my >=0165 if t > 90.0 and t < 180.0:166 assert mx > 0 and my > 0 167 elif t > 90.0 and t < 180.0: 166 168 mx = momentum[i]*math.sin(math.radians(t)) 167 169 my = momentum[i]*math.cos(math.radians(t)) 168 assert mx > = 0 and my <=0169 if t > 180.0 and t < 270.0:170 assert mx > 0 and my < 0 171 elif t > 180.0 and t < 270.0: 170 172 mx = momentum[i]*math.cos(math.radians(t)) 171 173 my = momentum[i]*math.sin(math.radians(t)) 172 assert mx < = 0 and my <=0173 if t > 270.0 and t < 360.0:174 assert mx < 0 and my < 0 175 elif t > 270.0 and t < 360.0: 174 176 mx = momentum[i]*math.sin(math.radians(t)) 175 177 my = momentum[i]*math.cos(math.radians(t)) 176 assert mx < = 0 and my >=0177 if t == 0.0 or t == 360.0:178 assert mx < 0 and my > 0 179 elif t == 0.0 or t == 360.0: 178 180 mx = 0 179 181 my = momentum[i] 180 182 assert my >= 0 181 if t == 90.0:183 elif t == 90.0: 182 184 mx = momentum[i] 183 185 my = 0 184 186 assert mx >= 0 185 if t == 180.0:187 elif t == 180.0: 186 188 mx = 0 187 189 my = momentum[i] 188 190 assert my <= 0 189 if t == 270.0:191 elif t == 270.0: 190 192 mx = momentum[i] 191 193 my = 0 192 194 assert mx <= 0 193 if t == 9999:195 elif t == 9999: 194 196 mx = 0 195 197 my = 0 198 else: 199 print "Unexpected value of theta" 200 exit() 196 201 197 202 xmomentum[i] = mx
Note: See TracChangeset
for help on using the changeset viewer.