def get_dic(f, dataset='spectrum'):
    """
    Get a dictionary from dataset in a HDF5 File
    """
    dset = f[dataset]
    dic = {}
    for key, value in dset.attrs.items():
        if '_' in key:
            axis, subkey = key.split('_', 1)
            axis = int(axis)
            if axis not in dic:
                dic[axis] = {}
            dic[axis][subkey] = value
        else:
            dic[key] = value
    return dic
