Changeset 8655
- Timestamp:
- Nov 30, 2012, 11:21:04 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/utilities/sww_merge.py
r8648 r8655 195 195 print "MERGING SWW Files" 196 196 197 static_quantities = ['elevation']198 dynamic_quantities = ['stage', 'xmomentum', 'ymomentum']199 197 200 198 first_file = True … … 211 209 n_steps = len(times) 212 210 number_of_timesteps = fid.dimensions['number_of_timesteps'] 211 #print n_steps, number_of_timesteps 213 212 starttime = int(fid.starttime) 214 213 … … 238 237 g_points = num.zeros((number_of_global_nodes,2),num.float32) 239 238 239 quantities = ['elevation', 'stage', 'xmomentum', 'ymomentum'] 240 static_quantities = [] 241 dynamic_quantities = [] 242 243 for quantity in quantities: 244 # Test if elevation is static 245 if n_steps == fid.variables[quantity].shape[0]: 246 dynamic_quantities.append(quantity) 247 else: 248 static_quantities.append(quantity) 249 240 250 for quantity in static_quantities: 241 251 out_s_quantities[quantity] = num.zeros((number_of_global_nodes,),num.float32) … … 322 332 #out_s_quantities[quantity][node_l2g] = \ 323 333 # num.array(fid.variables[quantity],dtype=num.float32) 324 334 q = fid.variables[quantity] 335 print quantity, q.shape 325 336 out_s_quantities[quantity][f_node_l2g] = \ 326 num.array( fid.variables[quantity],dtype=num.float32)[fl_nodes]337 num.array(q,dtype=num.float32)[fl_nodes] 327 338 328 339 … … 335 346 # num.array(q[i],dtype=num.float32) 336 347 out_d_quantities[quantity][i][f_node_l2g] = \ 337 num.array(q[i] [fl_nodes],dtype=num.float32)348 num.array(q[i],dtype=num.float32)[fl_nodes] 338 349 339 350
Note: See TracChangeset
for help on using the changeset viewer.