I am using hdf5 files to store calibration data. Now I want to use them. But i don't want keep the file open. I whant to do something like this:
fileHandle = h5py.File('calibration.hdf', 'r')
self.xcalib = fileHandle['x']
fileHandle.close()
And then just use xcalib independent of the file. the Problem is now that xcalib is just a h5py group object and will be close when the file is close. Is there a simple way to make it work? so that xcalib is eg. a normal dict. (there are multiple groups and datasets inside)
thanx for every helping comment :)
Edit: So is there no easy way to just make one complete group "offline"?
fileHandle['x']
contains multiple groups and datasets and i want it all copied or whatever. So doing
dict(fileHandle['x'])
just returns
{'0': <HDF5 group "/x/0" (4 members)>, '1': <HDF5 group "/x/1" (4 members)>, '2': <HDF5 group "/x/2" (4 members)>, '3': <HDF5 group "/x/3" (4 members)>}
And when i close the file those HDF5 groups are closed to.