

def get_dic(f, dataset='spectrum'):
    '\n    Get a dictionary from dataset in a HDF5 File\n    '
    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

dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/glue.py get_dic/original