Hi All,

I have a question about reading through a file in a smart way.

I am trying to write a generic executable to read a data file, and with user 
input, grab a certain array from an hdf5 file.

./my_data_analyzer -i my_data.h5 -other_args


The structure of the files is 

f = tables.openFile('my_data.h5')

f.root.childNode.childNode....dataArray

where I do not know ahead of time how deep the childNodes go.  My general 
strategy was to query the user (me and a colleague) which particular array we 
would like to analyze.  So I was thinking to use raw_input to ask which node 
the user wants - but providing a list of possibilities

for node in f.walkNodes():
        print node

if the user provides the full path to the data array - then read as numpy array 
- but if the user provides only partial path (maybe just the top level group) 
then query further until the user finds the full path, and finally read as 
numpy array.

Also - given the data files, some of the groups (childNodes) likely won't obey 
the NaturalName conventions - in case that matters.

1) is my goal clear?
2) does anyone have a clever way to do this?  some sort of recursive query with 
raw_input to get the desired data.


Thanks,

Andre





------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to