

def put_dic(f, dic, dataset='spectrum'):
    '\n    Put a dictionary to the dataset in a HDF5 File\n    '
    dset = f[dataset]
    for (key, value) in dic.items():
        if ((type(key) == int) and (type(value) == dict)):
            axis = key
            for (axiskey, axisvalue) in value.items():
                fullkey = ((str(axis) + '_') + axiskey)
                dset.attrs[fullkey] = axisvalue
        else:
            dset.attrs[key] = value
    return

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