Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import h5py
- import km3pipe as kp
- f = h5py.File('concatenated.h5', 'r')
- p = kp.io.hdf5.HDF5Pump(filename='concatenated.h5', shuffle=False)
- #-- Print info of h5 with h5py --#
- print(f['group_info'][()])
- # array([(2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (2, 7),
- # (2, 8), (2, 9)],
- # dtype=[('blob_length', '<i8'), ('group_id', '<i8')])
- print(f['group_info'][0])
- # -----> (2, 0)
- print(f['y'][0]['event_id'])
- # -----> 3.0
- #-- Print info of h5 with HDF5Pump --#
- print(p[0]['GroupInfo'])
- # GroupInfo <class 'km3pipe.dataclasses.Table'>
- # HDF5 location: /group_info (no split)
- # <i8 (dtype: blob_length) = [2]
- # <i8 (dtype: group_id) = [0] <----
- print(p[0]['Y']['event_id'])
- # -----> [2.]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement