performance - Slicing in PyTables -


what fastest way slice arrays saved in h5 using pytables?

the scenario following:

  1. the data saved (no need optimize here):

    filters = tables.filters(complib='blosc', complevel=5) h5file = tables.open_file(hd5_filename, mode='w',                           title='my data',                           filters=filters) group = h5file.create_group(h5file.root, 'data', 'data')  x_atom = tables.float32atom(shape=[50,50,50]) x = h5file.create_carray(group, 'x', atom=x_atom, title='xdata',                      shape=(1000,), filters=filters) 
  2. the data opened :

    h5file = tables.openfile(hd5_filename, mode="r") node = h5file.getnode('/', data_node) x = getattr(node, x_str) 
  3. this need optimization, need make lot of following kind of array slicing cannot sorted, many many indexes , different min/max locations:

    for index, min_x, min_y, min_z, max_x, max_y, max_z in my_very_long_list:         current_item = x[index][min_x:max_x,min_y:max_y,min_z:max_z]     do_something(current_item) 

the question is: fastest way task?


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -