ptrepack is almost what i want except that it only has the options to overwrite or ignore duplicate paths. the example below illustrates what i want to happen with the structures
input file one
/ (RootGroup) ''
/data_set_name (Group) 'group of images files'
/data_set_name_Set (EArray(7913, 128)) ''
/data_set_name/image_set_index (Table(3,)) ''
/data_set_name/i100 (Group) 'sift features and coordinates'
/data_set_name/i100/descriptors (Array(7913, 128)) 'sift descriptors'
/data_set_name/i100/locations (Array(7913, 4)) 'sift feature locations'
input file two
/ (RootGroup) ''
/data_set_name (Group) 'group of images files'
/data_set_name_Set (EArray(4328, 128)) ''
/data_set_name/image_set_index (Table(4,)) ''
/data_set_name/i1156 (Group) 'sift features and coordinates'
/data_set_name/i1156/descriptors (Array(4328, 128)) 'sift descriptors'
/data_set_name/i1156/locations (Array(4328, 4)) 'sift feature locations'
desired output
/ (RootGroup) ''
/data_set_n开发者_StackOverflow中文版ame (Group) 'group of images files'
/data_set_name_Set (EArray(12241, 128)) ''
/data_set_name/image_set_index (Table(7,)) ''
/data_set_name/i100 (Group) 'sift features and coordinates'
/data_set_name/i100/descriptors (Array(7913, 128)) 'sift descriptors'
/data_set_name/i100/locations (Array(7913, 4)) 'sift feature locations'
/data_set_name/i1156 (Group) 'sift features and coordinates'
/data_set_name/i1156/descriptors (Array(4328, 128)) 'sift descriptors'
/data_set_name/i1156/locations (Array(4328, 4)) 'sift feature locations'
Whats an efficient way to go about doing this?
You mean to automagically enlarge datasets with the same paths? Hmmm, I haven't thought about this, but looks like a nice feature to implement (although only valid for enlargeable arrays). Added a ticket:
http://pytables.org/trac/ticket/325
精彩评论