def put_dic(f, dic, dataset="spectrum"):
    """
    Put a dictionary to the dataset in a HDF5 File
    """

    # select the data set
    dset = f[dataset]

    for key, value in dic.items():

        # axis dictionaries
        if type(key) == int and type(value) == dict:
            axis = key
            for axiskey, axisvalue in value.items():
                fullkey = str(axis) + "_" + axiskey
                dset.attrs[fullkey] = axisvalue

        # simple value
        else:
            dset.attrs[key] = value
    return


# glue_* objects
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/fileio/glue.py/put_dic/original