def ChanModDS(ds, chan, mod=lambda x: x):
    """
    apply any well-behaved lambda function to a specific channel within a dataset
    :param ds: xarray dataset
    :param chan: channel to apply modification too
    :param mod: well-behaved lambda function
    :return: adds a channel with the modified data
    """


    for m in chan:
        if m in ds.keys():

            ds[m] = mod(ds[m])
            print('modifying ' + m + '..all done!')
            return mod(ds[m])