def callback_factory(callback, k):
    """
    Setup a callback that's linked to a particular
    circular coordinate index.  Having this function takes
    care of scoping issues
    Parameters
    ----------
    callback: function
        The callback to use
    k: int
        The index of the circular coordinate
    """
    return lambda evt: callback(evt, k)