def keys_from_position(position, width, height=None):
    """
    Generate a set of keys suitable to be used on a map generator to get a
    horizontal rectangular slice of a (t,x,y,z) space centered on position.
    (Returns a tuple (float, slice, slice, float).
    """

    if height is None:
        height = width
    return (position[0],
            slice(position[1] - width/2,  position[1] + width/2),
            slice(position[2] - height/2, position[2] + height/2),
            position[3])