Changeset 8655


Ignore:
Timestamp:
Nov 30, 2012, 11:21:04 AM (12 years ago)
Author:
steve
Message:

Problem with merging sww files with changing elevation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/utilities/sww_merge.py

    r8648 r8655  
    195195        print "MERGING SWW Files"
    196196       
    197     static_quantities = ['elevation']
    198     dynamic_quantities = ['stage', 'xmomentum', 'ymomentum']
    199197   
    200198    first_file = True
     
    211209            n_steps = len(times)
    212210            number_of_timesteps = fid.dimensions['number_of_timesteps']
     211            #print n_steps, number_of_timesteps
    213212            starttime = int(fid.starttime)
    214213           
     
    238237            g_points = num.zeros((number_of_global_nodes,2),num.float32)
    239238
     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               
    240250            for quantity in static_quantities:
    241251                out_s_quantities[quantity] = num.zeros((number_of_global_nodes,),num.float32)
     
    322332            #out_s_quantities[quantity][node_l2g] = \
    323333            #             num.array(fid.variables[quantity],dtype=num.float32)
    324 
     334            q = fid.variables[quantity]
     335            print quantity, q.shape
    325336            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]
    327338
    328339       
     
    335346                #           num.array(q[i],dtype=num.float32)
    336347                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]
    338349
    339350
Note: See TracChangeset for help on using the changeset viewer.