diff --git a/CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py b/CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py index 43d442171d33eecbe8a8459a90e7064e75cceabc..24e42878cfc84aeabd82eea95ccef175ad80ae23 100644 --- a/CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py +++ b/CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py @@ -361,6 +361,12 @@ class HolographyDataset(): """ starting_leaf = h5file[uri] result = dict() + + # Read the attributes in the hdf5 dataset + result['ATTRIBUTES'] = dict() + for attribute_key, attribute_value in starting_leaf.attrs: + result['ATTRIBUTES'][attribute_key] = attribute_value + for key, value in starting_leaf.items(): if isinstance(value, h5py.Group) is True: @@ -391,6 +397,11 @@ class HolographyDataset(): else: starting_leaf = h5file[uri] + # Store the attributes in the hdf5 dataset + attributes = data_to_store.pop('ATTRIBUTES', dict()) + for attribute_key, attribute_value in attributes.items(): + starting_leaf.attrs[attribute_key] = attribute_value + for key, value in data_to_store.items(): if isinstance(value, dict) is True: